mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-17 10:41:56 +08:00
Oracle CodeFirst BUG
This commit is contained in:
parent
62f34cd145
commit
58928e07be
@ -25,12 +25,19 @@ namespace OrmTest.Demo
|
||||
[SugarColumn(Length = 110)]
|
||||
public string A2 { get; set; }
|
||||
}
|
||||
public class CodeTable2 {
|
||||
public class CodeTable2
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string TestId { get; set; }
|
||||
}
|
||||
public class GuidTable
|
||||
{
|
||||
public Guid Name { get; set; }
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
public class CodeFirst : DemoBase
|
||||
{
|
||||
public static void Init()
|
||||
@ -47,7 +54,8 @@ namespace OrmTest.Demo
|
||||
//db.CodeFirst.BackupTable().InitTables(typeof(CodeTable),typeof(CodeTable2));
|
||||
|
||||
//No backup table
|
||||
db.CodeFirst.InitTables(typeof(CodeTable),typeof(CodeTable2));
|
||||
}
|
||||
db.CodeFirst.InitTables(typeof(GuidTable), typeof(CodeTable), typeof(CodeTable2));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -282,7 +282,7 @@ namespace SqlSugar
|
||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||
List<DbColumnInfo> result = new List<DbColumnInfo>();
|
||||
var schemaTable = reader.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
foreach (System.Data.DataRow row in schemaTable.Rows)
|
||||
{
|
||||
DbColumnInfo column = new DbColumnInfo()
|
||||
{
|
||||
@ -364,6 +364,10 @@ namespace SqlSugar
|
||||
{
|
||||
item.Length = 50;
|
||||
}
|
||||
if (item.DataType == "varchar" && item.Length == 0)
|
||||
{
|
||||
item.Length = 50;
|
||||
}
|
||||
}
|
||||
}
|
||||
string sql = GetCreateTableSql(tableName, columns);
|
||||
|
Loading…
Reference in New Issue
Block a user