Added suuport to inject an IOqtaneDatabase in EntityBuilders to allow each Database to control certain Migration behaviors. Also updated Installer to dynamically build Database Configuration section
This commit is contained in:
@ -1,20 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Oqtane.Interfaces;
|
||||
using Oqtane.Repository;
|
||||
|
||||
namespace Oqtane.Migrations
|
||||
{
|
||||
[DbContext(typeof(TenantDBContext))]
|
||||
[Migration("Tenant.02.00.01.01")]
|
||||
public class UpdateIconColumnInPage : Migration
|
||||
public class UpdateIconColumnInPage : MultiDatabaseMigration
|
||||
{
|
||||
public UpdateIconColumnInPage(IEnumerable<IOqtaneDatabase> databases) : base(databases)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
///Update Icon Field in Page
|
||||
migrationBuilder.Sql(
|
||||
@"
|
||||
UPDATE [Page]
|
||||
SET Icon = IIF(Icon <> '', 'oi oi-' + Icon, '');
|
||||
UPDATE Page
|
||||
SET Icon = 'oi oi-' + Icon
|
||||
WHERE Icon <> ''
|
||||
");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user