/*
  Warnings:

  - Added the required column `length` to the `BuildingWalls` table without a default value. This is not possible if the table is not empty.
  - Added the required column `wall_type_id` to the `BuildingWalls` table without a default value. This is not possible if the table is not empty.
  - Added the required column `width` to the `BuildingWalls` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE `BuildingWalls` ADD COLUMN `length` VARCHAR(191) NOT NULL,
    ADD COLUMN `wall_type_id` VARCHAR(191) NOT NULL,
    ADD COLUMN `width` VARCHAR(191) NOT NULL;

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

    UNIQUE INDEX `WallTypes_name_key`(`name`),
    PRIMARY KEY (`wall_type_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `BuildingWalls` ADD CONSTRAINT `BuildingWalls_wall_type_id_fkey` FOREIGN KEY (`wall_type_id`) REFERENCES `WallTypes`(`wall_type_id`) ON DELETE RESTRICT ON UPDATE CASCADE;
