Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions drizzle/0028_illegal_robbie_robertson.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREATE TYPE "public"."club_role" AS ENUM('leader', 'member');--> statement-breakpoint
CREATE TABLE "club" (
"id" serial PRIMARY KEY NOT NULL,
"name" text NOT NULL,
"joinCode" text,
"createdAt" timestamp DEFAULT now(),
CONSTRAINT "club_name_unique" UNIQUE("name")
);
--> statement-breakpoint
CREATE TABLE "club_membership" (
"id" serial PRIMARY KEY NOT NULL,
"clubId" integer NOT NULL,
"userId" integer NOT NULL,
"role" "club_role" NOT NULL,
"createdAt" timestamp DEFAULT now(),
CONSTRAINT "club_membership_userId_unique" UNIQUE("userId")
);
--> statement-breakpoint
ALTER TABLE "ship" ADD COLUMN "clubId" integer;--> statement-breakpoint
ALTER TABLE "club_membership" ADD CONSTRAINT "club_membership_clubId_club_id_fk" FOREIGN KEY ("clubId") REFERENCES "public"."club"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "club_membership" ADD CONSTRAINT "club_membership_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "ship" ADD CONSTRAINT "ship_clubId_club_id_fk" FOREIGN KEY ("clubId") REFERENCES "public"."club"("id") ON DELETE no action ON UPDATE no action;
2 changes: 2 additions & 0 deletions drizzle/0029_bouncy_overlord.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TYPE "public"."sticker_fulfilment_status" AS ENUM('not_ordered', 'ordered', 'fulfilled');--> statement-breakpoint
ALTER TABLE "user" ADD COLUMN "stickerFulfilmentStatus" "sticker_fulfilment_status" DEFAULT 'not_ordered' NOT NULL;
Loading