mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-05 03:17:41 +08:00
Optimized code
This commit is contained in:
@@ -530,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);
|
||||
|
||||
@@ -474,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);
|
||||
|
||||
Reference in New Issue
Block a user