Optimize the PGSQL

This commit is contained in:
sunkaixuna 2021-12-18 15:18:23 +08:00
parent a10e28652c
commit 936936154a
2 changed files with 15 additions and 5 deletions

View File

@ -45,8 +45,18 @@ namespace OrmTest
} }
}).ExecuteCommand(); }).ExecuteCommand();
var xxx = Db.Queryable<UnitArray311>().ToList(); var xxx = Db.Queryable<UnitArray311>().ToList();
Db.CodeFirst.InitTables<UnitUUID1XX>();
Db.Insertable(new UnitUUID1XX() { ID = Guid.NewGuid() }).ExecuteCommand();
var x1 = Db.Queryable<UnitUUID1XX>().ToList();
} }
} }
public class UnitUUID1XX
{
[SugarColumn(ColumnDataType ="uuid")]
public Guid ID { get; set; }
}
public class UnitArray311 public class UnitArray311
{ {
[SugarColumn(IsArray =true,ColumnDataType ="text []" )] [SugarColumn(IsArray =true,ColumnDataType ="text []" )]

View File

@ -354,11 +354,11 @@ namespace SqlSugar
{ {
item.Length = 1; item.Length = 1;
} }
if (dataType == "uuid") //if (dataType == "uuid")
{ //{
item.Length = 50; // item.Length = 50;
dataType = "varchar"; // dataType = "varchar";
} //}
string dataSize = item.Length > 0 ? string.Format("({0})", item.Length) : null; string dataSize = item.Length > 0 ? string.Format("({0})", item.Length) : null;
if (item.DecimalDigits > 0&&item.Length>0 && dataType == "numeric") if (item.DecimalDigits > 0&&item.Length>0 && dataType == "numeric")
{ {