mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-04 11:45:07 -05:00
* improvement(code-structure): move db into separate package * make db separate package * remake bun lock * update imports to not maintain two separate ones * fix CI for tests by adding dummy url * vercel build fix attempt * update bun lock * regenerate bun lock * fix mocks * remove db commands from apps/sim package json
16 lines
909 B
SQL
16 lines
909 B
SQL
CREATE TABLE "workspace_invitation" (
|
|
"id" text PRIMARY KEY NOT NULL,
|
|
"workspace_id" text NOT NULL,
|
|
"email" text NOT NULL,
|
|
"inviter_id" text NOT NULL,
|
|
"role" text DEFAULT 'member' NOT NULL,
|
|
"status" text DEFAULT 'pending' NOT NULL,
|
|
"token" text NOT NULL,
|
|
"expires_at" timestamp NOT NULL,
|
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
CONSTRAINT "workspace_invitation_token_unique" UNIQUE("token")
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "workspace_invitation" ADD CONSTRAINT "workspace_invitation_workspace_id_workspace_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspace"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
ALTER TABLE "workspace_invitation" ADD CONSTRAINT "workspace_invitation_inviter_id_user_id_fk" FOREIGN KEY ("inviter_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action; |