feat: add workspace invite links schema
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
CREATE TYPE "public"."invite_link_status" AS ENUM('active', 'inactive');--> statement-breakpoint
|
||||
CREATE TABLE IF NOT EXISTS "workspace_invite_links" (
|
||||
"id" bigserial PRIMARY KEY NOT NULL,
|
||||
"workspaceId" bigint NOT NULL,
|
||||
"code" varchar(12) NOT NULL,
|
||||
"status" "invite_link_status" DEFAULT 'active' NOT NULL,
|
||||
"expiresAt" timestamp,
|
||||
"createdAt" timestamp DEFAULT now() NOT NULL,
|
||||
CONSTRAINT "workspace_invite_links_code_unique" UNIQUE("code")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "workspace_invite_links" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "workspace_invite_links" ADD CONSTRAINT "workspace_invite_links_workspaceId_workspace_id_fk" FOREIGN KEY ("workspaceId") REFERENCES "public"."workspace"("id") ON DELETE cascade ON UPDATE no action;
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
2709
packages/db/migrations/meta/20250923143130_snapshot.json
Normal file
2709
packages/db/migrations/meta/20250923143130_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -106,6 +106,13 @@
|
||||
"when": 1758226671081,
|
||||
"tag": "20250918201751_AddPausedMemberStatus",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 15,
|
||||
"version": "7",
|
||||
"when": 1758637890146,
|
||||
"tag": "20250923143130_AddWorkspaceInviteLinks",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user