Browse Source

-

pull/12/MERGE
sunkaixuan 8 years ago
parent
commit
2ca86984ae
  1. 3
      SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs

3
SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs

@ -154,7 +154,8 @@ namespace SqlSugar
this.Context.DbMaintenance.DropConstraint(tableName, constraintName); this.Context.DbMaintenance.DropConstraint(tableName, constraintName);
this.Context.DbMaintenance.DropColumn(tableName, item.DbColumnName); this.Context.DbMaintenance.DropColumn(tableName, item.DbColumnName);
this.Context.DbMaintenance.AddColumn(tableName, EntityColumnToDbColumn(entityInfo, tableName, item)); this.Context.DbMaintenance.AddColumn(tableName, EntityColumnToDbColumn(entityInfo, tableName, item));
this.Context.DbMaintenance.AddPrimaryKey(tableName, item.DbColumnName); if (item.IsPrimarykey)
this.Context.DbMaintenance.AddPrimaryKey(tableName, item.DbColumnName);
} }
} }
if (isChange && IsBackupTable) if (isChange && IsBackupTable)

Loading…
Cancel
Save