I create code first model using entity framework and after install first version to client we found some change in columns of database , I use migration of Entity Framework and you apply all steps of migration bat the data base of client not exist rows of migration history of last change and show this message if execute
Table 'nameTable' already exists
or
Additional information: Duplicate column name 'Reference'
this code of class configuration
internal sealed class Configuration : DbMigrationsConfiguration<GSM.DataAccess.GSMContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
AutomaticMigrationDataLossAllowed = false;
SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator());
}
protected override void Seed(GSM.DataAccess.GSMContext context)
{
}
}
and this code of class first migration
public partial class AddMoreInformationColumn : DbMigration
{
public override void Up()
{
AddColumn("dbo.People", "Reference", c => c.String(unicode: false));
AddColumn("dbo.Products", "Reference", c => c.String(unicode: false));
AddColumn("dbo.Products", "SalePrice", c => c.String(unicode: false));
AddColumn("dbo.Products", "WholePrice", c => c.String(unicode: false));
}
public override void Down()
{
DropColumn("dbo.People", "Address");
DropColumn("dbo.People", "Reference");
DropColumn("dbo.Products", "Reference");
DropColumn("dbo.Products", "SalePrice");
DropColumn("dbo.Products", "WholePrice");
}
}