-- CreateTable
CREATE TABLE `User` (
    `id` VARCHAR(191) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',
    `email` VARCHAR(191) NOT NULL DEFAULT '',
    `password` VARCHAR(191) NOT NULL,
    `createdAt` DATETIME(3) NULL DEFAULT CURRENT_TIMESTAMP(3),

    UNIQUE INDEX `User_email_key`(`email`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Post` (
    `id` VARCHAR(191) NOT NULL,
    `title` VARCHAR(191) NOT NULL DEFAULT '',
    `slug` VARCHAR(191) NOT NULL DEFAULT '',
    `content` JSON NOT NULL,
    `featuredImage` VARCHAR(191) NULL,
    `author` VARCHAR(191) NULL,
    `excerpt` VARCHAR(500) NOT NULL DEFAULT '',
    `type` VARCHAR(191) NOT NULL DEFAULT '',
    `keywords` VARCHAR(191) NOT NULL DEFAULT '',
    `datePublished` DATETIME(3) NULL DEFAULT CURRENT_TIMESTAMP(3),

    UNIQUE INDEX `Post_slug_key`(`slug`),
    INDEX `Post_featuredImage_idx`(`featuredImage`),
    INDEX `Post_author_idx`(`author`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `SiteConfig` (
    `id` INTEGER NOT NULL,
    `telephone` VARCHAR(191) NOT NULL DEFAULT '',
    `emailAddress` VARCHAR(191) NOT NULL DEFAULT '',
    `mainLogo` VARCHAR(191) NULL,
    `darkContrastLogo` VARCHAR(191) NULL,
    `homePage` VARCHAR(191) NULL,
    `defaultPageImage` VARCHAR(191) NULL,
    `streetAddress` VARCHAR(191) NOT NULL DEFAULT '',
    `addressLine1` VARCHAR(191) NOT NULL DEFAULT '',
    `city` VARCHAR(191) NOT NULL DEFAULT '',
    `state` ENUM('AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'MY', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WI', 'WV', 'WY') NULL DEFAULT 'OH',
    `zipCode` VARCHAR(191) NOT NULL DEFAULT '',
    `country` VARCHAR(191) NOT NULL DEFAULT 'USA',
    `mapLink` VARCHAR(191) NOT NULL DEFAULT '',
    `directions` VARCHAR(191) NOT NULL DEFAULT '',
    `GTM` VARCHAR(191) NOT NULL DEFAULT '',
    `Status` BOOLEAN NOT NULL DEFAULT true,
    `cleanTalkApiKey` VARCHAR(191) NOT NULL DEFAULT '',

    UNIQUE INDEX `SiteConfig_telephone_key`(`telephone`),
    UNIQUE INDEX `SiteConfig_emailAddress_key`(`emailAddress`),
    INDEX `SiteConfig_mainLogo_idx`(`mainLogo`),
    INDEX `SiteConfig_darkContrastLogo_idx`(`darkContrastLogo`),
    INDEX `SiteConfig_homePage_idx`(`homePage`),
    INDEX `SiteConfig_defaultPageImage_idx`(`defaultPageImage`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Header` (
    `id` VARCHAR(191) NOT NULL,
    `backgroundImage` VARCHAR(191) NULL,
    `menu` VARCHAR(191) NULL,
    `waiverButton` VARCHAR(191) NOT NULL DEFAULT '',
    `buyNowButton` VARCHAR(191) NOT NULL DEFAULT '',

    INDEX `Header_backgroundImage_idx`(`backgroundImage`),
    INDEX `Header_menu_idx`(`menu`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Menu` (
    `id` VARCHAR(191) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `MenuItem` (
    `id` VARCHAR(191) NOT NULL,
    `title` VARCHAR(191) NOT NULL DEFAULT '',
    `url` VARCHAR(191) NOT NULL DEFAULT '',
    `menuOrder` INTEGER NOT NULL DEFAULT 1,
    `parent` VARCHAR(191) NULL,

    INDEX `MenuItem_parent_idx`(`parent`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Page` (
    `id` VARCHAR(191) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',
    `slug` VARCHAR(191) NOT NULL DEFAULT '',
    `header` VARCHAR(191) NULL,
    `footer` VARCHAR(191) NULL,
    `content` JSON NOT NULL,
    `parent` VARCHAR(191) NULL,

    UNIQUE INDEX `Page_slug_key`(`slug`),
    INDEX `Page_header_idx`(`header`),
    INDEX `Page_footer_idx`(`footer`),
    INDEX `Page_parent_idx`(`parent`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Logo` (
    `id` VARCHAR(191) NOT NULL,
    `headerLogo_filesize` INTEGER NULL,
    `headerLogo_extension` VARCHAR(191) NULL,
    `headerLogo_width` INTEGER NULL,
    `headerLogo_height` INTEGER NULL,
    `headerLogo_id` VARCHAR(191) NULL,
    `footerLogo_filesize` INTEGER NULL,
    `footerLogo_extension` VARCHAR(191) NULL,
    `footerLogo_width` INTEGER NULL,
    `footerLogo_height` INTEGER NULL,
    `footerLogo_id` VARCHAR(191) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Image` (
    `id` VARCHAR(191) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',
    `altText` VARCHAR(191) NOT NULL DEFAULT '',
    `image_filesize` INTEGER NULL,
    `image_extension` VARCHAR(191) NULL,
    `image_width` INTEGER NULL,
    `image_height` INTEGER NULL,
    `image_id` VARCHAR(191) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `SocialMediaIcon` (
    `id` VARCHAR(191) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',
    `url` VARCHAR(191) NOT NULL DEFAULT '',
    `icon` VARCHAR(191) NOT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Review` (
    `id` VARCHAR(191) NOT NULL,
    `Reviewer` VARCHAR(191) NOT NULL DEFAULT '',
    `ReviewSource` VARCHAR(191) NOT NULL DEFAULT '',
    `ReviewContent` VARCHAR(191) NOT NULL DEFAULT '',

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Footer` (
    `id` VARCHAR(191) NOT NULL,
    `footerMenu` VARCHAR(191) NULL,
    `tripAdvisorAward` VARCHAR(191) NULL,
    `friendTitle` VARCHAR(191) NOT NULL DEFAULT '',
    `friendsBackground` VARCHAR(191) NULL,
    `showMap` BOOLEAN NOT NULL DEFAULT false,

    INDEX `Footer_footerMenu_idx`(`footerMenu`),
    INDEX `Footer_tripAdvisorAward_idx`(`tripAdvisorAward`),
    INDEX `Footer_friendsBackground_idx`(`friendsBackground`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Friend` (
    `id` VARCHAR(191) NOT NULL,
    `redirectUrl` VARCHAR(191) NOT NULL DEFAULT '',
    `label` VARCHAR(191) NOT NULL DEFAULT '',
    `logo` VARCHAR(191) NULL,

    INDEX `Friend_logo_idx`(`logo`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Tag` (
    `id` VARCHAR(191) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Activity` (
    `id` VARCHAR(191) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',
    `slug` VARCHAR(191) NOT NULL DEFAULT '',
    `content` JSON NOT NULL,
    `heroImage` VARCHAR(191) NULL,
    `featuredImage` VARCHAR(191) NULL,
    `gradientBackground` BOOLEAN NOT NULL DEFAULT false,
    `excerpt` VARCHAR(500) NOT NULL DEFAULT '',

    UNIQUE INDEX `Activity_slug_key`(`slug`),
    INDEX `Activity_heroImage_idx`(`heroImage`),
    INDEX `Activity_featuredImage_idx`(`featuredImage`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `ContactSubmission` (
    `id` VARCHAR(191) NOT NULL,
    `firstName` VARCHAR(191) NOT NULL DEFAULT '',
    `lastName` VARCHAR(191) NOT NULL DEFAULT '',
    `email` VARCHAR(191) NOT NULL DEFAULT '',
    `phone` VARCHAR(191) NOT NULL DEFAULT '',
    `needs` VARCHAR(191) NOT NULL DEFAULT '',
    `message` VARCHAR(191) NOT NULL DEFAULT '',
    `submissionDate` DATETIME(3) NULL DEFAULT CURRENT_TIMESTAMP(3),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `_Post_tags` (
    `A` VARCHAR(191) NOT NULL,
    `B` VARCHAR(191) NOT NULL,

    UNIQUE INDEX `_Post_tags_AB_unique`(`A`, `B`),
    INDEX `_Post_tags_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `_SiteConfig_socialMedia` (
    `A` INTEGER NOT NULL,
    `B` VARCHAR(191) NOT NULL,

    UNIQUE INDEX `_SiteConfig_socialMedia_AB_unique`(`A`, `B`),
    INDEX `_SiteConfig_socialMedia_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `_Menu_menuItems` (
    `A` VARCHAR(191) NOT NULL,
    `B` VARCHAR(191) NOT NULL,

    UNIQUE INDEX `_Menu_menuItems_AB_unique`(`A`, `B`),
    INDEX `_Menu_menuItems_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `_Footer_friends` (
    `A` VARCHAR(191) NOT NULL,
    `B` VARCHAR(191) NOT NULL,

    UNIQUE INDEX `_Footer_friends_AB_unique`(`A`, `B`),
    INDEX `_Footer_friends_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `_Activity_sliderImages` (
    `A` VARCHAR(191) NOT NULL,
    `B` VARCHAR(191) NOT NULL,

    UNIQUE INDEX `_Activity_sliderImages_AB_unique`(`A`, `B`),
    INDEX `_Activity_sliderImages_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `Post` ADD CONSTRAINT `Post_featuredImage_fkey` FOREIGN KEY (`featuredImage`) REFERENCES `Image`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Post` ADD CONSTRAINT `Post_author_fkey` FOREIGN KEY (`author`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `SiteConfig` ADD CONSTRAINT `SiteConfig_mainLogo_fkey` FOREIGN KEY (`mainLogo`) REFERENCES `Image`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `SiteConfig` ADD CONSTRAINT `SiteConfig_darkContrastLogo_fkey` FOREIGN KEY (`darkContrastLogo`) REFERENCES `Image`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `SiteConfig` ADD CONSTRAINT `SiteConfig_homePage_fkey` FOREIGN KEY (`homePage`) REFERENCES `Page`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `SiteConfig` ADD CONSTRAINT `SiteConfig_defaultPageImage_fkey` FOREIGN KEY (`defaultPageImage`) REFERENCES `Image`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Header` ADD CONSTRAINT `Header_backgroundImage_fkey` FOREIGN KEY (`backgroundImage`) REFERENCES `Image`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Header` ADD CONSTRAINT `Header_menu_fkey` FOREIGN KEY (`menu`) REFERENCES `Menu`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `MenuItem` ADD CONSTRAINT `MenuItem_parent_fkey` FOREIGN KEY (`parent`) REFERENCES `MenuItem`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Page` ADD CONSTRAINT `Page_header_fkey` FOREIGN KEY (`header`) REFERENCES `Header`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Page` ADD CONSTRAINT `Page_footer_fkey` FOREIGN KEY (`footer`) REFERENCES `Footer`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Page` ADD CONSTRAINT `Page_parent_fkey` FOREIGN KEY (`parent`) REFERENCES `Page`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Footer` ADD CONSTRAINT `Footer_footerMenu_fkey` FOREIGN KEY (`footerMenu`) REFERENCES `Menu`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Footer` ADD CONSTRAINT `Footer_tripAdvisorAward_fkey` FOREIGN KEY (`tripAdvisorAward`) REFERENCES `Image`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Footer` ADD CONSTRAINT `Footer_friendsBackground_fkey` FOREIGN KEY (`friendsBackground`) REFERENCES `Image`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Friend` ADD CONSTRAINT `Friend_logo_fkey` FOREIGN KEY (`logo`) REFERENCES `Image`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Activity` ADD CONSTRAINT `Activity_heroImage_fkey` FOREIGN KEY (`heroImage`) REFERENCES `Image`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Activity` ADD CONSTRAINT `Activity_featuredImage_fkey` FOREIGN KEY (`featuredImage`) REFERENCES `Image`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_Post_tags` ADD CONSTRAINT `_Post_tags_A_fkey` FOREIGN KEY (`A`) REFERENCES `Post`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_Post_tags` ADD CONSTRAINT `_Post_tags_B_fkey` FOREIGN KEY (`B`) REFERENCES `Tag`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_SiteConfig_socialMedia` ADD CONSTRAINT `_SiteConfig_socialMedia_A_fkey` FOREIGN KEY (`A`) REFERENCES `SiteConfig`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_SiteConfig_socialMedia` ADD CONSTRAINT `_SiteConfig_socialMedia_B_fkey` FOREIGN KEY (`B`) REFERENCES `SocialMediaIcon`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_Menu_menuItems` ADD CONSTRAINT `_Menu_menuItems_A_fkey` FOREIGN KEY (`A`) REFERENCES `Menu`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_Menu_menuItems` ADD CONSTRAINT `_Menu_menuItems_B_fkey` FOREIGN KEY (`B`) REFERENCES `MenuItem`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_Footer_friends` ADD CONSTRAINT `_Footer_friends_A_fkey` FOREIGN KEY (`A`) REFERENCES `Footer`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_Footer_friends` ADD CONSTRAINT `_Footer_friends_B_fkey` FOREIGN KEY (`B`) REFERENCES `Friend`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_Activity_sliderImages` ADD CONSTRAINT `_Activity_sliderImages_A_fkey` FOREIGN KEY (`A`) REFERENCES `Activity`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_Activity_sliderImages` ADD CONSTRAINT `_Activity_sliderImages_B_fkey` FOREIGN KEY (`B`) REFERENCES `Image`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

