Update oracle codefirst

This commit is contained in:
sunkaixuna
2021-11-13 18:37:10 +08:00
parent 32b33e448a
commit 3a3fbdba2f
2 changed files with 36 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
using System;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -14,6 +15,22 @@ namespace OrmTest
Db.DbMaintenance.DropTable("UnitCodeTest1");
Demo2();
Demo3();
Db.CodeFirst.InitTables<TESTA1>();
var xx = Db.DbMaintenance.GetColumnInfosByTableName("TESTA1", false);
Db.DbMaintenance.AddColumn("TESTA1", new DbColumnInfo()
{
DbColumnName = "aaa" + new Random().Next(2, 99999),
PropertyName = "aaa" + new Random().Next(2, 99999),
TableName = "TESTA1",
IsNullable = true,
DataType = "varchar",
Length = 11
});
// db.Utilities.RemoveCacheAll();
var xxxxx = Db.DbMaintenance.GetColumnInfosByTableName("TESTA1", false);
}
public class TESTA1 {
public string X { get; set; }
}
private static void Demo2()