fix #1659 installation issue on PostgreSQL by ntroducing a new RewriteValue method which can be overridden in a database provider to provide custom behavior. Updated PostgreSQL provide to utilize new method. Also added an Oqtane.Server project reference to the module and theme external templates to streamline the development experience (credit @leighpointer).
This commit is contained in:
@ -37,6 +37,10 @@ namespace Oqtane.Migrations.EntityBuilders
|
||||
return ActiveDatabase.RewriteName(name);
|
||||
}
|
||||
|
||||
private string RewriteValue(string value, string type)
|
||||
{
|
||||
return ActiveDatabase.RewriteValue(value, type);
|
||||
}
|
||||
|
||||
// Column Operations
|
||||
|
||||
@ -260,9 +264,19 @@ namespace Oqtane.Migrations.EntityBuilders
|
||||
_migrationBuilder.Sql(deleteSql);
|
||||
}
|
||||
|
||||
public void UpdateColumn(string columnName, string value, string condition = "")
|
||||
public void UpdateColumn(string columnName, string value)
|
||||
{
|
||||
var updateSql = $"UPDATE {RewriteName(EntityTableName)} SET {RewriteName(columnName)} = {value} ";
|
||||
UpdateColumn(columnName, value, "", "");
|
||||
}
|
||||
|
||||
public void UpdateColumn(string columnName, string value, string condition)
|
||||
{
|
||||
UpdateColumn(columnName, value, "", condition);
|
||||
}
|
||||
|
||||
public void UpdateColumn(string columnName, string value, string type, string condition)
|
||||
{
|
||||
var updateSql = $"UPDATE {RewriteName(EntityTableName)} SET {RewriteName(columnName)} = {RewriteValue(value, type)} ";
|
||||
if (!string.IsNullOrEmpty(condition))
|
||||
{
|
||||
updateSql += $"WHERE {condition}";
|
||||
|
Reference in New Issue
Block a user