-- CreateTable
CREATE TABLE `site_book_demo` (
    `sd_id` INTEGER NOT NULL AUTO_INCREMENT,
    `sd_fname` VARCHAR(255) NOT NULL,
    `sd_lname` VARCHAR(255) NOT NULL,
    `sd_email` VARCHAR(255) NOT NULL,
    `sd_mobile` VARCHAR(255) NOT NULL,
    `sd_company` VARCHAR(255) NOT NULL,
    `sd_client_type` VARCHAR(255) NOT NULL,
    `sd_subject` VARCHAR(255) NOT NULL,
    `sd_message` VARCHAR(255) NOT NULL,
    `sd_cloud` INTEGER NULL DEFAULT 0,
    `sd_date` INTEGER NULL DEFAULT 0,

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

-- CreateTable
CREATE TABLE `site_book_demo_reply` (
    `sdr_id` INTEGER NOT NULL AUTO_INCREMENT,
    `sdr_sd_id` INTEGER NOT NULL,
    `sdr_subject` VARCHAR(255) NOT NULL,
    `sdr_message` MEDIUMTEXT NOT NULL,
    `sdr_date` INTEGER NULL DEFAULT 0,

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

-- AddForeignKey
ALTER TABLE `site_book_demo_reply` ADD CONSTRAINT `site_book_demo_reply_sdr_sd_id_fkey` FOREIGN KEY (`sdr_sd_id`) REFERENCES `site_book_demo`(`sd_id`) ON DELETE RESTRICT ON UPDATE CASCADE;
