I've been using Entity framework code first in a project and all the tables have been created /modified a while ago. Now I need to add an unique constraint to a table. I want to create a migration which will have the following row in the Up()
method. And there is no change on the model classes.
CreateIndex("TableName", new[] { "Column1" }, true, "IX_UniqueKey");
And maybe the following row in the Down()
DropIndex("TableName", new [] { "Column1" });
Can I just manually create a file under the folder Migrations? And is there any mandatory file name convention?
How to create the .Designer.cs
and .resx
files? Or should I use add-migration
with some parameters?
add-migration name
still generate the files with emptyUp()
andDown()
? – Vltava