/*
  Warnings:

  - Added the required column `indoorTemperature` to the `User_Building_Details` table without a default value. This is not possible if the table is not empty.
  - Added the required column `roofLength` to the `User_Building_Details` table without a default value. This is not possible if the table is not empty.
  - Added the required column `roofWidth` to the `User_Building_Details` table without a default value. This is not possible if the table is not empty.
  - Added the required column `roof_type_id` to the `User_Building_Details` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE `User_Building_Details` ADD COLUMN `indoorTemperature` VARCHAR(191) NOT NULL,
    ADD COLUMN `roofLength` VARCHAR(191) NOT NULL,
    ADD COLUMN `roofWidth` VARCHAR(191) NOT NULL,
    ADD COLUMN `roof_type_id` VARCHAR(191) NOT NULL;

-- CreateTable
CREATE TABLE `RoofType` (
    `roof_id` VARCHAR(191) NOT NULL,
    `name` VARCHAR(191) NOT NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NULL,

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

-- AddForeignKey
ALTER TABLE `User_Building_Details` ADD CONSTRAINT `User_Building_Details_roof_type_id_fkey` FOREIGN KEY (`roof_type_id`) REFERENCES `RoofType`(`roof_id`) ON DELETE RESTRICT ON UPDATE CASCADE;
