Skip to content
Merged

Clubs #129

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
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ SENTRY_AUTH_TOKEN=changeme

# AIRTABLE_TOKEN=abcxyz # optional

PRINTABLES_ALLOWED_LICENSES_ID=7,1,2,9,12,10,11 # License IDs from printables
PRINTABLES_ALLOWED_LICENSES_ID=7,1,2,9,12,10,11 # License IDs from printables

CLUBS_API_KEY=changeme # API key for clubs.hackclub.com
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;
Loading
Loading