handle HtmlText module transition from SQL scripts to Migrations in module rather than in core framework
This commit is contained in:
@ -3,8 +3,8 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Oqtane.Enums;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Modules.HtmlText.Repository;
|
||||
using Oqtane.Repository;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Modules
|
||||
{
|
||||
@ -38,5 +38,13 @@ namespace Oqtane.Modules
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public void AddMigrationHistory(ISqlRepository sqlRepository, Tenant tenant, string MigrationId)
|
||||
{
|
||||
var query = "IF NOT EXISTS(SELECT 1 FROM __EFMigrationsHistory WHERE MigrationId = '" + MigrationId + "') ";
|
||||
query += "INSERT INTO __EFMigrationsHistory(MigrationId, ProductVersion, AppliedDate, AppliedVersion) ";
|
||||
query += "VALUES('" + MigrationId + "', '5.0.0', SYSDATETIME(), '" + Constants.Version + "')";
|
||||
sqlRepository.ExecuteNonQuery(tenant, query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user