CREATE TABLE `buildings` ( `id` text PRIMARY KEY NOT NULL, `project_id` text NOT NULL, `name` text NOT NULL, `sort_order` integer DEFAULT 0 NOT NULL, FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade ); --> statement-breakpoint ALTER TABLE `floors` ADD `building_id` text REFERENCES buildings(id) ON DELETE set null;