-- CreateTable
CREATE TABLE `site_event` (
    `se_id` INTEGER NOT NULL AUTO_INCREMENT,
    `se_sec_id` INTEGER NOT NULL,
    `se_name` VARCHAR(255) NOT NULL,
    `se_details` MEDIUMTEXT NOT NULL,
    `se_status` INTEGER NOT NULL DEFAULT 0,
    `se_date` INTEGER NULL DEFAULT 0,

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

-- CreateTable
CREATE TABLE `site_event_category` (
    `sec_id` INTEGER NOT NULL AUTO_INCREMENT,
    `sec_name` VARCHAR(255) NOT NULL,

    UNIQUE INDEX `site_event_category_sec_name_key`(`sec_name`),
    PRIMARY KEY (`sec_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `site_event` ADD CONSTRAINT `site_event_se_sec_id_fkey` FOREIGN KEY (`se_sec_id`) REFERENCES `site_event_category`(`sec_id`) ON DELETE RESTRICT ON UPDATE CASCADE;
