ubiquitous-invention/packages/database/migrations/0001_parched_red_hulk.sql

16 lines
895 B
MySQL
Raw Permalink Normal View History

CREATE TABLE "object_type_defs" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"workspace_id" uuid NOT NULL,
"name" varchar(255) NOT NULL,
"slug" varchar(100) NOT NULL,
"icon" text,
"color" varchar(50),
"layout" varchar(50) DEFAULT 'task' NOT NULL,
"default_properties" jsonb,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "object_type_defs" ADD CONSTRAINT "object_type_defs_workspace_id_objects_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."objects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "object_type_defs_workspace_id_idx" ON "object_type_defs" USING btree ("workspace_id");--> statement-breakpoint
CREATE INDEX "object_type_defs_slug_idx" ON "object_type_defs" USING btree ("slug","workspace_id");