mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
- 增加 ICodeFirst.SyncStructure(TableInfo) 重载方法迁移表结构;
This commit is contained in:
@ -129,7 +129,7 @@ namespace FreeSql.Xugu
|
||||
sqlType += $"({data_length})";
|
||||
return sqlType;
|
||||
}
|
||||
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>>(); //序列
|
||||
@ -137,9 +137,9 @@ namespace FreeSql.Xugu
|
||||
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));
|
||||
if (tb.Columns.Any() == false) throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(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.tableSchema.Type.FullName));
|
||||
var tbname = _commonUtils.SplitTableName(tb.DbName);
|
||||
if (tbname?.Length == 1) tbname = new[] { DefaultSchema, tbname[0] };
|
||||
|
||||
|
@ -384,7 +384,7 @@ where IS_SYS=false and {loc8.ToString().Replace("a.table_name", "ns.SCHEMA_NAME
|
||||
var index_id = string.Concat(row[2]);
|
||||
var is_unique = string.Concat(row[3]) == "1";
|
||||
var is_primary_key = string.Concat(row[4]) == "1";
|
||||
var is_clustered = false;//= string.Concat(row[5]) == "1";
|
||||
//var is_clustered = false;//= string.Concat(row[5]) == "1";
|
||||
var is_desc = false;//string.Concat(row[6]) == "1";
|
||||
//var inkey = string.Concat(row[7]).Split(' ');
|
||||
//var attnum = int.Parse(string.Concat(row[8]));
|
||||
|
Reference in New Issue
Block a user