2019-12-25 15:32:57 -05:00
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
2021-03-22 12:09:25 -04:00
|
|
|
|
namespace Data.Migrations.Postgresql
|
2019-12-25 15:32:57 -05:00
|
|
|
|
{
|
|
|
|
|
public partial class SetCaseSensitiveCoallationForAliasNameMySQL : Migration
|
|
|
|
|
{
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (migrationBuilder.ActiveProvider == "Pomelo.EntityFrameworkCore.MySql")
|
|
|
|
|
{
|
|
|
|
|
// this prevents duplicate aliases from being added by changing it to case sensitive collation
|
|
|
|
|
migrationBuilder.Sql(@"ALTER TABLE `EFAlias` MODIFY
|
|
|
|
|
`Name` VARCHAR(24)
|
|
|
|
|
CHARACTER SET utf8
|
|
|
|
|
COLLATE utf8_bin;");
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|