mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-16 13:09:33 +08:00
Synchronization code
This commit is contained in:
parent
0a42de6bd2
commit
20ebda6c09
@ -485,7 +485,10 @@ WHERE tgrelid = '" + tableName + "'::regclass");
|
||||
ConvertCreateColumnInfo(item);
|
||||
if (item.DbColumnName.Equals("GUID", StringComparison.CurrentCultureIgnoreCase) && item.Length == 0)
|
||||
{
|
||||
item.Length = 10;
|
||||
if (item.DataType?.ToLower() != "uuid")
|
||||
{
|
||||
item.Length = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -527,6 +530,14 @@ WHERE tgrelid = '" + tableName + "'::regclass");
|
||||
string addItem = string.Format(this.CreateTableColumn, this.SqlBuilder.GetTranslationColumnName(columnName.ToUpper(IsUpper)), dataType, dataSize, nullType, primaryKey, "");
|
||||
if (item.IsIdentity)
|
||||
{
|
||||
if (dataType?.ToLower() == "int")
|
||||
{
|
||||
dataSize = "int4";
|
||||
}
|
||||
else if (dataType?.ToLower() == "long")
|
||||
{
|
||||
dataSize = "int8";
|
||||
}
|
||||
string length = dataType.Substring(dataType.Length - 1);
|
||||
string identityDataType = "serial" + length;
|
||||
addItem = addItem.Replace(dataType, identityDataType);
|
||||
|
@ -420,7 +420,10 @@ WHERE tgrelid = '"+tableName+"'::regclass");
|
||||
ConvertCreateColumnInfo(item);
|
||||
if (item.DbColumnName.Equals("GUID", StringComparison.CurrentCultureIgnoreCase) && item.Length == 0)
|
||||
{
|
||||
item.Length = 10;
|
||||
if (item.DataType?.ToLower() != "uuid")
|
||||
{
|
||||
item.Length = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -471,6 +474,14 @@ WHERE tgrelid = '"+tableName+"'::regclass");
|
||||
string addItem = string.Format(this.CreateTableColumn, this.SqlBuilder.GetTranslationColumnName(columnName.ToLower(isAutoToLowerCodeFirst)), dataType, dataSize, nullType, primaryKey, "");
|
||||
if (item.IsIdentity)
|
||||
{
|
||||
if (dataType?.ToLower() == "int")
|
||||
{
|
||||
dataSize = "int4";
|
||||
}
|
||||
else if (dataType?.ToLower() == "long")
|
||||
{
|
||||
dataSize = "int8";
|
||||
}
|
||||
string length = dataType.Substring(dataType.Length - 1);
|
||||
string identityDataType = "serial" + length;
|
||||
addItem = addItem.Replace(dataType, identityDataType);
|
||||
|
Loading…
Reference in New Issue
Block a user