Sqlite CodeFirst Enable Drop Column

This commit is contained in:
sunkaixuan
2023-11-20 03:32:26 +08:00
parent 9f366a7e0b
commit 27b5373a47
3 changed files with 9 additions and 3 deletions

View File

@@ -28,6 +28,7 @@ namespace SqlSugar
public bool EnableModelFuncMappingColumn { get; set; } public bool EnableModelFuncMappingColumn { get; set; }
public bool EnableOracleIdentity { get; set; } public bool EnableOracleIdentity { get; set; }
public bool EnableCodeFirstUpdatePrecision { get; set; } public bool EnableCodeFirstUpdatePrecision { get; set; }
public bool SqliteCodeFirstEnableDropColumn { get; set; }
public bool IsCorrectErrorSqlParameterName { get; set; } public bool IsCorrectErrorSqlParameterName { get; set; }
} }
} }

View File

@@ -49,8 +49,12 @@ namespace SqlSugar
} }
foreach (var item in dropColumns) foreach (var item in dropColumns)
{ {
//this.Context.DbMaintenance.DropColumn(tableName, item.DbColumnName); //only support .net core
//isChange = true; if (this.Context.CurrentConnectionConfig?.MoreSettings?.SqliteCodeFirstEnableDropColumn == true)
{
this.Context.DbMaintenance.DropColumn(tableName, item.DbColumnName);
isChange = true;
}
} }
//foreach (var item in alterColumns) //foreach (var item in alterColumns)
//{ //{

View File

@@ -525,7 +525,8 @@ namespace SqlSugar
EnableCodeFirstUpdatePrecision=it.MoreSettings.EnableCodeFirstUpdatePrecision, EnableCodeFirstUpdatePrecision=it.MoreSettings.EnableCodeFirstUpdatePrecision,
SqliteCodeFirstEnableDefaultValue=it.MoreSettings.SqliteCodeFirstEnableDefaultValue, SqliteCodeFirstEnableDefaultValue=it.MoreSettings.SqliteCodeFirstEnableDefaultValue,
SqliteCodeFirstEnableDescription=it.MoreSettings.SqliteCodeFirstEnableDescription, SqliteCodeFirstEnableDescription=it.MoreSettings.SqliteCodeFirstEnableDescription,
IsCorrectErrorSqlParameterName = it.MoreSettings.IsCorrectErrorSqlParameterName IsCorrectErrorSqlParameterName = it.MoreSettings.IsCorrectErrorSqlParameterName,
SqliteCodeFirstEnableDropColumn=it.MoreSettings.SqliteCodeFirstEnableDropColumn
}, },
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle