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:
@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders;
|
||||
using Oqtane.Interfaces;
|
||||
using Oqtane.Migrations.Extensions;
|
||||
|
||||
namespace Oqtane.Migrations.EntityBuilders
|
||||
@ -10,9 +11,10 @@ namespace Oqtane.Migrations.EntityBuilders
|
||||
{
|
||||
private readonly MigrationBuilder _migrationBuilder;
|
||||
|
||||
protected BaseEntityBuilder(MigrationBuilder migrationBuilder)
|
||||
protected BaseEntityBuilder(MigrationBuilder migrationBuilder, IOqtaneDatabase database)
|
||||
{
|
||||
_migrationBuilder = migrationBuilder;
|
||||
ActiveDatabase = database;
|
||||
ForeignKeys = new List<ForeignKey<TEntityBuilder>>();
|
||||
}
|
||||
|
||||
@ -23,9 +25,10 @@ namespace Oqtane.Migrations.EntityBuilders
|
||||
{
|
||||
table.AddForeignKey(foreignKey);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected IOqtaneDatabase ActiveDatabase { get; }
|
||||
|
||||
protected abstract TEntityBuilder BuildTable(ColumnsBuilder table);
|
||||
|
||||
protected string EntityTableName { get; init; }
|
||||
|
Reference in New Issue
Block a user