fix #5414 - add DelimitName database provider method to better support MigrationBuilder.Sql() operations
This commit is contained in:
32
Oqtane.Server/Migrations/Tenant/06010402_ResetTimeZone.cs
Normal file
32
Oqtane.Server/Migrations/Tenant/06010402_ResetTimeZone.cs
Normal file
@ -0,0 +1,32 @@
|
||||
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.06.01.04.02")]
|
||||
public class ResetTimeZone : MultiDatabaseMigration
|
||||
{
|
||||
public ResetTimeZone(IDatabase database) : base(database)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
// resetting value as framework now uses IANA ID consistently for time zones
|
||||
var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||
siteEntityBuilder.UpdateColumn("TimeZoneId", "''");
|
||||
|
||||
var userEntityBuilder = new UserEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||
userEntityBuilder.UpdateColumn("TimeZoneId", "''");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
// not implemented
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user