SapientGuardian.EntityFrameworkCore.MySql
SapientGuardian.EntityFrameworkCore.MySql copied to clipboard
Rename Column using migration
trafficstars
Hi, I am using spaientGuardian with ASP Net Core 1.1 in a code first model, when i try to rename a column using migrations and update the database the column does not change its name.
See example below.
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Type",
table: "Category",
newName: "Name");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Name",
table: "Category",
newName: "Type");
}
Do you have a <YourContext>ModelSnapshot.cs file in your Migrations folder?
Yes i have a ModelSnapshot
Can you share it, or at least the bits that are relevant to that column?