-- CreateTable
CREATE TABLE `BuildingWalls` (
    `wall_id` VARCHAR(191) NOT NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NULL,
    `building_id` VARCHAR(191) NOT NULL,
    `wall_orientation_id` VARCHAR(191) NOT NULL,

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

-- CreateTable
CREATE TABLE `Wall_Oreintation` (
    `orientation_id` VARCHAR(191) NOT NULL,
    `orientation_name` VARCHAR(191) NOT NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NULL,

    UNIQUE INDEX `Wall_Oreintation_orientation_name_key`(`orientation_name`),
    PRIMARY KEY (`orientation_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `BuildingWalls` ADD CONSTRAINT `BuildingWalls_building_id_fkey` FOREIGN KEY (`building_id`) REFERENCES `User_Building_Details`(`user_building_details_id`) ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `BuildingWalls` ADD CONSTRAINT `BuildingWalls_wall_orientation_id_fkey` FOREIGN KEY (`wall_orientation_id`) REFERENCES `Wall_Oreintation`(`orientation_id`) ON DELETE RESTRICT ON UPDATE CASCADE;
