using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Backend.Migrations
{
    /// <inheritdoc />
    public partial class AddLandingContentSections : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.Sql(
                """
                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 '';
                """
            );
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.Sql(
                """
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "SubcategoriesSectionDescription";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "SubcategoriesSectionTitle";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "AwardsSectionDescription";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "AwardsSectionTitle";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerCompletedButtonUrl";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerCompletedButtonLabel";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerCompletedText";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerCompletedTitle";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerCompletedEyebrow";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerUseCompletedContent";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerLockedButtonLabel";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerLiveButtonUrl";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerLiveButtonLabel";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerText";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerTitle";
                ALTER TABLE "SiteSettings" DROP COLUMN IF EXISTS "StreamBannerEyebrow";
                """
            );
        }
    }
}
