using Backend.Data;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Backend.Migrations;

[DbContext(typeof(AwardsDbContext))]
[Migration("20260629142200_EnsureSiteSettingsSeedColumns")]
public partial class EnsureSiteSettingsSeedColumns : Migration
{
    protected override void Up(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.Sql(
            """
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "HostDisplayName" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "HostTagline" character varying(160) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "NewsletterUrl" character varying(400) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ShareXUrl" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ShareDiscordUrl" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "PrivacyEmail" character varying(160) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "PrivacyPolicyContent" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "PrivacyPolicyUpdatedBy" character varying(120);
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "PrivacyPolicyUpdatedAt" timestamp with time zone;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ImprintUrl" character varying(400) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ImprintContent" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ContactUrl" character varying(400) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ContactContent" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "SponsorsUrl" character varying(400) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "SponsorsContent" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ShowactsUrl" character varying(400) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ShowactsContent" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerEyebrow" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerTitle" character varying(160) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerText" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerLiveButtonLabel" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerLiveButtonUrl" character varying(400) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerLockedButtonLabel" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerUseCompletedContent" boolean NOT NULL DEFAULT FALSE;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerCompletedEyebrow" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerCompletedTitle" character varying(160) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerCompletedText" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerCompletedButtonLabel" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "StreamBannerCompletedButtonUrl" character varying(400) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "AwardsSectionTitle" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "AwardsSectionDescription" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "SubcategoriesSectionTitle" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "SubcategoriesSectionDescription" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "SocialLinksJson" text NOT NULL DEFAULT '[]';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "FaqJson" text NOT NULL DEFAULT '[]';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "RiskRulesJson" text NOT NULL DEFAULT '[]';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "WorkflowRulesJson" text NOT NULL DEFAULT '[]';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "TrackingRulesJson" text NOT NULL DEFAULT '[]';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ViewerStatsProviderBaseUrl" character varying(400) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "TrackingReviewNotes" text NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "NominationLinkBlacklistJson" text NOT NULL DEFAULT '[]';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ClipSubmissionsEnabled" boolean NOT NULL DEFAULT FALSE;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ClipReviewEnabled" boolean NOT NULL DEFAULT TRUE;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ClipAdminMenuVisible" boolean NOT NULL DEFAULT TRUE;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ClipSubmissionDisabledMessage" character varying(240) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ShowactApplicationsEnabled" boolean NOT NULL DEFAULT FALSE;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ShowactApplicationStartsAt" date;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ShowactApplicationEndsAt" date;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ShowactApplicationDisabledMessage" character varying(240) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "ShowactFormSchemaJson" text NOT NULL DEFAULT '[]';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "SponsorsVisible" boolean NOT NULL DEFAULT TRUE;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "DemoLoginManagedByDatabase" boolean NOT NULL DEFAULT FALSE;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "DemoLoginEnabled" boolean NOT NULL DEFAULT FALSE;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "DemoLoginEmail" character varying(180) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "DemoLoginPasswordHash" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "DemoLoginPasswordSalt" character varying(80) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "DemoLoginTwitchUserId" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "DemoLoginDisplayName" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "TwitchAuthManagedByDatabase" boolean NOT NULL DEFAULT FALSE;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "TwitchClientId" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "TwitchClientSecret" character varying(180) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "TwitchRedirectUri" character varying(400) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "TwitchScope" character varying(300) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "SessionIdleTimeoutHours" integer NOT NULL DEFAULT 3;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "MaintenanceModeEnabled" boolean NOT NULL DEFAULT FALSE;
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "MaintenanceTitle" character varying(120) NOT NULL DEFAULT '';
            ALTER TABLE "SiteSettings" ADD COLUMN IF NOT EXISTS "MaintenanceMessage" character varying(600) NOT NULL DEFAULT '';
            """
        );
    }

    protected override void Down(MigrationBuilder migrationBuilder)
    {
    }
}
