mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 ICodeFirst.SyncStructure(TableInfo) 重载方法迁移表结构;
This commit is contained in:
@ -79,7 +79,7 @@ namespace FreeSql.QuestDb
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override string GetComparisonDDLStatements(params TypeAndName[] objects)
|
||||
protected override string GetComparisonDDLStatements(params TypeSchemaAndName[] objects)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
var seqcols = new List<NativeTuple<ColumnInfo, string[], bool>>(); //序列
|
||||
@ -87,10 +87,10 @@ namespace FreeSql.QuestDb
|
||||
foreach (var obj in objects)
|
||||
{
|
||||
if (sb.Length > 0) sb.Append("\r\n");
|
||||
var tb = _commonUtils.GetTableByEntity(obj.entityType);
|
||||
if (tb == null) throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.entityType.FullName));
|
||||
var tb = obj.tableSchema;
|
||||
if (tb == null) throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
|
||||
if (tb.Columns.Any() == false)
|
||||
throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.entityType.FullName));
|
||||
throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
|
||||
var tbname = tb.DbName;
|
||||
var tboldname = tb.DbOldName;
|
||||
if (string.IsNullOrEmpty(obj.tableName) == false)
|
||||
@ -147,7 +147,7 @@ namespace FreeSql.QuestDb
|
||||
|
||||
sbalter.Remove(sbalter.Length - 1, 1);
|
||||
//是否存在分表
|
||||
foreach (var propety in obj.entityType.GetProperties())
|
||||
foreach (var propety in obj.tableSchema.Type.GetProperties())
|
||||
{
|
||||
var timeAttr = propety.GetCustomAttribute<AutoSubtableAttribute>();
|
||||
if (timeAttr != null)
|
||||
|
Reference in New Issue
Block a user