fix #4733 - remove Name column from Language table and populate value dynamically

This commit is contained in:
sbwalker
2024-10-15 15:58:17 -04:00
parent c31c88ed1f
commit bcf7866fe2
4 changed files with 39 additions and 6 deletions

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Oqtane.Databases.Interfaces;
using Oqtane.Migrations.EntityBuilders;
using Oqtane.Repository;
namespace Oqtane.Migrations.Tenant
{
[DbContext(typeof(TenantDBContext))]
[Migration("Tenant.05.02.04.01")]
public class RemoveLanguageName : MultiDatabaseMigration
{
public RemoveLanguageName(IDatabase database) : base(database)
{
}
protected override void Up(MigrationBuilder migrationBuilder)
{
var languageEntityBuilder = new LanguageEntityBuilder(migrationBuilder, ActiveDatabase);
languageEntityBuilder.DropColumn("Name");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
// not implemented
}
}
}