From eb2691cf505c95e5bc603e973d3b3f97edf0f7bd Mon Sep 17 00:00:00 2001 From: nehalist Date: Tue, 23 Jan 2024 21:11:08 +0100 Subject: [PATCH] feat: simplify --- ....sql => 0000_overrated_fantastic_four.sql} | 85 ++- drizzle/0001_common_roxanne_simpson.sql | 17 - drizzle/0002_same_lily_hollister.sql | 1 - drizzle/0003_public_randall.sql | 1 - drizzle/0004_goofy_junta.sql | 1 - drizzle/0005_steady_boomerang.sql | 5 - drizzle/0006_workable_joshua_kane.sql | 7 - drizzle/0007_brave_invaders.sql | 1 - drizzle/0008_purple_darkstar.sql | 15 - drizzle/0009_far_blob.sql | 1 - drizzle/meta/0000_snapshot.json | 306 ++++++-- drizzle/meta/0001_snapshot.json | 556 --------------- drizzle/meta/0002_snapshot.json | 563 --------------- drizzle/meta/0003_snapshot.json | 570 --------------- drizzle/meta/0004_snapshot.json | 570 --------------- drizzle/meta/0005_snapshot.json | 575 --------------- drizzle/meta/0006_snapshot.json | 589 ---------------- drizzle/meta/0007_snapshot.json | 596 ---------------- drizzle/meta/0008_snapshot.json | 660 ----------------- drizzle/meta/0009_snapshot.json | 667 ------------------ drizzle/meta/_journal.json | 67 +- package-lock.json | 239 +++---- package.json | 2 +- src/app/[locale]/(home)/layout.tsx | 2 +- src/app/[locale]/invite/actions.ts | 18 +- src/app/[locale]/my/leagues/actions.ts | 28 +- src/app/[locale]/my/leagues/league-table.tsx | 4 +- src/app/[locale]/my/leagues/page.tsx | 4 +- src/app/[locale]/my/settings/actions.ts | 37 +- src/app/[locale]/my/settings/avatar.tsx | 100 --- src/app/[locale]/my/settings/form.tsx | 29 - src/app/[locale]/my/settings/page.tsx | 2 - src/app/[locale]/my/settings/validation.ts | 18 - src/db/model/league.ts | 117 +-- src/db/schema.ts | 81 +-- src/lib/auth.tsx | 50 +- src/lib/games.ts | 4 +- src/types/next-auth.d.ts | 4 - 38 files changed, 538 insertions(+), 6054 deletions(-) rename drizzle/{0000_brown_ink.sql => 0000_overrated_fantastic_four.sql} (58%) delete mode 100644 drizzle/0001_common_roxanne_simpson.sql delete mode 100644 drizzle/0002_same_lily_hollister.sql delete mode 100644 drizzle/0003_public_randall.sql delete mode 100644 drizzle/0004_goofy_junta.sql delete mode 100644 drizzle/0005_steady_boomerang.sql delete mode 100644 drizzle/0006_workable_joshua_kane.sql delete mode 100644 drizzle/0007_brave_invaders.sql delete mode 100644 drizzle/0008_purple_darkstar.sql delete mode 100644 drizzle/0009_far_blob.sql delete mode 100644 drizzle/meta/0001_snapshot.json delete mode 100644 drizzle/meta/0002_snapshot.json delete mode 100644 drizzle/meta/0003_snapshot.json delete mode 100644 drizzle/meta/0004_snapshot.json delete mode 100644 drizzle/meta/0005_snapshot.json delete mode 100644 drizzle/meta/0006_snapshot.json delete mode 100644 drizzle/meta/0007_snapshot.json delete mode 100644 drizzle/meta/0008_snapshot.json delete mode 100644 drizzle/meta/0009_snapshot.json delete mode 100644 src/app/[locale]/my/settings/avatar.tsx diff --git a/drizzle/0000_brown_ink.sql b/drizzle/0000_overrated_fantastic_four.sql similarity index 58% rename from drizzle/0000_brown_ink.sql rename to drizzle/0000_overrated_fantastic_four.sql index 6647671..83648f6 100644 --- a/drizzle/0000_brown_ink.sql +++ b/drizzle/0000_overrated_fantastic_four.sql @@ -1,9 +1,33 @@ +DO $$ BEGIN + CREATE TYPE "game" AS ENUM('custom', 'foosball', 'badminton', 'chess', 'pool', 'table-tennis', 'sixty-six'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint DO $$ BEGIN CREATE TYPE "leagueStatus" AS ENUM('active', 'finished'); EXCEPTION WHEN duplicate_object THEN null; END $$; --> statement-breakpoint +DO $$ BEGIN + CREATE TYPE "membershipRole" AS ENUM('member', 'admin'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + CREATE TYPE "ratingSystem" AS ENUM('unknown', 'elo', 'glicko2'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + CREATE TYPE "role" AS ENUM('user', 'admin'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint CREATE TABLE IF NOT EXISTS "account" ( "userId" text, "type" text NOT NULL, @@ -19,14 +43,29 @@ CREATE TABLE IF NOT EXISTS "account" ( CONSTRAINT "account_provider_providerAccountId_pk" PRIMARY KEY("provider","providerAccountId") ); --> statement-breakpoint +CREATE TABLE IF NOT EXISTS "feedback" ( + "id" text PRIMARY KEY NOT NULL, + "userId" text NOT NULL, + "description" text, + "createdAt" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint CREATE TABLE IF NOT EXISTS "league" ( "id" text PRIMARY KEY NOT NULL, "name" text NOT NULL, "image" text, "description" text, + "game" "game" DEFAULT 'custom' NOT NULL, + "maxScorePerMatch" integer DEFAULT 0 NOT NULL, + "allowDraws" boolean DEFAULT true NOT NULL, + "defaultRating" integer DEFAULT 1000 NOT NULL, + "ratingSystem" "ratingSystem" DEFAULT 'unknown' NOT NULL, + "ratingSystemParameters" json DEFAULT '{}'::json NOT NULL, "leagueStatus" "leagueStatus" DEFAULT 'active', + "inviteCode" text DEFAULT substr(md5(random()::text), 0, 25) NOT NULL, "ownerId" text NOT NULL, - "createdAt" timestamp DEFAULT now() NOT NULL + "createdAt" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "league_inviteCode_unique" UNIQUE("inviteCode") ); --> statement-breakpoint CREATE TABLE IF NOT EXISTS "matches" ( @@ -35,27 +74,27 @@ CREATE TABLE IF NOT EXISTS "matches" ( "createdAt" timestamp DEFAULT now() NOT NULL ); --> statement-breakpoint +CREATE TABLE IF NOT EXISTS "memberships" ( + "leagueId" text NOT NULL, + "userId" text NOT NULL, + "role" "membershipRole" DEFAULT 'member' NOT NULL, + "createdAt" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "memberships_userId_leagueId_pk" PRIMARY KEY("userId","leagueId") +); +--> statement-breakpoint CREATE TABLE IF NOT EXISTS "session" ( "sessionToken" text PRIMARY KEY NOT NULL, "userId" text, "expires" timestamp NOT NULL ); --> statement-breakpoint -CREATE TABLE IF NOT EXISTS "team_member" ( - "id" text PRIMARY KEY NOT NULL, - "name" text NOT NULL, - "image" text, - "teamId" text NOT NULL, - "userId" text NOT NULL, - "createdAt" timestamp DEFAULT now() NOT NULL, - CONSTRAINT "team_member_teamId_userId_unique" UNIQUE("teamId","userId") -); ---> statement-breakpoint CREATE TABLE IF NOT EXISTS "team" ( "id" text PRIMARY KEY NOT NULL, "name" text NOT NULL, "image" text, "leagueId" text NOT NULL, + "teamsize" integer DEFAULT 1 NOT NULL, + "userId" text NOT NULL, "createdAt" timestamp DEFAULT now() NOT NULL ); --> statement-breakpoint @@ -65,9 +104,11 @@ CREATE TABLE IF NOT EXISTS "user" ( "firstName" text, "lastName" text, "email" text NOT NULL, + "role" "role" DEFAULT 'user' NOT NULL, "emailVerified" timestamp, "image" text, - "selectedLeagueId" text + "selectedLeagueId" text, + "createdAt" timestamp DEFAULT now() NOT NULL ); --> statement-breakpoint CREATE TABLE IF NOT EXISTS "verificationToken" ( @@ -84,7 +125,13 @@ EXCEPTION END $$; --> statement-breakpoint DO $$ BEGIN - ALTER TABLE "league" ADD CONSTRAINT "league_ownerId_user_id_fk" FOREIGN KEY ("ownerId") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; + ALTER TABLE "feedback" ADD CONSTRAINT "feedback_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "league" ADD CONSTRAINT "league_ownerId_user_id_fk" FOREIGN KEY ("ownerId") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; EXCEPTION WHEN duplicate_object THEN null; END $$; @@ -96,19 +143,19 @@ EXCEPTION END $$; --> statement-breakpoint DO $$ BEGIN - ALTER TABLE "session" ADD CONSTRAINT "session_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; + ALTER TABLE "memberships" ADD CONSTRAINT "memberships_leagueId_league_id_fk" FOREIGN KEY ("leagueId") REFERENCES "league"("id") ON DELETE cascade ON UPDATE no action; EXCEPTION WHEN duplicate_object THEN null; END $$; --> statement-breakpoint DO $$ BEGIN - ALTER TABLE "team_member" ADD CONSTRAINT "team_member_teamId_team_id_fk" FOREIGN KEY ("teamId") REFERENCES "team"("id") ON DELETE cascade ON UPDATE no action; + ALTER TABLE "memberships" ADD CONSTRAINT "memberships_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; EXCEPTION WHEN duplicate_object THEN null; END $$; --> statement-breakpoint DO $$ BEGIN - ALTER TABLE "team_member" ADD CONSTRAINT "team_member_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; + ALTER TABLE "session" ADD CONSTRAINT "session_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; EXCEPTION WHEN duplicate_object THEN null; END $$; @@ -118,3 +165,9 @@ DO $$ BEGIN EXCEPTION WHEN duplicate_object THEN null; END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "team" ADD CONSTRAINT "team_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; diff --git a/drizzle/0001_common_roxanne_simpson.sql b/drizzle/0001_common_roxanne_simpson.sql deleted file mode 100644 index f49a328..0000000 --- a/drizzle/0001_common_roxanne_simpson.sql +++ /dev/null @@ -1,17 +0,0 @@ -DO $$ BEGIN - CREATE TYPE "game" AS ENUM('custom', 'badminton'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - CREATE TYPE "ratingSystem" AS ENUM('unknown', 'elo', 'glicko2'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "league" ADD COLUMN "game" "game" DEFAULT 'custom' NOT NULL;--> statement-breakpoint -ALTER TABLE "league" ADD COLUMN "maxScorePerMatch" integer DEFAULT 0 NOT NULL;--> statement-breakpoint -ALTER TABLE "league" ADD COLUMN "allowDraws" boolean DEFAULT true NOT NULL;--> statement-breakpoint -ALTER TABLE "league" ADD COLUMN "ratingSystem" "ratingSystem" DEFAULT 'unknown' NOT NULL;--> statement-breakpoint -ALTER TABLE "league" ADD COLUMN "ratingSystemParameters" json DEFAULT '{}'::json NOT NULL; \ No newline at end of file diff --git a/drizzle/0002_same_lily_hollister.sql b/drizzle/0002_same_lily_hollister.sql deleted file mode 100644 index d498066..0000000 --- a/drizzle/0002_same_lily_hollister.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "league" ADD COLUMN "defaultRating" integer DEFAULT 1000 NOT NULL; \ No newline at end of file diff --git a/drizzle/0003_public_randall.sql b/drizzle/0003_public_randall.sql deleted file mode 100644 index b22444a..0000000 --- a/drizzle/0003_public_randall.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "user" ADD COLUMN "maxLeagues" integer DEFAULT 1 NOT NULL; \ No newline at end of file diff --git a/drizzle/0004_goofy_junta.sql b/drizzle/0004_goofy_junta.sql deleted file mode 100644 index dd5d3d2..0000000 --- a/drizzle/0004_goofy_junta.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "user" ALTER COLUMN "maxLeagues" SET DEFAULT 10; \ No newline at end of file diff --git a/drizzle/0005_steady_boomerang.sql b/drizzle/0005_steady_boomerang.sql deleted file mode 100644 index 563951d..0000000 --- a/drizzle/0005_steady_boomerang.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TYPE "game" ADD VALUE 'foosball';--> statement-breakpoint -ALTER TYPE "game" ADD VALUE 'chess';--> statement-breakpoint -ALTER TYPE "game" ADD VALUE 'pool';--> statement-breakpoint -ALTER TYPE "game" ADD VALUE 'table-tennis';--> statement-breakpoint -ALTER TYPE "game" ADD VALUE 'sixty-six'; \ No newline at end of file diff --git a/drizzle/0006_workable_joshua_kane.sql b/drizzle/0006_workable_joshua_kane.sql deleted file mode 100644 index f1892c9..0000000 --- a/drizzle/0006_workable_joshua_kane.sql +++ /dev/null @@ -1,7 +0,0 @@ -DO $$ BEGIN - CREATE TYPE "role" AS ENUM('user', 'admin'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "role" "role" DEFAULT 'user' NOT NULL; \ No newline at end of file diff --git a/drizzle/0007_brave_invaders.sql b/drizzle/0007_brave_invaders.sql deleted file mode 100644 index 15a7b24..0000000 --- a/drizzle/0007_brave_invaders.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "user" ADD COLUMN "createdAt" timestamp DEFAULT now() NOT NULL; \ No newline at end of file diff --git a/drizzle/0008_purple_darkstar.sql b/drizzle/0008_purple_darkstar.sql deleted file mode 100644 index 83bd2ac..0000000 --- a/drizzle/0008_purple_darkstar.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE IF NOT EXISTS "feedback" ( - "id" text PRIMARY KEY NOT NULL, - "userId" text NOT NULL, - "description" text, - "createdAt" timestamp DEFAULT now() NOT NULL -); ---> statement-breakpoint -ALTER TABLE "league" ADD COLUMN "inviteCode" text DEFAULT substr(md5(random()::text), 0, 25) NOT NULL;--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "feedback" ADD CONSTRAINT "feedback_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "league" ADD CONSTRAINT "league_inviteCode_unique" UNIQUE("inviteCode"); \ No newline at end of file diff --git a/drizzle/0009_far_blob.sql b/drizzle/0009_far_blob.sql deleted file mode 100644 index 8db43a9..0000000 --- a/drizzle/0009_far_blob.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "team" ADD COLUMN "teamsize" integer DEFAULT 1 NOT NULL; \ No newline at end of file diff --git a/drizzle/meta/0000_snapshot.json b/drizzle/meta/0000_snapshot.json index a1ca9c7..d6f8283 100644 --- a/drizzle/meta/0000_snapshot.json +++ b/drizzle/meta/0000_snapshot.json @@ -1,5 +1,5 @@ { - "id": "deca2b83-966c-4b62-a381-29a35f5b0806", + "id": "350f5e4c-4dcd-4593-b328-bfffc6d75d07", "prevId": "00000000-0000-0000-0000-000000000000", "version": "5", "dialect": "pg", @@ -102,6 +102,55 @@ }, "uniqueConstraints": {} }, + "feedback": { + "name": "feedback", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "userId": { + "name": "userId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "feedback_userId_user_id_fk": { + "name": "feedback_userId_user_id_fk", + "tableFrom": "feedback", + "tableTo": "user", + "columnsFrom": [ + "userId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, "league": { "name": "league", "schema": "", @@ -130,6 +179,48 @@ "primaryKey": false, "notNull": false }, + "game": { + "name": "game", + "type": "game", + "primaryKey": false, + "notNull": true, + "default": "'custom'" + }, + "maxScorePerMatch": { + "name": "maxScorePerMatch", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "allowDraws": { + "name": "allowDraws", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "defaultRating": { + "name": "defaultRating", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1000 + }, + "ratingSystem": { + "name": "ratingSystem", + "type": "ratingSystem", + "primaryKey": false, + "notNull": true, + "default": "'unknown'" + }, + "ratingSystemParameters": { + "name": "ratingSystemParameters", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, "leagueStatus": { "name": "leagueStatus", "type": "leagueStatus", @@ -137,6 +228,13 @@ "notNull": false, "default": "'active'" }, + "inviteCode": { + "name": "inviteCode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "substr(md5(random()::text), 0, 25)" + }, "ownerId": { "name": "ownerId", "type": "text", @@ -163,12 +261,20 @@ "columnsTo": [ "id" ], - "onDelete": "no action", + "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "league_inviteCode_unique": { + "name": "league_inviteCode_unique", + "nullsNotDistinct": false, + "columns": [ + "inviteCode" + ] + } + } }, "matches": { "name": "matches", @@ -213,34 +319,55 @@ "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "session": { - "name": "session", + "memberships": { + "name": "memberships", "schema": "", "columns": { - "sessionToken": { - "name": "sessionToken", + "leagueId": { + "name": "leagueId", "type": "text", - "primaryKey": true, + "primaryKey": false, "notNull": true }, "userId": { "name": "userId", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, - "expires": { - "name": "expires", + "role": { + "name": "role", + "type": "membershipRole", + "primaryKey": false, + "notNull": true, + "default": "'member'" + }, + "createdAt": { + "name": "createdAt", "type": "timestamp", "primaryKey": false, - "notNull": true + "notNull": true, + "default": "now()" } }, "indexes": {}, "foreignKeys": { - "session_userId_user_id_fk": { - "name": "session_userId_user_id_fk", - "tableFrom": "session", + "memberships_leagueId_league_id_fk": { + "name": "memberships_leagueId_league_id_fk", + "tableFrom": "memberships", + "tableTo": "league", + "columnsFrom": [ + "leagueId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "memberships_userId_user_id_fk": { + "name": "memberships_userId_user_id_fk", + "tableFrom": "memberships", "tableTo": "user", "columnsFrom": [ "userId" @@ -252,69 +379,45 @@ "onUpdate": "no action" } }, - "compositePrimaryKeys": {}, + "compositePrimaryKeys": { + "memberships_userId_leagueId_pk": { + "name": "memberships_userId_leagueId_pk", + "columns": [ + "userId", + "leagueId" + ] + } + }, "uniqueConstraints": {} }, - "team_member": { - "name": "team_member", + "session": { + "name": "session", "schema": "", "columns": { - "id": { - "name": "id", + "sessionToken": { + "name": "sessionToken", "type": "text", "primaryKey": true, "notNull": true }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "teamId": { - "name": "teamId", - "type": "text", - "primaryKey": false, - "notNull": true - }, "userId": { "name": "userId", "type": "text", "primaryKey": false, - "notNull": true + "notNull": false }, - "createdAt": { - "name": "createdAt", + "expires": { + "name": "expires", "type": "timestamp", "primaryKey": false, - "notNull": true, - "default": "now()" + "notNull": true } }, "indexes": {}, "foreignKeys": { - "team_member_teamId_team_id_fk": { - "name": "team_member_teamId_team_id_fk", - "tableFrom": "team_member", - "tableTo": "team", - "columnsFrom": [ - "teamId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_member_userId_user_id_fk": { - "name": "team_member_userId_user_id_fk", - "tableFrom": "team_member", + "session_userId_user_id_fk": { + "name": "session_userId_user_id_fk", + "tableFrom": "session", "tableTo": "user", "columnsFrom": [ "userId" @@ -327,16 +430,7 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": { - "team_member_teamId_userId_unique": { - "name": "team_member_teamId_userId_unique", - "nullsNotDistinct": false, - "columns": [ - "teamId", - "userId" - ] - } - } + "uniqueConstraints": {} }, "team": { "name": "team", @@ -366,6 +460,19 @@ "primaryKey": false, "notNull": true }, + "teamsize": { + "name": "teamsize", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "userId": { + "name": "userId", + "type": "text", + "primaryKey": false, + "notNull": true + }, "createdAt": { "name": "createdAt", "type": "timestamp", @@ -388,6 +495,19 @@ ], "onDelete": "cascade", "onUpdate": "no action" + }, + "team_userId_user_id_fk": { + "name": "team_userId_user_id_fk", + "tableFrom": "team", + "tableTo": "user", + "columnsFrom": [ + "userId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -427,6 +547,13 @@ "primaryKey": false, "notNull": true }, + "role": { + "name": "role", + "type": "role", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, "emailVerified": { "name": "emailVerified", "type": "timestamp", @@ -444,6 +571,13 @@ "type": "text", "primaryKey": false, "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -489,12 +623,46 @@ } }, "enums": { + "game": { + "name": "game", + "values": { + "custom": "custom", + "foosball": "foosball", + "badminton": "badminton", + "chess": "chess", + "pool": "pool", + "table-tennis": "table-tennis", + "sixty-six": "sixty-six" + } + }, "leagueStatus": { "name": "leagueStatus", "values": { "active": "active", "finished": "finished" } + }, + "membershipRole": { + "name": "membershipRole", + "values": { + "member": "member", + "admin": "admin" + } + }, + "ratingSystem": { + "name": "ratingSystem", + "values": { + "unknown": "unknown", + "elo": "elo", + "glicko2": "glicko2" + } + }, + "role": { + "name": "role", + "values": { + "user": "user", + "admin": "admin" + } } }, "schemas": {}, diff --git a/drizzle/meta/0001_snapshot.json b/drizzle/meta/0001_snapshot.json deleted file mode 100644 index b1958fd..0000000 --- a/drizzle/meta/0001_snapshot.json +++ /dev/null @@ -1,556 +0,0 @@ -{ - "id": "9746ec7c-7d0f-4e68-b64c-66ff2ff67f18", - "prevId": "deca2b83-966c-4b62-a381-29a35f5b0806", - "version": "5", - "dialect": "pg", - "tables": { - "account": { - "name": "account", - "schema": "", - "columns": { - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "providerAccountId": { - "name": "providerAccountId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_userId_user_id_fk": { - "name": "account_userId_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_providerAccountId_pk": { - "name": "account_provider_providerAccountId_pk", - "columns": [ - "provider", - "providerAccountId" - ] - } - }, - "uniqueConstraints": {} - }, - "league": { - "name": "league", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "game": { - "name": "game", - "type": "game", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - }, - "maxScorePerMatch": { - "name": "maxScorePerMatch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "allowDraws": { - "name": "allowDraws", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "ratingSystem": { - "name": "ratingSystem", - "type": "ratingSystem", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "ratingSystemParameters": { - "name": "ratingSystemParameters", - "type": "json", - "primaryKey": false, - "notNull": true, - "default": "'{}'::json" - }, - "leagueStatus": { - "name": "leagueStatus", - "type": "leagueStatus", - "primaryKey": false, - "notNull": false, - "default": "'active'" - }, - "ownerId": { - "name": "ownerId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "league_ownerId_user_id_fk": { - "name": "league_ownerId_user_id_fk", - "tableFrom": "league", - "tableTo": "user", - "columnsFrom": [ - "ownerId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "matches": { - "name": "matches", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "matches_leagueId_league_id_fk": { - "name": "matches_leagueId_league_id_fk", - "tableFrom": "matches", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "session": { - "name": "session", - "schema": "", - "columns": { - "sessionToken": { - "name": "sessionToken", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_userId_user_id_fk": { - "name": "session_userId_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "team_member": { - "name": "team_member", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "teamId": { - "name": "teamId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_member_teamId_team_id_fk": { - "name": "team_member_teamId_team_id_fk", - "tableFrom": "team_member", - "tableTo": "team", - "columnsFrom": [ - "teamId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_member_userId_user_id_fk": { - "name": "team_member_userId_user_id_fk", - "tableFrom": "team_member", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "team_member_teamId_userId_unique": { - "name": "team_member_teamId_userId_unique", - "nullsNotDistinct": false, - "columns": [ - "teamId", - "userId" - ] - } - } - }, - "team": { - "name": "team", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_leagueId_league_id_fk": { - "name": "team_leagueId_league_id_fk", - "tableFrom": "team", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "firstName": { - "name": "firstName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastName": { - "name": "lastName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "selectedLeagueId": { - "name": "selectedLeagueId", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "verificationToken": { - "name": "verificationToken", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "game": { - "name": "game", - "values": { - "custom": "custom", - "badminton": "badminton" - } - }, - "leagueStatus": { - "name": "leagueStatus", - "values": { - "active": "active", - "finished": "finished" - } - }, - "ratingSystem": { - "name": "ratingSystem", - "values": { - "unknown": "unknown", - "elo": "elo", - "glicko2": "glicko2" - } - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0002_snapshot.json b/drizzle/meta/0002_snapshot.json deleted file mode 100644 index c26dc3d..0000000 --- a/drizzle/meta/0002_snapshot.json +++ /dev/null @@ -1,563 +0,0 @@ -{ - "id": "2b3ba13a-e755-4721-a3a3-0cf1adfb6ded", - "prevId": "9746ec7c-7d0f-4e68-b64c-66ff2ff67f18", - "version": "5", - "dialect": "pg", - "tables": { - "account": { - "name": "account", - "schema": "", - "columns": { - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "providerAccountId": { - "name": "providerAccountId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_userId_user_id_fk": { - "name": "account_userId_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_providerAccountId_pk": { - "name": "account_provider_providerAccountId_pk", - "columns": [ - "provider", - "providerAccountId" - ] - } - }, - "uniqueConstraints": {} - }, - "league": { - "name": "league", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "game": { - "name": "game", - "type": "game", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - }, - "maxScorePerMatch": { - "name": "maxScorePerMatch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "allowDraws": { - "name": "allowDraws", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "defaultRating": { - "name": "defaultRating", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1000 - }, - "ratingSystem": { - "name": "ratingSystem", - "type": "ratingSystem", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "ratingSystemParameters": { - "name": "ratingSystemParameters", - "type": "json", - "primaryKey": false, - "notNull": true, - "default": "'{}'::json" - }, - "leagueStatus": { - "name": "leagueStatus", - "type": "leagueStatus", - "primaryKey": false, - "notNull": false, - "default": "'active'" - }, - "ownerId": { - "name": "ownerId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "league_ownerId_user_id_fk": { - "name": "league_ownerId_user_id_fk", - "tableFrom": "league", - "tableTo": "user", - "columnsFrom": [ - "ownerId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "matches": { - "name": "matches", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "matches_leagueId_league_id_fk": { - "name": "matches_leagueId_league_id_fk", - "tableFrom": "matches", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "session": { - "name": "session", - "schema": "", - "columns": { - "sessionToken": { - "name": "sessionToken", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_userId_user_id_fk": { - "name": "session_userId_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "team_member": { - "name": "team_member", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "teamId": { - "name": "teamId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_member_teamId_team_id_fk": { - "name": "team_member_teamId_team_id_fk", - "tableFrom": "team_member", - "tableTo": "team", - "columnsFrom": [ - "teamId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_member_userId_user_id_fk": { - "name": "team_member_userId_user_id_fk", - "tableFrom": "team_member", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "team_member_teamId_userId_unique": { - "name": "team_member_teamId_userId_unique", - "nullsNotDistinct": false, - "columns": [ - "teamId", - "userId" - ] - } - } - }, - "team": { - "name": "team", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_leagueId_league_id_fk": { - "name": "team_leagueId_league_id_fk", - "tableFrom": "team", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "firstName": { - "name": "firstName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastName": { - "name": "lastName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "selectedLeagueId": { - "name": "selectedLeagueId", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "verificationToken": { - "name": "verificationToken", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "game": { - "name": "game", - "values": { - "custom": "custom", - "badminton": "badminton" - } - }, - "leagueStatus": { - "name": "leagueStatus", - "values": { - "active": "active", - "finished": "finished" - } - }, - "ratingSystem": { - "name": "ratingSystem", - "values": { - "unknown": "unknown", - "elo": "elo", - "glicko2": "glicko2" - } - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0003_snapshot.json b/drizzle/meta/0003_snapshot.json deleted file mode 100644 index bc3357d..0000000 --- a/drizzle/meta/0003_snapshot.json +++ /dev/null @@ -1,570 +0,0 @@ -{ - "id": "b74ad11a-3891-4a5b-a0f1-34945448f561", - "prevId": "2b3ba13a-e755-4721-a3a3-0cf1adfb6ded", - "version": "5", - "dialect": "pg", - "tables": { - "account": { - "name": "account", - "schema": "", - "columns": { - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "providerAccountId": { - "name": "providerAccountId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_userId_user_id_fk": { - "name": "account_userId_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_providerAccountId_pk": { - "name": "account_provider_providerAccountId_pk", - "columns": [ - "provider", - "providerAccountId" - ] - } - }, - "uniqueConstraints": {} - }, - "league": { - "name": "league", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "game": { - "name": "game", - "type": "game", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - }, - "maxScorePerMatch": { - "name": "maxScorePerMatch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "allowDraws": { - "name": "allowDraws", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "defaultRating": { - "name": "defaultRating", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1000 - }, - "ratingSystem": { - "name": "ratingSystem", - "type": "ratingSystem", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "ratingSystemParameters": { - "name": "ratingSystemParameters", - "type": "json", - "primaryKey": false, - "notNull": true, - "default": "'{}'::json" - }, - "leagueStatus": { - "name": "leagueStatus", - "type": "leagueStatus", - "primaryKey": false, - "notNull": false, - "default": "'active'" - }, - "ownerId": { - "name": "ownerId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "league_ownerId_user_id_fk": { - "name": "league_ownerId_user_id_fk", - "tableFrom": "league", - "tableTo": "user", - "columnsFrom": [ - "ownerId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "matches": { - "name": "matches", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "matches_leagueId_league_id_fk": { - "name": "matches_leagueId_league_id_fk", - "tableFrom": "matches", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "session": { - "name": "session", - "schema": "", - "columns": { - "sessionToken": { - "name": "sessionToken", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_userId_user_id_fk": { - "name": "session_userId_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "team_member": { - "name": "team_member", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "teamId": { - "name": "teamId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_member_teamId_team_id_fk": { - "name": "team_member_teamId_team_id_fk", - "tableFrom": "team_member", - "tableTo": "team", - "columnsFrom": [ - "teamId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_member_userId_user_id_fk": { - "name": "team_member_userId_user_id_fk", - "tableFrom": "team_member", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "team_member_teamId_userId_unique": { - "name": "team_member_teamId_userId_unique", - "nullsNotDistinct": false, - "columns": [ - "teamId", - "userId" - ] - } - } - }, - "team": { - "name": "team", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_leagueId_league_id_fk": { - "name": "team_leagueId_league_id_fk", - "tableFrom": "team", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "firstName": { - "name": "firstName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastName": { - "name": "lastName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "selectedLeagueId": { - "name": "selectedLeagueId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxLeagues": { - "name": "maxLeagues", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "verificationToken": { - "name": "verificationToken", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "game": { - "name": "game", - "values": { - "custom": "custom", - "badminton": "badminton" - } - }, - "leagueStatus": { - "name": "leagueStatus", - "values": { - "active": "active", - "finished": "finished" - } - }, - "ratingSystem": { - "name": "ratingSystem", - "values": { - "unknown": "unknown", - "elo": "elo", - "glicko2": "glicko2" - } - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0004_snapshot.json b/drizzle/meta/0004_snapshot.json deleted file mode 100644 index 2f5fe83..0000000 --- a/drizzle/meta/0004_snapshot.json +++ /dev/null @@ -1,570 +0,0 @@ -{ - "id": "3138741e-cd63-429e-9036-ddf722a0c5f3", - "prevId": "b74ad11a-3891-4a5b-a0f1-34945448f561", - "version": "5", - "dialect": "pg", - "tables": { - "account": { - "name": "account", - "schema": "", - "columns": { - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "providerAccountId": { - "name": "providerAccountId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_userId_user_id_fk": { - "name": "account_userId_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_providerAccountId_pk": { - "name": "account_provider_providerAccountId_pk", - "columns": [ - "provider", - "providerAccountId" - ] - } - }, - "uniqueConstraints": {} - }, - "league": { - "name": "league", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "game": { - "name": "game", - "type": "game", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - }, - "maxScorePerMatch": { - "name": "maxScorePerMatch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "allowDraws": { - "name": "allowDraws", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "defaultRating": { - "name": "defaultRating", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1000 - }, - "ratingSystem": { - "name": "ratingSystem", - "type": "ratingSystem", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "ratingSystemParameters": { - "name": "ratingSystemParameters", - "type": "json", - "primaryKey": false, - "notNull": true, - "default": "'{}'::json" - }, - "leagueStatus": { - "name": "leagueStatus", - "type": "leagueStatus", - "primaryKey": false, - "notNull": false, - "default": "'active'" - }, - "ownerId": { - "name": "ownerId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "league_ownerId_user_id_fk": { - "name": "league_ownerId_user_id_fk", - "tableFrom": "league", - "tableTo": "user", - "columnsFrom": [ - "ownerId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "matches": { - "name": "matches", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "matches_leagueId_league_id_fk": { - "name": "matches_leagueId_league_id_fk", - "tableFrom": "matches", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "session": { - "name": "session", - "schema": "", - "columns": { - "sessionToken": { - "name": "sessionToken", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_userId_user_id_fk": { - "name": "session_userId_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "team_member": { - "name": "team_member", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "teamId": { - "name": "teamId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_member_teamId_team_id_fk": { - "name": "team_member_teamId_team_id_fk", - "tableFrom": "team_member", - "tableTo": "team", - "columnsFrom": [ - "teamId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_member_userId_user_id_fk": { - "name": "team_member_userId_user_id_fk", - "tableFrom": "team_member", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "team_member_teamId_userId_unique": { - "name": "team_member_teamId_userId_unique", - "nullsNotDistinct": false, - "columns": [ - "teamId", - "userId" - ] - } - } - }, - "team": { - "name": "team", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_leagueId_league_id_fk": { - "name": "team_leagueId_league_id_fk", - "tableFrom": "team", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "firstName": { - "name": "firstName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastName": { - "name": "lastName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "selectedLeagueId": { - "name": "selectedLeagueId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxLeagues": { - "name": "maxLeagues", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 10 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "verificationToken": { - "name": "verificationToken", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "game": { - "name": "game", - "values": { - "custom": "custom", - "badminton": "badminton" - } - }, - "leagueStatus": { - "name": "leagueStatus", - "values": { - "active": "active", - "finished": "finished" - } - }, - "ratingSystem": { - "name": "ratingSystem", - "values": { - "unknown": "unknown", - "elo": "elo", - "glicko2": "glicko2" - } - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0005_snapshot.json b/drizzle/meta/0005_snapshot.json deleted file mode 100644 index 996bfcd..0000000 --- a/drizzle/meta/0005_snapshot.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "id": "8ea1dc4f-a727-4d33-ac9c-e2ba5b20774f", - "prevId": "3138741e-cd63-429e-9036-ddf722a0c5f3", - "version": "5", - "dialect": "pg", - "tables": { - "account": { - "name": "account", - "schema": "", - "columns": { - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "providerAccountId": { - "name": "providerAccountId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_userId_user_id_fk": { - "name": "account_userId_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_providerAccountId_pk": { - "name": "account_provider_providerAccountId_pk", - "columns": [ - "provider", - "providerAccountId" - ] - } - }, - "uniqueConstraints": {} - }, - "league": { - "name": "league", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "game": { - "name": "game", - "type": "game", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - }, - "maxScorePerMatch": { - "name": "maxScorePerMatch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "allowDraws": { - "name": "allowDraws", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "defaultRating": { - "name": "defaultRating", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1000 - }, - "ratingSystem": { - "name": "ratingSystem", - "type": "ratingSystem", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "ratingSystemParameters": { - "name": "ratingSystemParameters", - "type": "json", - "primaryKey": false, - "notNull": true, - "default": "'{}'::json" - }, - "leagueStatus": { - "name": "leagueStatus", - "type": "leagueStatus", - "primaryKey": false, - "notNull": false, - "default": "'active'" - }, - "ownerId": { - "name": "ownerId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "league_ownerId_user_id_fk": { - "name": "league_ownerId_user_id_fk", - "tableFrom": "league", - "tableTo": "user", - "columnsFrom": [ - "ownerId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "matches": { - "name": "matches", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "matches_leagueId_league_id_fk": { - "name": "matches_leagueId_league_id_fk", - "tableFrom": "matches", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "session": { - "name": "session", - "schema": "", - "columns": { - "sessionToken": { - "name": "sessionToken", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_userId_user_id_fk": { - "name": "session_userId_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "team_member": { - "name": "team_member", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "teamId": { - "name": "teamId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_member_teamId_team_id_fk": { - "name": "team_member_teamId_team_id_fk", - "tableFrom": "team_member", - "tableTo": "team", - "columnsFrom": [ - "teamId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_member_userId_user_id_fk": { - "name": "team_member_userId_user_id_fk", - "tableFrom": "team_member", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "team_member_teamId_userId_unique": { - "name": "team_member_teamId_userId_unique", - "nullsNotDistinct": false, - "columns": [ - "teamId", - "userId" - ] - } - } - }, - "team": { - "name": "team", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_leagueId_league_id_fk": { - "name": "team_leagueId_league_id_fk", - "tableFrom": "team", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "firstName": { - "name": "firstName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastName": { - "name": "lastName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "selectedLeagueId": { - "name": "selectedLeagueId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxLeagues": { - "name": "maxLeagues", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 10 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "verificationToken": { - "name": "verificationToken", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "game": { - "name": "game", - "values": { - "custom": "custom", - "foosball": "foosball", - "badminton": "badminton", - "chess": "chess", - "pool": "pool", - "table-tennis": "table-tennis", - "sixty-six": "sixty-six" - } - }, - "leagueStatus": { - "name": "leagueStatus", - "values": { - "active": "active", - "finished": "finished" - } - }, - "ratingSystem": { - "name": "ratingSystem", - "values": { - "unknown": "unknown", - "elo": "elo", - "glicko2": "glicko2" - } - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0006_snapshot.json b/drizzle/meta/0006_snapshot.json deleted file mode 100644 index 6c7871c..0000000 --- a/drizzle/meta/0006_snapshot.json +++ /dev/null @@ -1,589 +0,0 @@ -{ - "id": "4d90c66b-5f68-4648-b59f-01dc1f2fc78f", - "prevId": "8ea1dc4f-a727-4d33-ac9c-e2ba5b20774f", - "version": "5", - "dialect": "pg", - "tables": { - "account": { - "name": "account", - "schema": "", - "columns": { - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "providerAccountId": { - "name": "providerAccountId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_userId_user_id_fk": { - "name": "account_userId_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_providerAccountId_pk": { - "name": "account_provider_providerAccountId_pk", - "columns": [ - "provider", - "providerAccountId" - ] - } - }, - "uniqueConstraints": {} - }, - "league": { - "name": "league", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "game": { - "name": "game", - "type": "game", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - }, - "maxScorePerMatch": { - "name": "maxScorePerMatch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "allowDraws": { - "name": "allowDraws", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "defaultRating": { - "name": "defaultRating", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1000 - }, - "ratingSystem": { - "name": "ratingSystem", - "type": "ratingSystem", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "ratingSystemParameters": { - "name": "ratingSystemParameters", - "type": "json", - "primaryKey": false, - "notNull": true, - "default": "'{}'::json" - }, - "leagueStatus": { - "name": "leagueStatus", - "type": "leagueStatus", - "primaryKey": false, - "notNull": false, - "default": "'active'" - }, - "ownerId": { - "name": "ownerId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "league_ownerId_user_id_fk": { - "name": "league_ownerId_user_id_fk", - "tableFrom": "league", - "tableTo": "user", - "columnsFrom": [ - "ownerId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "matches": { - "name": "matches", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "matches_leagueId_league_id_fk": { - "name": "matches_leagueId_league_id_fk", - "tableFrom": "matches", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "session": { - "name": "session", - "schema": "", - "columns": { - "sessionToken": { - "name": "sessionToken", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_userId_user_id_fk": { - "name": "session_userId_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "team_member": { - "name": "team_member", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "teamId": { - "name": "teamId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_member_teamId_team_id_fk": { - "name": "team_member_teamId_team_id_fk", - "tableFrom": "team_member", - "tableTo": "team", - "columnsFrom": [ - "teamId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_member_userId_user_id_fk": { - "name": "team_member_userId_user_id_fk", - "tableFrom": "team_member", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "team_member_teamId_userId_unique": { - "name": "team_member_teamId_userId_unique", - "nullsNotDistinct": false, - "columns": [ - "teamId", - "userId" - ] - } - } - }, - "team": { - "name": "team", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_leagueId_league_id_fk": { - "name": "team_leagueId_league_id_fk", - "tableFrom": "team", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "firstName": { - "name": "firstName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastName": { - "name": "lastName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "role", - "primaryKey": false, - "notNull": true, - "default": "'user'" - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "selectedLeagueId": { - "name": "selectedLeagueId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxLeagues": { - "name": "maxLeagues", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 10 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "verificationToken": { - "name": "verificationToken", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "game": { - "name": "game", - "values": { - "custom": "custom", - "foosball": "foosball", - "badminton": "badminton", - "chess": "chess", - "pool": "pool", - "table-tennis": "table-tennis", - "sixty-six": "sixty-six" - } - }, - "leagueStatus": { - "name": "leagueStatus", - "values": { - "active": "active", - "finished": "finished" - } - }, - "ratingSystem": { - "name": "ratingSystem", - "values": { - "unknown": "unknown", - "elo": "elo", - "glicko2": "glicko2" - } - }, - "role": { - "name": "role", - "values": { - "user": "user", - "admin": "admin" - } - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0007_snapshot.json b/drizzle/meta/0007_snapshot.json deleted file mode 100644 index a0e25f6..0000000 --- a/drizzle/meta/0007_snapshot.json +++ /dev/null @@ -1,596 +0,0 @@ -{ - "id": "d9957bef-4e3f-4a04-ba7e-df578fe05ce2", - "prevId": "4d90c66b-5f68-4648-b59f-01dc1f2fc78f", - "version": "5", - "dialect": "pg", - "tables": { - "account": { - "name": "account", - "schema": "", - "columns": { - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "providerAccountId": { - "name": "providerAccountId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_userId_user_id_fk": { - "name": "account_userId_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_providerAccountId_pk": { - "name": "account_provider_providerAccountId_pk", - "columns": [ - "provider", - "providerAccountId" - ] - } - }, - "uniqueConstraints": {} - }, - "league": { - "name": "league", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "game": { - "name": "game", - "type": "game", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - }, - "maxScorePerMatch": { - "name": "maxScorePerMatch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "allowDraws": { - "name": "allowDraws", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "defaultRating": { - "name": "defaultRating", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1000 - }, - "ratingSystem": { - "name": "ratingSystem", - "type": "ratingSystem", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "ratingSystemParameters": { - "name": "ratingSystemParameters", - "type": "json", - "primaryKey": false, - "notNull": true, - "default": "'{}'::json" - }, - "leagueStatus": { - "name": "leagueStatus", - "type": "leagueStatus", - "primaryKey": false, - "notNull": false, - "default": "'active'" - }, - "ownerId": { - "name": "ownerId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "league_ownerId_user_id_fk": { - "name": "league_ownerId_user_id_fk", - "tableFrom": "league", - "tableTo": "user", - "columnsFrom": [ - "ownerId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "matches": { - "name": "matches", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "matches_leagueId_league_id_fk": { - "name": "matches_leagueId_league_id_fk", - "tableFrom": "matches", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "session": { - "name": "session", - "schema": "", - "columns": { - "sessionToken": { - "name": "sessionToken", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_userId_user_id_fk": { - "name": "session_userId_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "team_member": { - "name": "team_member", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "teamId": { - "name": "teamId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_member_teamId_team_id_fk": { - "name": "team_member_teamId_team_id_fk", - "tableFrom": "team_member", - "tableTo": "team", - "columnsFrom": [ - "teamId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_member_userId_user_id_fk": { - "name": "team_member_userId_user_id_fk", - "tableFrom": "team_member", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "team_member_teamId_userId_unique": { - "name": "team_member_teamId_userId_unique", - "nullsNotDistinct": false, - "columns": [ - "teamId", - "userId" - ] - } - } - }, - "team": { - "name": "team", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_leagueId_league_id_fk": { - "name": "team_leagueId_league_id_fk", - "tableFrom": "team", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "firstName": { - "name": "firstName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastName": { - "name": "lastName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "role", - "primaryKey": false, - "notNull": true, - "default": "'user'" - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "selectedLeagueId": { - "name": "selectedLeagueId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxLeagues": { - "name": "maxLeagues", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 10 - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "verificationToken": { - "name": "verificationToken", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "game": { - "name": "game", - "values": { - "custom": "custom", - "foosball": "foosball", - "badminton": "badminton", - "chess": "chess", - "pool": "pool", - "table-tennis": "table-tennis", - "sixty-six": "sixty-six" - } - }, - "leagueStatus": { - "name": "leagueStatus", - "values": { - "active": "active", - "finished": "finished" - } - }, - "ratingSystem": { - "name": "ratingSystem", - "values": { - "unknown": "unknown", - "elo": "elo", - "glicko2": "glicko2" - } - }, - "role": { - "name": "role", - "values": { - "user": "user", - "admin": "admin" - } - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0008_snapshot.json b/drizzle/meta/0008_snapshot.json deleted file mode 100644 index fbd8245..0000000 --- a/drizzle/meta/0008_snapshot.json +++ /dev/null @@ -1,660 +0,0 @@ -{ - "id": "6131aaa8-6484-475b-ac43-e95b051646d3", - "prevId": "d9957bef-4e3f-4a04-ba7e-df578fe05ce2", - "version": "5", - "dialect": "pg", - "tables": { - "account": { - "name": "account", - "schema": "", - "columns": { - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "providerAccountId": { - "name": "providerAccountId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_userId_user_id_fk": { - "name": "account_userId_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_providerAccountId_pk": { - "name": "account_provider_providerAccountId_pk", - "columns": [ - "provider", - "providerAccountId" - ] - } - }, - "uniqueConstraints": {} - }, - "feedback": { - "name": "feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "feedback_userId_user_id_fk": { - "name": "feedback_userId_user_id_fk", - "tableFrom": "feedback", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "league": { - "name": "league", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "game": { - "name": "game", - "type": "game", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - }, - "maxScorePerMatch": { - "name": "maxScorePerMatch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "allowDraws": { - "name": "allowDraws", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "defaultRating": { - "name": "defaultRating", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1000 - }, - "ratingSystem": { - "name": "ratingSystem", - "type": "ratingSystem", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "ratingSystemParameters": { - "name": "ratingSystemParameters", - "type": "json", - "primaryKey": false, - "notNull": true, - "default": "'{}'::json" - }, - "leagueStatus": { - "name": "leagueStatus", - "type": "leagueStatus", - "primaryKey": false, - "notNull": false, - "default": "'active'" - }, - "inviteCode": { - "name": "inviteCode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "substr(md5(random()::text), 0, 25)" - }, - "ownerId": { - "name": "ownerId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "league_ownerId_user_id_fk": { - "name": "league_ownerId_user_id_fk", - "tableFrom": "league", - "tableTo": "user", - "columnsFrom": [ - "ownerId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "league_inviteCode_unique": { - "name": "league_inviteCode_unique", - "nullsNotDistinct": false, - "columns": [ - "inviteCode" - ] - } - } - }, - "matches": { - "name": "matches", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "matches_leagueId_league_id_fk": { - "name": "matches_leagueId_league_id_fk", - "tableFrom": "matches", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "session": { - "name": "session", - "schema": "", - "columns": { - "sessionToken": { - "name": "sessionToken", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_userId_user_id_fk": { - "name": "session_userId_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "team_member": { - "name": "team_member", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "teamId": { - "name": "teamId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_member_teamId_team_id_fk": { - "name": "team_member_teamId_team_id_fk", - "tableFrom": "team_member", - "tableTo": "team", - "columnsFrom": [ - "teamId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_member_userId_user_id_fk": { - "name": "team_member_userId_user_id_fk", - "tableFrom": "team_member", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "team_member_teamId_userId_unique": { - "name": "team_member_teamId_userId_unique", - "nullsNotDistinct": false, - "columns": [ - "teamId", - "userId" - ] - } - } - }, - "team": { - "name": "team", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_leagueId_league_id_fk": { - "name": "team_leagueId_league_id_fk", - "tableFrom": "team", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "firstName": { - "name": "firstName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastName": { - "name": "lastName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "role", - "primaryKey": false, - "notNull": true, - "default": "'user'" - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "selectedLeagueId": { - "name": "selectedLeagueId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxLeagues": { - "name": "maxLeagues", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 10 - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "verificationToken": { - "name": "verificationToken", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "game": { - "name": "game", - "values": { - "custom": "custom", - "foosball": "foosball", - "badminton": "badminton", - "chess": "chess", - "pool": "pool", - "table-tennis": "table-tennis", - "sixty-six": "sixty-six" - } - }, - "leagueStatus": { - "name": "leagueStatus", - "values": { - "active": "active", - "finished": "finished" - } - }, - "ratingSystem": { - "name": "ratingSystem", - "values": { - "unknown": "unknown", - "elo": "elo", - "glicko2": "glicko2" - } - }, - "role": { - "name": "role", - "values": { - "user": "user", - "admin": "admin" - } - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0009_snapshot.json b/drizzle/meta/0009_snapshot.json deleted file mode 100644 index 8027d55..0000000 --- a/drizzle/meta/0009_snapshot.json +++ /dev/null @@ -1,667 +0,0 @@ -{ - "id": "604fced3-0dbd-4351-a126-db61e9c439c6", - "prevId": "6131aaa8-6484-475b-ac43-e95b051646d3", - "version": "5", - "dialect": "pg", - "tables": { - "account": { - "name": "account", - "schema": "", - "columns": { - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "providerAccountId": { - "name": "providerAccountId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_userId_user_id_fk": { - "name": "account_userId_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_providerAccountId_pk": { - "name": "account_provider_providerAccountId_pk", - "columns": [ - "provider", - "providerAccountId" - ] - } - }, - "uniqueConstraints": {} - }, - "feedback": { - "name": "feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "feedback_userId_user_id_fk": { - "name": "feedback_userId_user_id_fk", - "tableFrom": "feedback", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "league": { - "name": "league", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "game": { - "name": "game", - "type": "game", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - }, - "maxScorePerMatch": { - "name": "maxScorePerMatch", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "allowDraws": { - "name": "allowDraws", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "defaultRating": { - "name": "defaultRating", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1000 - }, - "ratingSystem": { - "name": "ratingSystem", - "type": "ratingSystem", - "primaryKey": false, - "notNull": true, - "default": "'unknown'" - }, - "ratingSystemParameters": { - "name": "ratingSystemParameters", - "type": "json", - "primaryKey": false, - "notNull": true, - "default": "'{}'::json" - }, - "leagueStatus": { - "name": "leagueStatus", - "type": "leagueStatus", - "primaryKey": false, - "notNull": false, - "default": "'active'" - }, - "inviteCode": { - "name": "inviteCode", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "substr(md5(random()::text), 0, 25)" - }, - "ownerId": { - "name": "ownerId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "league_ownerId_user_id_fk": { - "name": "league_ownerId_user_id_fk", - "tableFrom": "league", - "tableTo": "user", - "columnsFrom": [ - "ownerId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "league_inviteCode_unique": { - "name": "league_inviteCode_unique", - "nullsNotDistinct": false, - "columns": [ - "inviteCode" - ] - } - } - }, - "matches": { - "name": "matches", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "matches_leagueId_league_id_fk": { - "name": "matches_leagueId_league_id_fk", - "tableFrom": "matches", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "session": { - "name": "session", - "schema": "", - "columns": { - "sessionToken": { - "name": "sessionToken", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_userId_user_id_fk": { - "name": "session_userId_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "team_member": { - "name": "team_member", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "teamId": { - "name": "teamId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_member_teamId_team_id_fk": { - "name": "team_member_teamId_team_id_fk", - "tableFrom": "team_member", - "tableTo": "team", - "columnsFrom": [ - "teamId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_member_userId_user_id_fk": { - "name": "team_member_userId_user_id_fk", - "tableFrom": "team_member", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "team_member_teamId_userId_unique": { - "name": "team_member_teamId_userId_unique", - "nullsNotDistinct": false, - "columns": [ - "teamId", - "userId" - ] - } - } - }, - "team": { - "name": "team", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "leagueId": { - "name": "leagueId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "teamsize": { - "name": "teamsize", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_leagueId_league_id_fk": { - "name": "team_leagueId_league_id_fk", - "tableFrom": "team", - "tableTo": "league", - "columnsFrom": [ - "leagueId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "firstName": { - "name": "firstName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastName": { - "name": "lastName", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "role", - "primaryKey": false, - "notNull": true, - "default": "'user'" - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "selectedLeagueId": { - "name": "selectedLeagueId", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "maxLeagues": { - "name": "maxLeagues", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 10 - }, - "createdAt": { - "name": "createdAt", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "verificationToken": { - "name": "verificationToken", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "game": { - "name": "game", - "values": { - "custom": "custom", - "foosball": "foosball", - "badminton": "badminton", - "chess": "chess", - "pool": "pool", - "table-tennis": "table-tennis", - "sixty-six": "sixty-six" - } - }, - "leagueStatus": { - "name": "leagueStatus", - "values": { - "active": "active", - "finished": "finished" - } - }, - "ratingSystem": { - "name": "ratingSystem", - "values": { - "unknown": "unknown", - "elo": "elo", - "glicko2": "glicko2" - } - }, - "role": { - "name": "role", - "values": { - "user": "user", - "admin": "admin" - } - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index bc6682a..e07520e 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -5,71 +5,8 @@ { "idx": 0, "version": "5", - "when": 1703374465200, - "tag": "0000_brown_ink", - "breakpoints": true - }, - { - "idx": 1, - "version": "5", - "when": 1703676851013, - "tag": "0001_common_roxanne_simpson", - "breakpoints": true - }, - { - "idx": 2, - "version": "5", - "when": 1703676936478, - "tag": "0002_same_lily_hollister", - "breakpoints": true - }, - { - "idx": 3, - "version": "5", - "when": 1703709807305, - "tag": "0003_public_randall", - "breakpoints": true - }, - { - "idx": 4, - "version": "5", - "when": 1703710486089, - "tag": "0004_goofy_junta", - "breakpoints": true - }, - { - "idx": 5, - "version": "5", - "when": 1703845653384, - "tag": "0005_steady_boomerang", - "breakpoints": true - }, - { - "idx": 6, - "version": "5", - "when": 1703954428039, - "tag": "0006_workable_joshua_kane", - "breakpoints": true - }, - { - "idx": 7, - "version": "5", - "when": 1703974520656, - "tag": "0007_brave_invaders", - "breakpoints": true - }, - { - "idx": 8, - "version": "5", - "when": 1704567971636, - "tag": "0008_purple_darkstar", - "breakpoints": true - }, - { - "idx": 9, - "version": "5", - "when": 1705864512208, - "tag": "0009_far_blob", + "when": 1706031688362, + "tag": "0000_overrated_fantastic_four", "breakpoints": true } ] diff --git a/package-lock.json b/package-lock.json index cdae0e2..765fd59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "fast-glob": "^3.3.2", "framer-motion": "^10.16.4", "lucide-react": "^0.292.0", - "next": "^14.0.2", + "next": "^14.1.0", "next-auth": "^4.24.5", "next-intl": "^3.3.1", "next-mdx-remote": "^4.4.1", @@ -2690,9 +2690,9 @@ } }, "node_modules/@next/env": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.2.tgz", - "integrity": "sha512-HAW1sljizEaduEOes/m84oUqeIDAUYBR1CDwu2tobNlNDFP3cSm9d6QsOsGeNlIppU1p/p1+bWbYCbvwjFiceA==" + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.1.0.tgz", + "integrity": "sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==" }, "node_modules/@next/eslint-plugin-next": { "version": "14.0.1", @@ -2704,9 +2704,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.2.tgz", - "integrity": "sha512-i+jQY0fOb8L5gvGvojWyZMfQoQtDVB2kYe7fufOEiST6sicvzI2W5/EXo4lX5bLUjapHKe+nFxuVv7BA+Pd7LQ==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.0.tgz", + "integrity": "sha512-nUDn7TOGcIeyQni6lZHfzNoo9S0euXnu0jhsbMOmMJUBfgsnESdjN97kM7cBqQxZa8L/bM9om/S5/1dzCrW6wQ==", "cpu": [ "arm64" ], @@ -2719,9 +2719,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.2.tgz", - "integrity": "sha512-zRCAO0d2hW6gBEa4wJaLn+gY8qtIqD3gYd9NjruuN98OCI6YyelmhWVVLlREjS7RYrm9OUQIp/iVJFeB6kP1hg==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.0.tgz", + "integrity": "sha512-1jgudN5haWxiAl3O1ljUS2GfupPmcftu2RYJqZiMJmmbBT5M1XDffjUtRUzP4W3cBHsrvkfOFdQ71hAreNQP6g==", "cpu": [ "x64" ], @@ -2734,9 +2734,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.2.tgz", - "integrity": "sha512-tSJmiaon8YaKsVhi7GgRizZoV0N1Sx5+i+hFTrCKKQN7s3tuqW0Rov+RYdPhAv/pJl4qiG+XfSX4eJXqpNg3dA==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.0.tgz", + "integrity": "sha512-RHo7Tcj+jllXUbK7xk2NyIDod3YcCPDZxj1WLIYxd709BQ7WuRYl3OWUNG+WUfqeQBds6kvZYlc42NJJTNi4tQ==", "cpu": [ "arm64" ], @@ -2749,9 +2749,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.2.tgz", - "integrity": "sha512-dXJLMSEOwqJKcag1BeX1C+ekdPPJ9yXbWIt3nAadhbLx5CjACoB2NQj9Xcqu2tmdr5L6m34fR+fjGPs+ZVPLzA==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.0.tgz", + "integrity": "sha512-v6kP8sHYxjO8RwHmWMJSq7VZP2nYCkRVQ0qolh2l6xroe9QjbgV8siTbduED4u0hlk0+tjS6/Tuy4n5XCp+l6g==", "cpu": [ "arm64" ], @@ -2764,9 +2764,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.2.tgz", - "integrity": "sha512-WC9KAPSowj6as76P3vf1J3mf2QTm3Wv3FBzQi7UJ+dxWjK3MhHVWsWUo24AnmHx9qDcEtHM58okgZkXVqeLB+Q==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.0.tgz", + "integrity": "sha512-zJ2pnoFYB1F4vmEVlb/eSe+VH679zT1VdXlZKX+pE66grOgjmKJHKacf82g/sWE4MQ4Rk2FMBCRnX+l6/TVYzQ==", "cpu": [ "x64" ], @@ -2779,9 +2779,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.2.tgz", - "integrity": "sha512-KSSAwvUcjtdZY4zJFa2f5VNJIwuEVnOSlqYqbQIawREJA+gUI6egeiRu290pXioQXnQHYYdXmnVNZ4M+VMB7KQ==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.0.tgz", + "integrity": "sha512-rbaIYFt2X9YZBSbH/CwGAjbBG2/MrACCVu2X0+kSykHzHnYH5FjHxwXLkcoJ10cX0aWCEynpu+rP76x0914atg==", "cpu": [ "x64" ], @@ -2794,9 +2794,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.2.tgz", - "integrity": "sha512-2/O0F1SqJ0bD3zqNuYge0ok7OEWCQwk55RPheDYD0va5ij7kYwrFkq5ycCRN0TLjLfxSF6xI5NM6nC5ux7svEQ==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.0.tgz", + "integrity": "sha512-o1N5TsYc8f/HpGt39OUQpQ9AKIGApd3QLueu7hXk//2xq5Z9OxmV6sQfNp8C7qYmiOlHYODOGqNNa0e9jvchGQ==", "cpu": [ "arm64" ], @@ -2809,9 +2809,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.2.tgz", - "integrity": "sha512-vJI/x70Id0oN4Bq/R6byBqV1/NS5Dl31zC+lowO8SDu1fHmUxoAdILZR5X/sKbiJpuvKcCrwbYgJU8FF/Gh50Q==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.0.tgz", + "integrity": "sha512-XXIuB1DBRCFwNO6EEzCTMHT5pauwaSj4SWs7CYnME57eaReAKBXCnkUE80p/pAZcewm7hs+vGvNqDPacEXHVkw==", "cpu": [ "ia32" ], @@ -2824,9 +2824,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.2.tgz", - "integrity": "sha512-Ut4LXIUvC5m8pHTe2j0vq/YDnTEyq6RSR9vHYPqnELrDapPhLNz9Od/L5Ow3J8RNDWpEnfCiQXuVdfjlNEJ7ug==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.0.tgz", + "integrity": "sha512-9WEbVRRAqJ3YFVqEZIxUqkiO8l1nool1LmNxygr5HWF8AcSYsEpneUDhmjUVJEzO2A04+oPtZdombzzPPkTtgg==", "cpu": [ "x64" ], @@ -7094,9 +7094,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001561", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001561.tgz", - "integrity": "sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==", + "version": "1.0.30001579", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001579.tgz", + "integrity": "sha512-u5AUVkixruKHJjw/pj9wISlcMpgFWzSrczLZbrqBSxukQixmg0SJ5sZTpvaFvxU0HoQKd4yoyAogyrAz9pzJnA==", "funding": [ { "type": "opencollective", @@ -9581,7 +9581,8 @@ "node_modules/glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true }, "node_modules/globals": { "version": "13.23.0", @@ -9645,9 +9646,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/graphemer": { "version": "1.4.0", @@ -11972,17 +11973,17 @@ } }, "node_modules/next": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/next/-/next-14.0.2.tgz", - "integrity": "sha512-jsAU2CkYS40GaQYOiLl9m93RTv2DA/tTJ0NRlmZIBIL87YwQ/xR8k796z7IqgM3jydI8G25dXvyYMC9VDIevIg==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/next/-/next-14.1.0.tgz", + "integrity": "sha512-wlzrsbfeSU48YQBjZhDzOwhWhGsy+uQycR8bHAOt1LY1bn3zZEcDyHQOEoN3aWzQ8LHCAJ1nqrWCc9XF2+O45Q==", "dependencies": { - "@next/env": "14.0.2", + "@next/env": "14.1.0", "@swc/helpers": "0.5.2", "busboy": "1.6.0", - "caniuse-lite": "^1.0.30001406", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", "postcss": "8.4.31", - "styled-jsx": "5.1.1", - "watchpack": "2.4.0" + "styled-jsx": "5.1.1" }, "bin": { "next": "dist/bin/next" @@ -11991,15 +11992,15 @@ "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "14.0.2", - "@next/swc-darwin-x64": "14.0.2", - "@next/swc-linux-arm64-gnu": "14.0.2", - "@next/swc-linux-arm64-musl": "14.0.2", - "@next/swc-linux-x64-gnu": "14.0.2", - "@next/swc-linux-x64-musl": "14.0.2", - "@next/swc-win32-arm64-msvc": "14.0.2", - "@next/swc-win32-ia32-msvc": "14.0.2", - "@next/swc-win32-x64-msvc": "14.0.2" + "@next/swc-darwin-arm64": "14.1.0", + "@next/swc-darwin-x64": "14.1.0", + "@next/swc-linux-arm64-gnu": "14.1.0", + "@next/swc-linux-arm64-musl": "14.1.0", + "@next/swc-linux-x64-gnu": "14.1.0", + "@next/swc-linux-x64-musl": "14.1.0", + "@next/swc-win32-arm64-msvc": "14.1.0", + "@next/swc-win32-ia32-msvc": "14.1.0", + "@next/swc-win32-x64-msvc": "14.1.0" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -16776,18 +16777,6 @@ "makeerror": "1.0.12" } }, - "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", - "dependencies": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -19336,9 +19325,9 @@ } }, "@next/env": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.2.tgz", - "integrity": "sha512-HAW1sljizEaduEOes/m84oUqeIDAUYBR1CDwu2tobNlNDFP3cSm9d6QsOsGeNlIppU1p/p1+bWbYCbvwjFiceA==" + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.1.0.tgz", + "integrity": "sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==" }, "@next/eslint-plugin-next": { "version": "14.0.1", @@ -19350,57 +19339,57 @@ } }, "@next/swc-darwin-arm64": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.2.tgz", - "integrity": "sha512-i+jQY0fOb8L5gvGvojWyZMfQoQtDVB2kYe7fufOEiST6sicvzI2W5/EXo4lX5bLUjapHKe+nFxuVv7BA+Pd7LQ==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.0.tgz", + "integrity": "sha512-nUDn7TOGcIeyQni6lZHfzNoo9S0euXnu0jhsbMOmMJUBfgsnESdjN97kM7cBqQxZa8L/bM9om/S5/1dzCrW6wQ==", "optional": true }, "@next/swc-darwin-x64": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.2.tgz", - "integrity": "sha512-zRCAO0d2hW6gBEa4wJaLn+gY8qtIqD3gYd9NjruuN98OCI6YyelmhWVVLlREjS7RYrm9OUQIp/iVJFeB6kP1hg==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.0.tgz", + "integrity": "sha512-1jgudN5haWxiAl3O1ljUS2GfupPmcftu2RYJqZiMJmmbBT5M1XDffjUtRUzP4W3cBHsrvkfOFdQ71hAreNQP6g==", "optional": true }, "@next/swc-linux-arm64-gnu": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.2.tgz", - "integrity": "sha512-tSJmiaon8YaKsVhi7GgRizZoV0N1Sx5+i+hFTrCKKQN7s3tuqW0Rov+RYdPhAv/pJl4qiG+XfSX4eJXqpNg3dA==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.0.tgz", + "integrity": "sha512-RHo7Tcj+jllXUbK7xk2NyIDod3YcCPDZxj1WLIYxd709BQ7WuRYl3OWUNG+WUfqeQBds6kvZYlc42NJJTNi4tQ==", "optional": true }, "@next/swc-linux-arm64-musl": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.2.tgz", - "integrity": "sha512-dXJLMSEOwqJKcag1BeX1C+ekdPPJ9yXbWIt3nAadhbLx5CjACoB2NQj9Xcqu2tmdr5L6m34fR+fjGPs+ZVPLzA==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.0.tgz", + "integrity": "sha512-v6kP8sHYxjO8RwHmWMJSq7VZP2nYCkRVQ0qolh2l6xroe9QjbgV8siTbduED4u0hlk0+tjS6/Tuy4n5XCp+l6g==", "optional": true }, "@next/swc-linux-x64-gnu": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.2.tgz", - "integrity": "sha512-WC9KAPSowj6as76P3vf1J3mf2QTm3Wv3FBzQi7UJ+dxWjK3MhHVWsWUo24AnmHx9qDcEtHM58okgZkXVqeLB+Q==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.0.tgz", + "integrity": "sha512-zJ2pnoFYB1F4vmEVlb/eSe+VH679zT1VdXlZKX+pE66grOgjmKJHKacf82g/sWE4MQ4Rk2FMBCRnX+l6/TVYzQ==", "optional": true }, "@next/swc-linux-x64-musl": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.2.tgz", - "integrity": "sha512-KSSAwvUcjtdZY4zJFa2f5VNJIwuEVnOSlqYqbQIawREJA+gUI6egeiRu290pXioQXnQHYYdXmnVNZ4M+VMB7KQ==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.0.tgz", + "integrity": "sha512-rbaIYFt2X9YZBSbH/CwGAjbBG2/MrACCVu2X0+kSykHzHnYH5FjHxwXLkcoJ10cX0aWCEynpu+rP76x0914atg==", "optional": true }, "@next/swc-win32-arm64-msvc": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.2.tgz", - "integrity": "sha512-2/O0F1SqJ0bD3zqNuYge0ok7OEWCQwk55RPheDYD0va5ij7kYwrFkq5ycCRN0TLjLfxSF6xI5NM6nC5ux7svEQ==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.0.tgz", + "integrity": "sha512-o1N5TsYc8f/HpGt39OUQpQ9AKIGApd3QLueu7hXk//2xq5Z9OxmV6sQfNp8C7qYmiOlHYODOGqNNa0e9jvchGQ==", "optional": true }, "@next/swc-win32-ia32-msvc": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.2.tgz", - "integrity": "sha512-vJI/x70Id0oN4Bq/R6byBqV1/NS5Dl31zC+lowO8SDu1fHmUxoAdILZR5X/sKbiJpuvKcCrwbYgJU8FF/Gh50Q==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.0.tgz", + "integrity": "sha512-XXIuB1DBRCFwNO6EEzCTMHT5pauwaSj4SWs7CYnME57eaReAKBXCnkUE80p/pAZcewm7hs+vGvNqDPacEXHVkw==", "optional": true }, "@next/swc-win32-x64-msvc": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.2.tgz", - "integrity": "sha512-Ut4LXIUvC5m8pHTe2j0vq/YDnTEyq6RSR9vHYPqnELrDapPhLNz9Od/L5Ow3J8RNDWpEnfCiQXuVdfjlNEJ7ug==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.0.tgz", + "integrity": "sha512-9WEbVRRAqJ3YFVqEZIxUqkiO8l1nool1LmNxygr5HWF8AcSYsEpneUDhmjUVJEzO2A04+oPtZdombzzPPkTtgg==", "optional": true }, "@nextui-org/accordion": { @@ -22656,9 +22645,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001561", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001561.tgz", - "integrity": "sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==" + "version": "1.0.30001579", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001579.tgz", + "integrity": "sha512-u5AUVkixruKHJjw/pj9wISlcMpgFWzSrczLZbrqBSxukQixmg0SJ5sZTpvaFvxU0HoQKd4yoyAogyrAz9pzJnA==" }, "capnp-ts": { "version": "0.7.0", @@ -24461,7 +24450,8 @@ "glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true }, "globals": { "version": "13.23.0", @@ -24504,9 +24494,9 @@ } }, "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "graphemer": { "version": "1.4.0", @@ -26207,26 +26197,26 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "next": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/next/-/next-14.0.2.tgz", - "integrity": "sha512-jsAU2CkYS40GaQYOiLl9m93RTv2DA/tTJ0NRlmZIBIL87YwQ/xR8k796z7IqgM3jydI8G25dXvyYMC9VDIevIg==", - "requires": { - "@next/env": "14.0.2", - "@next/swc-darwin-arm64": "14.0.2", - "@next/swc-darwin-x64": "14.0.2", - "@next/swc-linux-arm64-gnu": "14.0.2", - "@next/swc-linux-arm64-musl": "14.0.2", - "@next/swc-linux-x64-gnu": "14.0.2", - "@next/swc-linux-x64-musl": "14.0.2", - "@next/swc-win32-arm64-msvc": "14.0.2", - "@next/swc-win32-ia32-msvc": "14.0.2", - "@next/swc-win32-x64-msvc": "14.0.2", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/next/-/next-14.1.0.tgz", + "integrity": "sha512-wlzrsbfeSU48YQBjZhDzOwhWhGsy+uQycR8bHAOt1LY1bn3zZEcDyHQOEoN3aWzQ8LHCAJ1nqrWCc9XF2+O45Q==", + "requires": { + "@next/env": "14.1.0", + "@next/swc-darwin-arm64": "14.1.0", + "@next/swc-darwin-x64": "14.1.0", + "@next/swc-linux-arm64-gnu": "14.1.0", + "@next/swc-linux-arm64-musl": "14.1.0", + "@next/swc-linux-x64-gnu": "14.1.0", + "@next/swc-linux-x64-musl": "14.1.0", + "@next/swc-win32-arm64-msvc": "14.1.0", + "@next/swc-win32-ia32-msvc": "14.1.0", + "@next/swc-win32-x64-msvc": "14.1.0", "@swc/helpers": "0.5.2", "busboy": "1.6.0", - "caniuse-lite": "^1.0.30001406", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", "postcss": "8.4.31", - "styled-jsx": "5.1.1", - "watchpack": "2.4.0" + "styled-jsx": "5.1.1" } }, "next-auth": { @@ -29449,15 +29439,6 @@ "makeerror": "1.0.12" } }, - "watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", - "requires": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - } - }, "wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", diff --git a/package.json b/package.json index 5012b33..f411d65 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "fast-glob": "^3.3.2", "framer-motion": "^10.16.4", "lucide-react": "^0.292.0", - "next": "^14.0.2", + "next": "^14.1.0", "next-auth": "^4.24.5", "next-intl": "^3.3.1", "next-mdx-remote": "^4.4.1", diff --git a/src/app/[locale]/(home)/layout.tsx b/src/app/[locale]/(home)/layout.tsx index 46ba78b..d5d3dd5 100644 --- a/src/app/[locale]/(home)/layout.tsx +++ b/src/app/[locale]/(home)/layout.tsx @@ -12,7 +12,7 @@ export const metadata = { export default async function HomeLayout({ children, - params: { locale, ...params }, + params: { locale }, }: { children: ReactNode; params: { locale: string }; diff --git a/src/app/[locale]/invite/actions.ts b/src/app/[locale]/invite/actions.ts index 77d0d88..423df49 100644 --- a/src/app/[locale]/invite/actions.ts +++ b/src/app/[locale]/invite/actions.ts @@ -2,7 +2,11 @@ import { createAuthenticatedServerAction } from "@/utils/server-action-helper"; import { zfd } from "zod-form-data"; -import { addUserToLeague, getLeagueByInviteCode, userIsInLeague } from "@/db/model/league"; +import { + createMembership, + getLeagueByInviteCode, + userIsInLeague, +} from "@/db/model/league"; export const joinLeagueAction = createAuthenticatedServerAction( zfd.formData({ @@ -11,29 +15,29 @@ export const joinLeagueAction = createAuthenticatedServerAction( }), async ({ leagueId, code }, { user }) => { const [league] = await getLeagueByInviteCode(code); - if (! league) { + if (!league) { return { status: "error", message: "League not found", - } + }; } if (league.inviteCode !== code) { return { status: "error", message: "Invalid invite code", - } + }; } if (await userIsInLeague(leagueId, user)) { return { status: "error", message: "You are already in this league", - } + }; } - await addUserToLeague(league, user); + await createMembership(league, user); return { status: "success", - } + }; }, ); diff --git a/src/app/[locale]/my/leagues/actions.ts b/src/app/[locale]/my/leagues/actions.ts index ad94d8d..424ea63 100644 --- a/src/app/[locale]/my/leagues/actions.ts +++ b/src/app/[locale]/my/leagues/actions.ts @@ -4,7 +4,7 @@ import { createAuthenticatedServerAction } from "@/utils/server-action-helper"; import { zfd } from "zod-form-data"; import { z } from "zod"; import { db } from "@/db"; -import { teamMembers, teams } from "@/db/schema"; +import { teams } from "@/db/schema"; import { and, eq } from "drizzle-orm"; export const leaveLeagueAction = createAuthenticatedServerAction( @@ -12,19 +12,19 @@ export const leaveLeagueAction = createAuthenticatedServerAction( leagueId: zfd.text(z.string()), }), async (data, { user }) => { - const memberships = await db - .select() - .from(teamMembers) - .leftJoin(teams, eq(teamMembers.teamId, teams.id)) - .where( - and(eq(teams.leagueId, data.leagueId), eq(teamMembers.userId, user.id)), - ); - - for await (const membership of memberships) { - if (membership.team && membership.team.id) { - await db.delete(teams).where(eq(teams.id, membership.team.id)); - } - } + // const memberships = await db + // .select() + // .from(teamMembers) + // .leftJoin(teams, eq(teamMembers.teamId, teams.id)) + // .where( + // and(eq(teams.leagueId, data.leagueId), eq(teamMembers.userId, user.id)), + // ); + // + // for await (const membership of memberships) { + // if (membership.team && membership.team.id) { + // await db.delete(teams).where(eq(teams.id, membership.team.id)); + // } + // } return { status: "success", diff --git a/src/app/[locale]/my/leagues/league-table.tsx b/src/app/[locale]/my/leagues/league-table.tsx index 7d48a16..2108852 100644 --- a/src/app/[locale]/my/leagues/league-table.tsx +++ b/src/app/[locale]/my/leagues/league-table.tsx @@ -13,7 +13,7 @@ import { } from "@nextui-org/react"; import { EditIcon } from "@nextui-org/shared-icons"; import { Link } from "@/lib/navigation"; -import { getLeaguesForUser } from "@/db/model/league"; +import { getUserLeagues } from "@/db/model/league"; import { FaCrown } from "react-icons/fa6"; import { leaveLeagueAction } from "@/app/[locale]/my/leagues/actions"; import { useFormState } from "react-dom"; @@ -42,7 +42,7 @@ const columns = [ export function LeagueTable({ leagues, }: { - leagues: Awaited>; + leagues: Awaited>; }) { const [state, leaveFormAction] = useFormState(leaveLeagueAction, null); diff --git a/src/app/[locale]/my/leagues/page.tsx b/src/app/[locale]/my/leagues/page.tsx index 0728df9..d8b2829 100644 --- a/src/app/[locale]/my/leagues/page.tsx +++ b/src/app/[locale]/my/leagues/page.tsx @@ -1,6 +1,6 @@ import { getCurrentUser } from "@/lib/session"; import { redirect } from "next/navigation"; -import { getLeaguesForUser } from "@/db/model/league"; +import { getUserLeagues } from "@/db/model/league"; import { LeagueTable } from "@/app/[locale]/my/leagues/league-table"; import { getTranslations } from "next-intl/server"; import { RefreshOnFocus } from "@/components/refresh-on-focus"; @@ -12,7 +12,7 @@ async function getLeagues() { if (!user) { return redirect("/"); } - return getLeaguesForUser(user); + return getUserLeagues(user); } export default async function Leagues() { diff --git a/src/app/[locale]/my/settings/actions.ts b/src/app/[locale]/my/settings/actions.ts index a93444a..5038291 100644 --- a/src/app/[locale]/my/settings/actions.ts +++ b/src/app/[locale]/my/settings/actions.ts @@ -10,44 +10,11 @@ import { updateUser } from "@/db/model/user"; export const updateUserProfileAction = createAuthenticatedServerAction( settingsFormSchema, - async ({ name, firstName, lastName }, { user }) => { - await updateUser(user.id, { name, firstName, lastName }); + async ({ name }, { user }) => { + await updateUser(user.id, { name }); return { status: "success", }; }, ); - -export const updateUserImageAction = createAuthenticatedServerAction( - imageFormSchema, - async ({ image }, { user }) => { - if (!image) { - await removeUploadedFiles(`avatars/${user.id}-*`); - await updateUser(user.id, { image: null }); - - return { - status: "success", - }; - } - try { - await removeUploadedFiles(`avatars/${user.id}-*`); - const { fileName } = await uploadFile( - image, - `avatars/${user.id}-${+new Date()}`, - ); - - await updateUser(user.id, { image: fileName }); - - return { - status: "success", - }; - } catch (e) { - console.error(e); - return { - status: "error", - message: "Failed to upload avatar", - }; - } - }, -); diff --git a/src/app/[locale]/my/settings/avatar.tsx b/src/app/[locale]/my/settings/avatar.tsx deleted file mode 100644 index df67a44..0000000 --- a/src/app/[locale]/my/settings/avatar.tsx +++ /dev/null @@ -1,100 +0,0 @@ -"use client"; - -import { updateUserImageAction } from "@/app/[locale]/my/settings/actions"; -import { useEffect, useRef, useTransition } from "react"; -import { useSession } from "next-auth/react"; -import { - Button, - Dropdown, - DropdownItem, - DropdownMenu, - DropdownTrigger, -} from "@nextui-org/react"; -import { useFormState } from "react-dom"; -import { toast } from "react-toastify"; - -export function Avatar() { - const { data, update } = useSession(); - const uploadButtonRef = useRef(null); - const formRef = useRef(null); - const [state, formAction] = useFormState(updateUserImageAction, null); - - useEffect(() => { - if (!state) { - return; - } - switch (state.status) { - case "success": - update(); - toast("Profile updated.", { - type: "success", - }); - break; - case "error": - toast(state.message, { - type: "error", - }); - } - }, [state]); - - if (!data?.user) { - return null; - } - - return ( -
-

- Picture -

- {data?.user && ( - <> - {data.user.image ? ( - - ) : ( -
- No image... yet. -
- )} - - )} -
- formRef.current?.requestSubmit()} - hidden={true} - ref={uploadButtonRef} - /> - - - - - - uploadButtonRef.current?.click()} - > - Upload new file - - { - formRef.current?.reset(); - formRef.current?.requestSubmit(); - }} - isDisabled={!data.user.image} - > - Delete file - - - -
-
- ); -} diff --git a/src/app/[locale]/my/settings/form.tsx b/src/app/[locale]/my/settings/form.tsx index f70e3fb..f62b61c 100644 --- a/src/app/[locale]/my/settings/form.tsx +++ b/src/app/[locale]/my/settings/form.tsx @@ -13,8 +13,6 @@ import { User } from "@/db/schema"; export interface SettingsFormValues { name: string; - firstName: string; - lastName: string; } function SettingsFormFields({ @@ -47,31 +45,6 @@ function SettingsFormFields({ isDisabled={true} /> -
-

- Real name -

-

- Optional, not public. This simply makes it easier for your team mates - to find you when adding a match. -

-
-
- - -