Files
vtuber-awards/Backend/Migrations/20260628205353_AddSeasonWorkflowRulesJson.cs
AzuTear 1a74c03621
CI - Build & Verify / Build, Typecheck & Hygiene (push) Successful in 57s
CI - Build & Verify / Deploy to award.noveria.net (push) Failing after 56s
Restore production migration history
2026-06-29 17:57:47 +02:00

37 lines
1.1 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddSeasonWorkflowRulesJson : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "WorkflowRulesJson",
table: "Seasons",
type: "text",
nullable: false,
defaultValue: "[]");
migrationBuilder.Sql(
"""
UPDATE "Seasons"
SET "WorkflowRulesJson" = COALESCE(NULLIF((SELECT "WorkflowRulesJson" FROM "SiteSettings" WHERE "Id" = 1), ''), '[]')
WHERE COALESCE("WorkflowRulesJson", '') = '';
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "WorkflowRulesJson",
table: "Seasons");
}
}
}