IW4M-Admin/SharedLibraryCore/Migrations/20191225202141_SetCaseSensitiveCoallationForAliasNameMySQL.cs
RaidMax c4df53c195 fix issue with script plugins not reloading (AB#2)
fix issues with collation on MySQL (AB#1)
2019-12-25 14:32:57 -06:00

25 lines
823 B
C#

using Microsoft.EntityFrameworkCore.Migrations;
namespace SharedLibraryCore.Migrations
{
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)
{
}
}
}