Add: ConnMoreSettings.OracleCodeFirstNvarchar2

This commit is contained in:
sunkaixuan 2024-05-09 12:15:42 +08:00
parent fdf6b6b6e3
commit f5f6d454e3
3 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,7 @@ namespace SqlSugar
public DateTime? DbMinDate { get; set; } = DateTime.MinValue.Date.AddYears(1900 - 1);
public bool IsNoReadXmlDescription { get; set; }
public bool SqlServerCodeFirstNvarchar { get; set; }
public bool OracleCodeFirstNvarchar2 { get; set; }
public bool SqliteCodeFirstEnableDefaultValue { get; set; }
public bool SqliteCodeFirstEnableDescription { get; set; }
public bool IsAutoUpdateQueryFilter { get; set; }

View File

@ -617,6 +617,13 @@ WHERE table_name = '"+tableName+"'");
{
item.DataType = "NUMBER GENERATED ALWAYS AS IDENTITY";
}
if (item.DataType != null && this.Context.CurrentConnectionConfig?.MoreSettings?.OracleCodeFirstNvarchar2 == true)
{
if (!item.DataType.ToLower().Contains("nvarchar2"))
{
item.DataType = item.DataType.ToLower().Replace("varchar", "nvarchar2");
}
}
}
}
string sql = GetCreateTableSql(tableName, columns);

View File

@ -647,6 +647,7 @@ namespace SqlSugar
DbMinDate=it.MoreSettings.DbMinDate,
IsNoReadXmlDescription=it.MoreSettings.IsNoReadXmlDescription,
SqlServerCodeFirstNvarchar=it.MoreSettings.SqlServerCodeFirstNvarchar,
OracleCodeFirstNvarchar2=it.MoreSettings.OracleCodeFirstNvarchar2,
IsAutoToUpper=it.MoreSettings.IsAutoToUpper,
IsAutoDeleteQueryFilter=it.MoreSettings.IsAutoDeleteQueryFilter,
IsAutoUpdateQueryFilter = it.MoreSettings.IsAutoUpdateQueryFilter,