feat: instance invites

This commit is contained in:
Zoe
2026-10-08 13:50:44 -05:00
parent f6e1bc1f47
commit fae05ebc4c
17 changed files with 3962 additions and 26 deletions
@@ -0,0 +1,11 @@
CREATE TABLE "invites" (
"id" text PRIMARY KEY,
"token" text NOT NULL UNIQUE,
"created_by" text NOT NULL,
"max_uses" integer DEFAULT 1 NOT NULL,
"uses" integer DEFAULT 0 NOT NULL,
"expires_at" timestamp with time zone NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "invites" ADD CONSTRAINT "invites_created_by_users_id_fkey" FOREIGN KEY ("created_by") REFERENCES "users"("id") ON DELETE CASCADE;