Update PgSql

This commit is contained in:
sunkaixuan
2018-12-02 23:42:16 +08:00
parent 42f0c45ce0
commit 822641f120
5 changed files with 9 additions and 7 deletions

View File

@@ -8,8 +8,8 @@ namespace OrmTest
{ {
public class Config public class Config
{ {
public static string ConnectionString = "PORT=5432;DATABASE=SqlSugar4XTest;HOST=localhost;PASSWORD=haosql;USER ID=postgres"; public static string ConnectionString = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=jhl52771;USER ID=postgres";
public static string ConnectionString2 = "PORT=5432;DATABASE=SqlSugar4XTest;HOST=localhost;PASSWORD=haosql;USER ID=postgres"; public static string ConnectionString2 = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=jhl52771;USER ID=postgres";
public static string ConnectionString3 = "PORT=5432;DATABASE=SqlSugar4XTest;HOST=localhost;PASSWORD=haosql;USER ID=postgres"; public static string ConnectionString3 = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=jhl52771;USER ID=postgres";
} }
} }

View File

@@ -12,7 +12,7 @@ namespace OrmTest.Models
{ {
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)] [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; } public int Id { get; set; }
[SugarColumn(Length = 50)] [SugarColumn(Length = 50,IsNullable =true)]
public string Name { get; set; } public string Name { get; set; }
} }
} }

View File

@@ -13,9 +13,11 @@ namespace OrmTest.Models
{ {
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "ID")] [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "ID")]
public int Id { get; set; } public int Id { get; set; }
[SugarColumn(IsNullable =true)]
public int? SchoolId { get; set; } public int? SchoolId { get; set; }
[SugarColumn(Length =50)] [SugarColumn(Length =50,IsNullable =true)]
public string Name { get; set; } public string Name { get; set; }
[SugarColumn(IsNullable = true)]
public DateTime? CreateTime { get; set; } public DateTime? CreateTime { get; set; }
[SugarColumn(IsIgnore=true)] [SugarColumn(IsIgnore=true)]
public int TestId { get; set; } public int TestId { get; set; }

View File

@@ -26,7 +26,7 @@ namespace OrmTest
Demo.MasterSlave.Init(); Demo.MasterSlave.Init();
Demo.SharedConnection.Init(); Demo.SharedConnection.Init();
Demo.ExtSqlFun.Init(); Demo.ExtSqlFun.Init();
// Demo.QueryableView.Init(); //Demo.QueryableView.Init();
Demo.AttributeDemo.Init(); Demo.AttributeDemo.Init();
Demo.Mapper.Init(); Demo.Mapper.Init();
Demo.ExtEntity.Init(); Demo.ExtEntity.Init();

View File

@@ -14,7 +14,7 @@ namespace SqlSugar
List<DbColumnInfo> columns = new List<DbColumnInfo>(); List<DbColumnInfo> columns = new List<DbColumnInfo>();
if (entityInfo.Columns.HasValue()) if (entityInfo.Columns.HasValue())
{ {
foreach (var item in entityInfo.Columns) foreach (var item in entityInfo.Columns.Where(it=>it.IsIgnore==false))
{ {
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item); DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo); columns.Add(dbColumnInfo);