mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 修复 1.7.1 IsNullable 遗留问题;
This commit is contained in:
@ -158,20 +158,30 @@ namespace FreeSql.Tests
|
||||
|
||||
class testInsertNullable
|
||||
{
|
||||
[Column(IsIdentity = true)]
|
||||
[Column(IsNullable = false, IsIdentity = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Column(IsNullable = false)]
|
||||
public string str1 { get; set; }
|
||||
[Column(IsNullable = false)]
|
||||
public int? int1 { get; set; }
|
||||
[Column(IsNullable = true)]
|
||||
public int int2 { get; set; }
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Test03()
|
||||
{
|
||||
g.sqlite.Insert(new testInsertNullable()).NoneParameter().ExecuteAffrows();
|
||||
|
||||
var ddlsql = g.sqlite.CodeFirst.GetComparisonDDLStatements(typeof(testInsertNullable), "tb123123");
|
||||
Assert.Equal(@"CREATE TABLE IF NOT EXISTS ""main"".""tb123123"" (
|
||||
""Id"" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
""str1"" NVARCHAR(255) NOT NULL,
|
||||
""int1"" INTEGER NOT NULL,
|
||||
""int2"" INTEGER
|
||||
)
|
||||
;
|
||||
", ddlsql);
|
||||
|
||||
var sqlxx = g.pgsql.InsertOrUpdate<userinfo>().SetSource(new userinfo { userid = 10 }).UpdateColumns(a => new { a.birthday, a.CardNo }).ToSql();
|
||||
|
||||
|
Reference in New Issue
Block a user