Skip to content

Commit 1807ad9

Browse files
committed
reran migrations
1 parent d56ea13 commit 1807ad9

3 files changed

Lines changed: 6890 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CREATE TABLE "workspace_api_key" (
2+
"id" text PRIMARY KEY NOT NULL,
3+
"workspace_id" text NOT NULL,
4+
"created_by" text,
5+
"name" text NOT NULL,
6+
"key" text NOT NULL,
7+
"last_used" timestamp,
8+
"created_at" timestamp DEFAULT now() NOT NULL,
9+
"updated_at" timestamp DEFAULT now() NOT NULL,
10+
"expires_at" timestamp,
11+
CONSTRAINT "workspace_api_key_key_unique" UNIQUE("key")
12+
);
13+
--> statement-breakpoint
14+
ALTER TABLE "workspace_api_key" ADD CONSTRAINT "workspace_api_key_workspace_id_workspace_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspace"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
15+
ALTER TABLE "workspace_api_key" ADD CONSTRAINT "workspace_api_key_created_by_user_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
16+
CREATE INDEX "workspace_api_key_workspace_id_idx" ON "workspace_api_key" USING btree ("workspace_id");--> statement-breakpoint
17+
CREATE UNIQUE INDEX "workspace_api_key_workspace_name_idx" ON "workspace_api_key" USING btree ("workspace_id","name");--> statement-breakpoint
18+
CREATE INDEX "workspace_api_key_key_idx" ON "workspace_api_key" USING btree ("key");--> statement-breakpoint
19+
CREATE INDEX "workspace_api_key_created_by_idx" ON "workspace_api_key" USING btree ("created_by");

0 commit comments

Comments
 (0)