I had a field with following attributes:
[Column("Name")]
[StringLength(50)]
public string Name { get; set; }
The migration for this field looked like this:
CreateTable(
"dbo.TEST",
c => new
{
Id = c.Int(nullable: false),
Name = c.String(maxLength: 50),
})
.PrimaryKey(t => t.Id)
.Index(t => t.Id
);
Then I changed the field like this:
[Column("Test_Name")]
[StringLength(255)]
public string TestName { get; set; }
and executed Add-Migration
, but the StringLength
change was not included it is still NVARCHAR2(50)
in my Oracle DB and the new migration looks like this:
RenameColumn(table: "dbo.TEST", name: "Name", newName: "Test_Name");
Is this a common problem?
What do I need to do so that the length is also changed in the DB?