I have table properties in my MySQL database and my requirement is it should have fixed records with some default values. I want that table should get auto filled with the help of migration in code first approch of Entity Framework. I am dealing with migration first time so I want help in the same.
My current migration is as follows:
public override void Up()
{
CreateTable(
"dbo.properties",
c => new
{
id = c.Int(nullable: false, identity: true),
property_name = c.Int(nullable: false),
value = c.String(nullable: false, maxLength: 255, storeType: "nvarchar"),
type = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.Index(t => t.property_name, unique: true, name: "uk_property_name");
}
public override void Down()
{
DropIndex("dbo.properties", "uk_property_name");
DropTable("dbo.properties");
}