mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-16 21:19:34 +08:00
Update CodeFirst
This commit is contained in:
parent
2a12be7198
commit
384af91b02
@ -22,6 +22,7 @@ namespace SqlSugar
|
||||
if (entityInfo.IsCreateTableFiledSort)
|
||||
{
|
||||
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
|
||||
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();
|
||||
}
|
||||
}
|
||||
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();
|
||||
|
@ -24,6 +24,7 @@ namespace SqlSugar
|
||||
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
|
||||
}
|
||||
}
|
||||
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();
|
||||
this.Context.DbMaintenance.CreateTable(tableName, columns,true);
|
||||
}
|
||||
protected override DbColumnInfo EntityColumnToDbColumn(EntityInfo entityInfo, string tableName, EntityColumnInfo item)
|
||||
|
@ -28,6 +28,7 @@ namespace SqlSugar
|
||||
if (entityInfo.IsCreateTableFiledSort)
|
||||
{
|
||||
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
|
||||
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();
|
||||
}
|
||||
}
|
||||
this.Context.DbMaintenance.CreateTable(tableName, columns,true);
|
||||
|
@ -131,6 +131,7 @@ namespace SqlSugar
|
||||
if (entityInfo.IsCreateTableFiledSort)
|
||||
{
|
||||
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
|
||||
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();
|
||||
}
|
||||
}
|
||||
this.Context.DbMaintenance.CreateTable(tableName, columns,true);
|
||||
|
Loading…
Reference in New Issue
Block a user