I've spent last couple of days looking here and here and here among others, but these don't clearly apply to my case, where I'm trying to update a database after a successful.
dotnet ef migrations add RenameColumnAlert_Identifier
In Microsoft.AspNetCore.All (2.0.7) MVC application. I'm using MySql.Data.EntityFrameworkCore (6.10.6) and I thoroughly edited the Migration Up and the ApplicationDbContextModelSnapshot files before attempting the database update. But I still get the Exception copied into my question.
Basically I changed 'Identifier' to 'Alert_Identifier' in Alert.cs class and its associated db table and used 'Alert_Identifier' as foreign key for three other classes/tables.
Migration:
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Identifier",
table: "Alert");
migrationBuilder.RenameColumn(
name: "language",
table: "Info",
newName: "Language");
migrationBuilder.RenameColumn(
name: "Language",
table: "Alert",
newName: "Alert_Identifier");
migrationBuilder.AddColumn<string>(
name: "Alert_Identifier",
table: "Resource",
nullable: false);
migrationBuilder.AddColumn<string>(
name: "Alert_Identifier",
table: "Info",
nullable: false);
migrationBuilder.AddColumn<string>(
name: "Alert_Identifier",
table: "Area",
nullable: false);
}
Specifically, the Stack Trace starts with: at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(RenameColumnOperation operation, IModel model, MigrationCommandListBuilder builder)
This seems to indicate that there is something amiss with the RenameColumnoperation
. Is this not yet implemented? Is there a workaround? Any help would be greatly appreciated.