From ed36285c2f0f6c44348386f565eacc98ec202019 Mon Sep 17 00:00:00 2001 From: Bradley Shellnut Date: Tue, 12 Mar 2024 11:34:39 -0700 Subject: [PATCH] Removing nanoid, changing main id to uuid for all schemas, adding display cuid2, and adding rate limiter to login and signup. --- drizzle/0000_oval_wolverine.sql | 233 ---- drizzle/0000_tricky_hitman.sql | 365 ++++++ drizzle/0001_giant_tomorrow_man.sql | 51 - drizzle/0001_numerous_dragon_man.sql | 6 + drizzle/0002_sour_silverclaw.sql | 27 - drizzle/0002_thick_lyja.sql | 5 + drizzle/0003_mushy_madame_masque.sql | 1 + drizzle/0003_thick_tinkerer.sql | 1 - drizzle/0004_fancy_umar.sql | 30 - drizzle/0005_uneven_lifeguard.sql | 16 - drizzle/0006_light_corsair.sql | 2 - drizzle/0007_same_valeria_richards.sql | 71 -- drizzle/0008_complete_manta.sql | 7 - drizzle/0009_equal_christian_walker.sql | 7 - drizzle/0010_flat_mister_sinister.sql | 1 - drizzle/0011_gigantic_mister_sinister.sql | 97 -- drizzle/0012_dizzy_lethal_legion.sql | 2 - drizzle/0013_clever_monster_badoon.sql | 3 - drizzle/0014_organic_morlocks.sql | 1 - drizzle/0015_awesome_gabe_jones.sql | 12 - drizzle/meta/0000_snapshot.json | 1057 +++++++++++----- drizzle/meta/0001_snapshot.json | 1057 +++++++++++----- drizzle/meta/0002_snapshot.json | 1013 +++++++++++----- drizzle/meta/0003_snapshot.json | 1003 ++++++++++----- drizzle/meta/0004_snapshot.json | 1138 ----------------- drizzle/meta/0005_snapshot.json | 1138 ----------------- drizzle/meta/0006_snapshot.json | 1138 ----------------- drizzle/meta/0007_snapshot.json | 1194 ------------------ drizzle/meta/0008_snapshot.json | 1194 ------------------ drizzle/meta/0009_snapshot.json | 1194 ------------------ drizzle/meta/0010_snapshot.json | 1201 ------------------ drizzle/meta/0011_snapshot.json | 1346 --------------------- drizzle/meta/0012_snapshot.json | 1346 --------------------- drizzle/meta/0013_snapshot.json | 1328 -------------------- drizzle/meta/0014_snapshot.json | 1271 ------------------- drizzle/meta/0015_snapshot.json | 1320 -------------------- drizzle/meta/_journal.json | 100 +- package.json | 16 +- pnpm-lock.yaml | 353 +++--- src/lib/server/auth-utils.ts | 2 +- src/lib/server/auth.ts | 5 +- src/migrate.ts | 6 +- src/routes/(auth)/login/+page.server.ts | 17 +- src/routes/(auth)/sign-up/+page.server.ts | 37 +- src/schema.ts | 619 ++++------ 45 files changed, 3762 insertions(+), 17269 deletions(-) delete mode 100644 drizzle/0000_oval_wolverine.sql create mode 100644 drizzle/0000_tricky_hitman.sql delete mode 100644 drizzle/0001_giant_tomorrow_man.sql create mode 100644 drizzle/0001_numerous_dragon_man.sql delete mode 100644 drizzle/0002_sour_silverclaw.sql create mode 100644 drizzle/0002_thick_lyja.sql create mode 100644 drizzle/0003_mushy_madame_masque.sql delete mode 100644 drizzle/0003_thick_tinkerer.sql delete mode 100644 drizzle/0004_fancy_umar.sql delete mode 100644 drizzle/0005_uneven_lifeguard.sql delete mode 100644 drizzle/0006_light_corsair.sql delete mode 100644 drizzle/0007_same_valeria_richards.sql delete mode 100644 drizzle/0008_complete_manta.sql delete mode 100644 drizzle/0009_equal_christian_walker.sql delete mode 100644 drizzle/0010_flat_mister_sinister.sql delete mode 100644 drizzle/0011_gigantic_mister_sinister.sql delete mode 100644 drizzle/0012_dizzy_lethal_legion.sql delete mode 100644 drizzle/0013_clever_monster_badoon.sql delete mode 100644 drizzle/0014_organic_morlocks.sql delete mode 100644 drizzle/0015_awesome_gabe_jones.sql 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 drizzle/meta/0010_snapshot.json delete mode 100644 drizzle/meta/0011_snapshot.json delete mode 100644 drizzle/meta/0012_snapshot.json delete mode 100644 drizzle/meta/0013_snapshot.json delete mode 100644 drizzle/meta/0014_snapshot.json delete mode 100644 drizzle/meta/0015_snapshot.json diff --git a/drizzle/0000_oval_wolverine.sql b/drizzle/0000_oval_wolverine.sql deleted file mode 100644 index 1b053cc..0000000 --- a/drizzle/0000_oval_wolverine.sql +++ /dev/null @@ -1,233 +0,0 @@ -CREATE TABLE IF NOT EXISTS "artists" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "name" varchar(255), - "slug" varchar(255), - "external_id" integer, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "artists_to_games" ( - "artist_id" varchar(255), - "game_id" varchar(255) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "categories" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "name" varchar(255), - "slug" varchar(255), - "external_id" integer, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "categories_to_games" ( - "category_id" varchar(255), - "game_id" varchar(255) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "collection_items" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "collection_id" varchar(255) NOT NULL, - "game_id" varchar(255) NOT NULL, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "collections" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "user_id" varchar(255) NOT NULL, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "designers" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "name" varchar(255), - "slug" varchar(255), - "external_id" integer, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "designers_to_games" ( - "designer_id" varchar(255), - "game_id" varchar(255) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "expansions" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "base_game_id" varchar(255) NOT NULL, - "game_id" varchar(255) NOT NULL, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "games" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "name" varchar(255), - "slug" varchar(255), - "description" text, - "year_published" integer, - "min_players" integer, - "max_players" integer, - "playtime" integer, - "min_playtime" integer, - "max_playtime" integer, - "min_age" integer, - "image_url" varchar(255), - "thumb_url" varchar(255), - "url" varchar(255), - "external_id" integer, - "last_sync_at" timestamp with time zone, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)), - CONSTRAINT "games_external_id_unique" UNIQUE("external_id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "mechanics" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "name" varchar(255), - "slug" varchar(255), - "external_id" integer, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "mechanics_to_games" ( - "mechanic_id" varchar(255), - "game_id" varchar(255) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "publishers" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "name" varchar(255), - "slug" varchar(255), - "external_id" integer, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "publishers_to_games" ( - "publisher_id" varchar(255), - "game_id" varchar(255) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "roles" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "name" varchar(255), - CONSTRAINT "roles_name_unique" UNIQUE("name") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "sessions" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "user_id" varchar(255) NOT NULL, - "expires_at" timestamp with time zone NOT NULL, - "ip_country" varchar(255), - "ip_address" varchar(255) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "user_roles" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "user_id" varchar(255) NOT NULL, - "role_id" varchar(255) NOT NULL, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "users" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "username" varchar(255), - "hashed_password" varchar(255), - "email" varchar(255), - "first_name" varchar(255), - "last_name" varchar(255), - "verified" boolean DEFAULT false, - "receive_email" boolean DEFAULT false, - "theme" varchar(255) DEFAULT 'system', - "created_at" timestamp DEFAULT (now(6)), - "updated_at" timestamp DEFAULT (now(6)), - CONSTRAINT "users_username_unique" UNIQUE("username"), - CONSTRAINT "users_email_unique" UNIQUE("email") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "wishlist_items" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "wishlist_id" varchar(255) NOT NULL, - "game_id" varchar(255) NOT NULL, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "wishlists" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "user_id" varchar(255) NOT NULL, - "created_at" timestamp with time zone DEFAULT (now(6)), - "updated_at" timestamp with time zone DEFAULT (now(6)) -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "collection_items" ADD CONSTRAINT "collection_items_collection_id_collections_id_fk" FOREIGN KEY ("collection_id") REFERENCES "collections"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "collection_items" ADD CONSTRAINT "collection_items_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "collections" ADD CONSTRAINT "collections_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "expansions" ADD CONSTRAINT "expansions_base_game_id_games_id_fk" FOREIGN KEY ("base_game_id") REFERENCES "games"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "expansions" ADD CONSTRAINT "expansions_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "user_roles" ADD CONSTRAINT "user_roles_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "user_roles" ADD CONSTRAINT "user_roles_role_id_roles_id_fk" FOREIGN KEY ("role_id") REFERENCES "roles"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "wishlist_items" ADD CONSTRAINT "wishlist_items_wishlist_id_wishlists_id_fk" FOREIGN KEY ("wishlist_id") REFERENCES "wishlists"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "wishlist_items" ADD CONSTRAINT "wishlist_items_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "wishlists" ADD CONSTRAINT "wishlists_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/drizzle/0000_tricky_hitman.sql b/drizzle/0000_tricky_hitman.sql new file mode 100644 index 0000000..5507d36 --- /dev/null +++ b/drizzle/0000_tricky_hitman.sql @@ -0,0 +1,365 @@ +DO $$ BEGIN + CREATE TYPE "external_id_type" AS ENUM('game', 'category', 'mechanic', 'publisher', 'designer', 'artist'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "categories" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "name" text, + "slug" text, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "categories_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "categories_to_external_ids" ( + "category_id" uuid NOT NULL, + "external_id" uuid NOT NULL, + CONSTRAINT "categories_to_external_ids_category_id_external_id_pk" PRIMARY KEY("category_id","external_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "categories_to_games" ( + "category_id" uuid NOT NULL, + "game_id" uuid NOT NULL, + CONSTRAINT "categories_to_games_category_id_game_id_pk" PRIMARY KEY("category_id","game_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "collection_items" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "collection_id" text NOT NULL, + "game_id" text NOT NULL, + "times_played" integer DEFAULT 0, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "collection_items_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "collections" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "user_id" text NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "collections_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "expansions" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "base_game_id" text NOT NULL, + "game_id" text NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "expansions_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "external_ids" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "type" "external_id_type" NOT NULL, + "external_id" text NOT NULL, + CONSTRAINT "external_ids_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "games" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "name" text, + "slug" text, + "description" text, + "year_published" integer, + "min_players" integer, + "max_players" integer, + "playtime" integer, + "min_playtime" integer, + "max_playtime" integer, + "min_age" integer, + "image_url" text, + "thumb_url" text, + "url" text, + "text_searchable_index" "tsvector", + "last_sync_at" timestamp (6) with time zone, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "games_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "games_to_external_ids" ( + "game_id" uuid NOT NULL, + "external_id" uuid NOT NULL, + CONSTRAINT "games_to_external_ids_game_id_external_id_pk" PRIMARY KEY("game_id","external_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "mechanics" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "name" text, + "slug" text, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "mechanics_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "mechanics_to_external_ids" ( + "mechanic_id" uuid NOT NULL, + "external_id" uuid NOT NULL, + CONSTRAINT "mechanics_to_external_ids_mechanic_id_external_id_pk" PRIMARY KEY("mechanic_id","external_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "mechanics_to_games" ( + "mechanic_id" uuid NOT NULL, + "game_id" uuid NOT NULL, + CONSTRAINT "mechanics_to_games_mechanic_id_game_id_pk" PRIMARY KEY("mechanic_id","game_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "password_reset_tokens" ( + "id" text PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "expires_at" timestamp (6) with time zone, + "created_at" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "publishers" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "name" text, + "slug" text, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "publishers_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "publishers_to_external_ids" ( + "publisher_id" uuid NOT NULL, + "external_id" uuid NOT NULL, + CONSTRAINT "publishers_to_external_ids_publisher_id_external_id_pk" PRIMARY KEY("publisher_id","external_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "publishers_to_games" ( + "publisher_id" uuid NOT NULL, + "game_id" uuid NOT NULL, + CONSTRAINT "publishers_to_games_publisher_id_game_id_pk" PRIMARY KEY("publisher_id","game_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "roles" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "name" text, + CONSTRAINT "roles_cuid_unique" UNIQUE("cuid"), + CONSTRAINT "roles_name_unique" UNIQUE("name") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "sessions" ( + "id" text PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "expires_at" timestamp with time zone NOT NULL, + "ip_country" text, + "ip_address" text +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "user_roles" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "user_id" text NOT NULL, + "role_id" text NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "user_roles_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "users" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "username" text, + "hashed_password" text, + "email" text, + "first_name" text, + "last_name" text, + "verified" boolean DEFAULT false, + "receive_email" boolean DEFAULT false, + "theme" text DEFAULT 'system', + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "users_cuid_unique" UNIQUE("cuid"), + CONSTRAINT "users_username_unique" UNIQUE("username"), + CONSTRAINT "users_email_unique" UNIQUE("email") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "wishlist_items" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "wishlist_id" text NOT NULL, + "game_id" text NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "wishlist_items_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "wishlists" ( + "id" uuid PRIMARY KEY NOT NULL, + "cuid" text, + "user_id" text NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT "wishlists_cuid_unique" UNIQUE("cuid") +); +--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "text_searchable_idx" ON "games" ("text_searchable_index");--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "categories_to_external_ids" ADD CONSTRAINT "categories_to_external_ids_category_id_categories_id_fk" FOREIGN KEY ("category_id") REFERENCES "categories"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "categories_to_external_ids" ADD CONSTRAINT "categories_to_external_ids_external_id_external_ids_id_fk" FOREIGN KEY ("external_id") REFERENCES "external_ids"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "categories_to_games" ADD CONSTRAINT "categories_to_games_category_id_categories_id_fk" FOREIGN KEY ("category_id") REFERENCES "categories"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "categories_to_games" ADD CONSTRAINT "categories_to_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "collection_items" ADD CONSTRAINT "collection_items_collection_id_collections_id_fk" FOREIGN KEY ("collection_id") REFERENCES "collections"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "collection_items" ADD CONSTRAINT "collection_items_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "collections" ADD CONSTRAINT "collections_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "expansions" ADD CONSTRAINT "expansions_base_game_id_games_id_fk" FOREIGN KEY ("base_game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "expansions" ADD CONSTRAINT "expansions_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "games_to_external_ids" ADD CONSTRAINT "games_to_external_ids_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "games_to_external_ids" ADD CONSTRAINT "games_to_external_ids_external_id_external_ids_id_fk" FOREIGN KEY ("external_id") REFERENCES "external_ids"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "mechanics_to_external_ids" ADD CONSTRAINT "mechanics_to_external_ids_mechanic_id_mechanics_id_fk" FOREIGN KEY ("mechanic_id") REFERENCES "mechanics"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "mechanics_to_external_ids" ADD CONSTRAINT "mechanics_to_external_ids_external_id_external_ids_id_fk" FOREIGN KEY ("external_id") REFERENCES "external_ids"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "mechanics_to_games" ADD CONSTRAINT "mechanics_to_games_mechanic_id_mechanics_id_fk" FOREIGN KEY ("mechanic_id") REFERENCES "mechanics"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "mechanics_to_games" ADD CONSTRAINT "mechanics_to_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "password_reset_tokens" ADD CONSTRAINT "password_reset_tokens_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "publishers_to_external_ids" ADD CONSTRAINT "publishers_to_external_ids_publisher_id_publishers_id_fk" FOREIGN KEY ("publisher_id") REFERENCES "publishers"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "publishers_to_external_ids" ADD CONSTRAINT "publishers_to_external_ids_external_id_external_ids_id_fk" FOREIGN KEY ("external_id") REFERENCES "external_ids"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "publishers_to_games" ADD CONSTRAINT "publishers_to_games_publisher_id_publishers_id_fk" FOREIGN KEY ("publisher_id") REFERENCES "publishers"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "publishers_to_games" ADD CONSTRAINT "publishers_to_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "user_roles" ADD CONSTRAINT "user_roles_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "user_roles" ADD CONSTRAINT "user_roles_role_id_roles_id_fk" FOREIGN KEY ("role_id") REFERENCES "roles"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "wishlist_items" ADD CONSTRAINT "wishlist_items_wishlist_id_wishlists_id_fk" FOREIGN KEY ("wishlist_id") REFERENCES "wishlists"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "wishlist_items" ADD CONSTRAINT "wishlist_items_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "wishlists" ADD CONSTRAINT "wishlists_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; diff --git a/drizzle/0001_giant_tomorrow_man.sql b/drizzle/0001_giant_tomorrow_man.sql deleted file mode 100644 index f893c21..0000000 --- a/drizzle/0001_giant_tomorrow_man.sql +++ /dev/null @@ -1,51 +0,0 @@ -ALTER TABLE "artists" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "artists" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "artists" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "artists" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "categories" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "categories" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "categories" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "categories" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "collection_items" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "collection_items" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "collection_items" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "collection_items" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "collections" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "collections" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "collections" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "collections" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "designers" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "designers" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "designers" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "designers" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "expansions" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "expansions" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "expansions" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "expansions" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "games" ALTER COLUMN "last_sync_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "games" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "games" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "games" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "games" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "mechanics" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "mechanics" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "mechanics" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "mechanics" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "publishers" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "publishers" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "publishers" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "publishers" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "user_roles" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "user_roles" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "user_roles" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "user_roles" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "users" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "users" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "wishlist_items" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "wishlist_items" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "wishlist_items" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "wishlist_items" ALTER COLUMN "updated_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "wishlists" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "wishlists" ALTER COLUMN "created_at" SET DEFAULT (now());--> statement-breakpoint -ALTER TABLE "wishlists" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "wishlists" ALTER COLUMN "updated_at" SET DEFAULT (now()); \ No newline at end of file diff --git a/drizzle/0001_numerous_dragon_man.sql b/drizzle/0001_numerous_dragon_man.sql new file mode 100644 index 0000000..32e4b50 --- /dev/null +++ b/drizzle/0001_numerous_dragon_man.sql @@ -0,0 +1,6 @@ +ALTER TABLE "collection_items" ALTER COLUMN "collection_id" SET DATA TYPE uuid;--> statement-breakpoint +ALTER TABLE "collection_items" ALTER COLUMN "game_id" SET DATA TYPE uuid;--> statement-breakpoint +ALTER TABLE "expansions" ALTER COLUMN "base_game_id" SET DATA TYPE uuid;--> statement-breakpoint +ALTER TABLE "expansions" ALTER COLUMN "game_id" SET DATA TYPE uuid;--> statement-breakpoint +ALTER TABLE "wishlist_items" ALTER COLUMN "wishlist_id" SET DATA TYPE uuid;--> statement-breakpoint +ALTER TABLE "wishlist_items" ALTER COLUMN "game_id" SET DATA TYPE uuid; \ No newline at end of file diff --git a/drizzle/0002_sour_silverclaw.sql b/drizzle/0002_sour_silverclaw.sql deleted file mode 100644 index cd443f3..0000000 --- a/drizzle/0002_sour_silverclaw.sql +++ /dev/null @@ -1,27 +0,0 @@ -ALTER TABLE "artists" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "artists" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "categories" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "categories" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "collection_items" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "collection_items" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "collections" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "collections" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "designers" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "designers" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "expansions" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "expansions" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "games" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "games" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "mechanics" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "mechanics" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "publishers" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "publishers" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "user_roles" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "user_roles" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "users" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "users" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "wishlist_items" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "wishlist_items" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "wishlists" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "wishlists" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint -ALTER TABLE "games" ADD COLUMN "text_searchable_index" "tsvector"; \ No newline at end of file diff --git a/drizzle/0002_thick_lyja.sql b/drizzle/0002_thick_lyja.sql new file mode 100644 index 0000000..43b529b --- /dev/null +++ b/drizzle/0002_thick_lyja.sql @@ -0,0 +1,5 @@ +ALTER TABLE "collections" ALTER COLUMN "user_id" SET DATA TYPE uuid;--> statement-breakpoint +ALTER TABLE "password_reset_tokens" ALTER COLUMN "user_id" SET DATA TYPE uuid;--> statement-breakpoint +ALTER TABLE "sessions" ALTER COLUMN "user_id" SET DATA TYPE uuid;--> statement-breakpoint +ALTER TABLE "user_roles" ALTER COLUMN "user_id" SET DATA TYPE uuid;--> statement-breakpoint +ALTER TABLE "wishlists" ALTER COLUMN "user_id" SET DATA TYPE uuid; \ No newline at end of file diff --git a/drizzle/0003_mushy_madame_masque.sql b/drizzle/0003_mushy_madame_masque.sql new file mode 100644 index 0000000..aa115b1 --- /dev/null +++ b/drizzle/0003_mushy_madame_masque.sql @@ -0,0 +1 @@ +ALTER TABLE "user_roles" ALTER COLUMN "role_id" SET DATA TYPE uuid; \ No newline at end of file diff --git a/drizzle/0003_thick_tinkerer.sql b/drizzle/0003_thick_tinkerer.sql deleted file mode 100644 index 9aa98ab..0000000 --- a/drizzle/0003_thick_tinkerer.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX IF NOT EXISTS "text_searchable_idx" ON "games" ("text_searchable_index"); \ No newline at end of file diff --git a/drizzle/0004_fancy_umar.sql b/drizzle/0004_fancy_umar.sql deleted file mode 100644 index 0881bb3..0000000 --- a/drizzle/0004_fancy_umar.sql +++ /dev/null @@ -1,30 +0,0 @@ -DO $$ BEGIN - CREATE TYPE "external_id_type" AS ENUM('game', 'category', 'mechanic', 'publisher', 'designer', 'artist'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "external_ids" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "type" varchar(255), - "external_id" varchar(255) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "game_external_ids" ( - "game_id" varchar(255) NOT NULL, - "external_id" varchar(255) NOT NULL -); ---> statement-breakpoint -ALTER TABLE "games" DROP CONSTRAINT "games_external_id_unique";--> statement-breakpoint -ALTER TABLE "games" DROP COLUMN IF EXISTS "external_id";--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "game_external_ids" ADD CONSTRAINT "game_external_ids_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "game_external_ids" ADD CONSTRAINT "game_external_ids_external_id_external_ids_id_fk" FOREIGN KEY ("external_id") REFERENCES "external_ids"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/drizzle/0005_uneven_lifeguard.sql b/drizzle/0005_uneven_lifeguard.sql deleted file mode 100644 index 10c6129..0000000 --- a/drizzle/0005_uneven_lifeguard.sql +++ /dev/null @@ -1,16 +0,0 @@ -ALTER TABLE "game_external_ids" RENAME TO "games_to_external_ids";--> statement-breakpoint -ALTER TABLE "games_to_external_ids" DROP CONSTRAINT "game_external_ids_game_id_games_id_fk"; ---> statement-breakpoint -ALTER TABLE "games_to_external_ids" DROP CONSTRAINT "game_external_ids_external_id_external_ids_id_fk"; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "games_to_external_ids" ADD CONSTRAINT "games_to_external_ids_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "games_to_external_ids" ADD CONSTRAINT "games_to_external_ids_external_id_external_ids_id_fk" FOREIGN KEY ("external_id") REFERENCES "external_ids"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/drizzle/0006_light_corsair.sql b/drizzle/0006_light_corsair.sql deleted file mode 100644 index ee9f17e..0000000 --- a/drizzle/0006_light_corsair.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "external_ids" ALTER COLUMN "type" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "external_ids" ALTER COLUMN "external_id" SET NOT NULL; \ No newline at end of file diff --git a/drizzle/0007_same_valeria_richards.sql b/drizzle/0007_same_valeria_richards.sql deleted file mode 100644 index 2805de8..0000000 --- a/drizzle/0007_same_valeria_richards.sql +++ /dev/null @@ -1,71 +0,0 @@ -CREATE TABLE IF NOT EXISTS "categories_to_external_ids" ( - "category_id" varchar(255) NOT NULL, - "external_id" varchar(255) NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "expansions_to_external_ids" ( - "expansion_id" varchar(255) NOT NULL, - "external_id" varchar(255) NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "mechanics_to_external_ids" ( - "mechanic_id" varchar(255) NOT NULL, - "external_id" varchar(255) NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "publishers_to_external_ids" ( - "publisher_id" varchar(255) NOT NULL, - "external_id" varchar(255) NOT NULL -); ---> statement-breakpoint -DROP TABLE "artists";--> statement-breakpoint -DROP TABLE "artists_to_games";--> statement-breakpoint -DROP TABLE "designers";--> statement-breakpoint -DROP TABLE "designers_to_games";--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "categories_to_external_ids" ADD CONSTRAINT "categories_to_external_ids_category_id_categories_id_fk" FOREIGN KEY ("category_id") REFERENCES "categories"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "categories_to_external_ids" ADD CONSTRAINT "categories_to_external_ids_external_id_external_ids_id_fk" FOREIGN KEY ("external_id") REFERENCES "external_ids"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "expansions_to_external_ids" ADD CONSTRAINT "expansions_to_external_ids_expansion_id_expansions_id_fk" FOREIGN KEY ("expansion_id") REFERENCES "expansions"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "expansions_to_external_ids" ADD CONSTRAINT "expansions_to_external_ids_external_id_external_ids_id_fk" FOREIGN KEY ("external_id") REFERENCES "external_ids"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "mechanics_to_external_ids" ADD CONSTRAINT "mechanics_to_external_ids_mechanic_id_mechanics_id_fk" FOREIGN KEY ("mechanic_id") REFERENCES "mechanics"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "mechanics_to_external_ids" ADD CONSTRAINT "mechanics_to_external_ids_external_id_external_ids_id_fk" FOREIGN KEY ("external_id") REFERENCES "external_ids"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "publishers_to_external_ids" ADD CONSTRAINT "publishers_to_external_ids_publisher_id_publishers_id_fk" FOREIGN KEY ("publisher_id") REFERENCES "publishers"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "publishers_to_external_ids" ADD CONSTRAINT "publishers_to_external_ids_external_id_external_ids_id_fk" FOREIGN KEY ("external_id") REFERENCES "external_ids"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/drizzle/0008_complete_manta.sql b/drizzle/0008_complete_manta.sql deleted file mode 100644 index d7ef37c..0000000 --- a/drizzle/0008_complete_manta.sql +++ /dev/null @@ -1,7 +0,0 @@ -DO $$ BEGIN - CREATE TYPE "type" AS ENUM('game', 'category', 'mechanic', 'publisher', 'designer', 'artist'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "external_ids" ALTER COLUMN "type" SET DATA TYPE type; \ No newline at end of file diff --git a/drizzle/0009_equal_christian_walker.sql b/drizzle/0009_equal_christian_walker.sql deleted file mode 100644 index ef25bd1..0000000 --- a/drizzle/0009_equal_christian_walker.sql +++ /dev/null @@ -1,7 +0,0 @@ -DO $$ BEGIN - CREATE TYPE "external_id_type" AS ENUM('game', 'category', 'mechanic', 'publisher', 'designer', 'artist'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "external_ids" ALTER COLUMN "type" SET DATA TYPE external_id_type; \ No newline at end of file diff --git a/drizzle/0010_flat_mister_sinister.sql b/drizzle/0010_flat_mister_sinister.sql deleted file mode 100644 index c4599de..0000000 --- a/drizzle/0010_flat_mister_sinister.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "collection_items" ADD COLUMN "times_played" integer DEFAULT 0; \ No newline at end of file diff --git a/drizzle/0011_gigantic_mister_sinister.sql b/drizzle/0011_gigantic_mister_sinister.sql deleted file mode 100644 index 36c84c5..0000000 --- a/drizzle/0011_gigantic_mister_sinister.sql +++ /dev/null @@ -1,97 +0,0 @@ -ALTER TABLE "categories_to_external_ids" DROP CONSTRAINT "categories_to_external_ids_category_id_categories_id_fk"; ---> statement-breakpoint -ALTER TABLE "expansions" DROP CONSTRAINT "expansions_base_game_id_games_id_fk"; ---> statement-breakpoint -ALTER TABLE "expansions_to_external_ids" DROP CONSTRAINT "expansions_to_external_ids_expansion_id_expansions_id_fk"; ---> statement-breakpoint -ALTER TABLE "games_to_external_ids" DROP CONSTRAINT "games_to_external_ids_game_id_games_id_fk"; ---> statement-breakpoint -ALTER TABLE "mechanics_to_external_ids" DROP CONSTRAINT "mechanics_to_external_ids_mechanic_id_mechanics_id_fk"; ---> statement-breakpoint -ALTER TABLE "publishers_to_external_ids" DROP CONSTRAINT "publishers_to_external_ids_publisher_id_publishers_id_fk"; ---> statement-breakpoint -ALTER TABLE "categories_to_games" ALTER COLUMN "category_id" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "categories_to_games" ALTER COLUMN "game_id" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "mechanics_to_games" ALTER COLUMN "mechanic_id" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "mechanics_to_games" ALTER COLUMN "game_id" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "publishers_to_games" ALTER COLUMN "publisher_id" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "publishers_to_games" ALTER COLUMN "game_id" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "categories_to_external_ids" ADD CONSTRAINT "categories_to_external_ids_category_id_external_id_pk" PRIMARY KEY("category_id","external_id");--> statement-breakpoint -ALTER TABLE "categories_to_games" ADD CONSTRAINT "categories_to_games_category_id_game_id_pk" PRIMARY KEY("category_id","game_id");--> statement-breakpoint -ALTER TABLE "expansions_to_external_ids" ADD CONSTRAINT "expansions_to_external_ids_expansion_id_external_id_pk" PRIMARY KEY("expansion_id","external_id");--> statement-breakpoint -ALTER TABLE "games_to_external_ids" ADD CONSTRAINT "games_to_external_ids_game_id_external_id_pk" PRIMARY KEY("game_id","external_id");--> statement-breakpoint -ALTER TABLE "mechanics_to_external_ids" ADD CONSTRAINT "mechanics_to_external_ids_mechanic_id_external_id_pk" PRIMARY KEY("mechanic_id","external_id");--> statement-breakpoint -ALTER TABLE "mechanics_to_games" ADD CONSTRAINT "mechanics_to_games_mechanic_id_game_id_pk" PRIMARY KEY("mechanic_id","game_id");--> statement-breakpoint -ALTER TABLE "publishers_to_external_ids" ADD CONSTRAINT "publishers_to_external_ids_publisher_id_external_id_pk" PRIMARY KEY("publisher_id","external_id");--> statement-breakpoint -ALTER TABLE "publishers_to_games" ADD CONSTRAINT "publishers_to_games_publisher_id_game_id_pk" PRIMARY KEY("publisher_id","game_id");--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "categories_to_external_ids" ADD CONSTRAINT "categories_to_external_ids_category_id_categories_id_fk" FOREIGN KEY ("category_id") REFERENCES "categories"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "categories_to_games" ADD CONSTRAINT "categories_to_games_category_id_categories_id_fk" FOREIGN KEY ("category_id") REFERENCES "categories"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "categories_to_games" ADD CONSTRAINT "categories_to_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "expansions" ADD CONSTRAINT "expansions_base_game_id_games_id_fk" FOREIGN KEY ("base_game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "expansions_to_external_ids" ADD CONSTRAINT "expansions_to_external_ids_expansion_id_expansions_id_fk" FOREIGN KEY ("expansion_id") REFERENCES "expansions"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "games_to_external_ids" ADD CONSTRAINT "games_to_external_ids_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "mechanics_to_external_ids" ADD CONSTRAINT "mechanics_to_external_ids_mechanic_id_mechanics_id_fk" FOREIGN KEY ("mechanic_id") REFERENCES "mechanics"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "mechanics_to_games" ADD CONSTRAINT "mechanics_to_games_mechanic_id_mechanics_id_fk" FOREIGN KEY ("mechanic_id") REFERENCES "mechanics"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "mechanics_to_games" ADD CONSTRAINT "mechanics_to_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "publishers_to_external_ids" ADD CONSTRAINT "publishers_to_external_ids_publisher_id_publishers_id_fk" FOREIGN KEY ("publisher_id") REFERENCES "publishers"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "publishers_to_games" ADD CONSTRAINT "publishers_to_games_publisher_id_publishers_id_fk" FOREIGN KEY ("publisher_id") REFERENCES "publishers"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "publishers_to_games" ADD CONSTRAINT "publishers_to_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE restrict ON UPDATE cascade; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/drizzle/0012_dizzy_lethal_legion.sql b/drizzle/0012_dizzy_lethal_legion.sql deleted file mode 100644 index 4764795..0000000 --- a/drizzle/0012_dizzy_lethal_legion.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "users" ALTER COLUMN "created_at" SET DATA TYPE timestamp (6) with time zone;--> statement-breakpoint -ALTER TABLE "users" ALTER COLUMN "updated_at" SET DATA TYPE timestamp (6) with time zone; \ No newline at end of file diff --git a/drizzle/0013_clever_monster_badoon.sql b/drizzle/0013_clever_monster_badoon.sql deleted file mode 100644 index 334a5e4..0000000 --- a/drizzle/0013_clever_monster_badoon.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE "categories" DROP COLUMN IF EXISTS "external_id";--> statement-breakpoint -ALTER TABLE "mechanics" DROP COLUMN IF EXISTS "external_id";--> statement-breakpoint -ALTER TABLE "publishers" DROP COLUMN IF EXISTS "external_id"; \ No newline at end of file diff --git a/drizzle/0014_organic_morlocks.sql b/drizzle/0014_organic_morlocks.sql deleted file mode 100644 index c0b6604..0000000 --- a/drizzle/0014_organic_morlocks.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE "expansions_to_external_ids"; \ No newline at end of file diff --git a/drizzle/0015_awesome_gabe_jones.sql b/drizzle/0015_awesome_gabe_jones.sql deleted file mode 100644 index e70a04f..0000000 --- a/drizzle/0015_awesome_gabe_jones.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS "password_reset_tokens" ( - "id" varchar(255) PRIMARY KEY NOT NULL, - "user_id" varchar(255) NOT NULL, - "expires_at" timestamp (6) with time zone, - "created_at" timestamp (6) with time zone DEFAULT now() -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "password_reset_tokens" ADD CONSTRAINT "password_reset_tokens_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/drizzle/meta/0000_snapshot.json b/drizzle/meta/0000_snapshot.json index 0a3baf1..f021098 100644 --- a/drizzle/meta/0000_snapshot.json +++ b/drizzle/meta/0000_snapshot.json @@ -1,125 +1,120 @@ { - "id": "620f89bd-01b9-4591-94e6-23a7bc63cdc3", + "id": "176e5b1f-d146-4604-ab17-b16052da13c0", "prevId": "00000000-0000-0000-0000-000000000000", "version": "5", "dialect": "pg", "tables": { - "artists": { - "name": "artists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false, - "default": "(now(6))" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false, - "default": "(now(6))" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "artists_to_games": { - "name": "artists_to_games", - "schema": "", - "columns": { - "artist_id": { - "name": "artist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, "categories": { "name": "categories", "schema": "", "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "categories_cuid_unique": { + "name": "categories_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "categories_to_external_ids": { + "name": "categories_to_external_ids", + "schema": "", + "columns": { + "category_id": { + "name": "category_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "categories_to_external_ids_category_id_categories_id_fk": { + "name": "categories_to_external_ids_category_id_categories_id_fk", + "tableFrom": "categories_to_external_ids", + "tableTo": "categories", + "columnsFrom": [ + "category_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "categories_to_external_ids_external_id_external_ids_id_fk": { + "name": "categories_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "categories_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "categories_to_external_ids_category_id_external_id_pk": { + "name": "categories_to_external_ids_category_id_external_id_pk", + "columns": [ + "category_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "categories_to_games": { @@ -128,20 +123,55 @@ "columns": { "category_id": { "name": "category_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, + "foreignKeys": { + "categories_to_games_category_id_categories_id_fk": { + "name": "categories_to_games_category_id_categories_id_fk", + "tableFrom": "categories_to_games", + "tableTo": "categories", + "columnsFrom": [ + "category_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "categories_to_games_game_id_games_id_fk": { + "name": "categories_to_games_game_id_games_id_fk", + "tableFrom": "categories_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "categories_to_games_category_id_game_id_pk": { + "name": "categories_to_games_category_id_game_id_pk", + "columns": [ + "category_id", + "game_id" + ] + } + }, "uniqueConstraints": {} }, "collection_items": { @@ -150,35 +180,48 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "collection_id": { "name": "collection_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", + "times_played": { + "name": "times_played", + "type": "integer", "primaryKey": false, "notNull": false, - "default": "(now(6))" + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -211,7 +254,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "collection_items_cuid_unique": { + "name": "collection_items_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "collections": { "name": "collections", @@ -219,29 +270,35 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -261,77 +318,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers": { - "name": "designers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false, - "default": "(now(6))" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "uniqueConstraints": { + "collections_cuid_unique": { + "name": "collections_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers_to_games": { - "name": "designers_to_games", - "schema": "", - "columns": { - "designer_id": { - "name": "designer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} + } }, "expansions": { "name": "expansions", @@ -339,35 +334,41 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "base_game_id": { "name": "base_game_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -382,8 +383,8 @@ "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onDelete": "restrict", + "onUpdate": "cascade" }, "expansions_game_id_games_id_fk": { "name": "expansions_game_id_games_id_fk", @@ -395,12 +396,62 @@ "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onDelete": "restrict", + "onUpdate": "cascade" } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "expansions_cuid_unique": { + "name": "expansions_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "external_ids": { + "name": "external_ids", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "external_id_type", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "external_ids_cuid_unique": { + "name": "external_ids_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "games": { "name": "games", @@ -408,19 +459,25 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, @@ -474,108 +531,238 @@ }, "image_url": { "name": "image_url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "thumb_url": { "name": "thumb_url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "url": { "name": "url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, - "external_id": { - "name": "external_id", - "type": "integer", + "text_searchable_index": { + "name": "text_searchable_index", + "type": "tsvector", "primaryKey": false, "notNull": false }, "last_sync_at": { "name": "last_sync_at", - "type": "timestamp with time zone", + "type": "timestamp (6) with time zone", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "text_searchable_idx": { + "name": "text_searchable_idx", + "columns": [ + "text_searchable_index" + ], + "isUnique": false } }, - "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { - "games_external_id_unique": { - "name": "games_external_id_unique", + "games_cuid_unique": { + "name": "games_cuid_unique", "nullsNotDistinct": false, "columns": [ - "external_id" + "cuid" ] } } }, + "games_to_external_ids": { + "name": "games_to_external_ids", + "schema": "", + "columns": { + "game_id": { + "name": "game_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "games_to_external_ids_game_id_games_id_fk": { + "name": "games_to_external_ids_game_id_games_id_fk", + "tableFrom": "games_to_external_ids", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "games_to_external_ids_external_id_external_ids_id_fk": { + "name": "games_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "games_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "games_to_external_ids_game_id_external_id_pk": { + "name": "games_to_external_ids_game_id_external_id_pk", + "columns": [ + "game_id", + "external_id" + ] + } + }, + "uniqueConstraints": {} + }, "mechanics": { "name": "mechanics", "schema": "", "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mechanics_cuid_unique": { + "name": "mechanics_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "mechanics_to_external_ids": { + "name": "mechanics_to_external_ids", + "schema": "", + "columns": { + "mechanic_id": { + "name": "mechanic_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { + "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", + "tableFrom": "mechanics_to_external_ids", + "tableTo": "mechanics", + "columnsFrom": [ + "mechanic_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "mechanics_to_external_ids_external_id_external_ids_id_fk": { + "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "mechanics_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "mechanics_to_external_ids_mechanic_id_external_id_pk": { + "name": "mechanics_to_external_ids_mechanic_id_external_id_pk", + "columns": [ + "mechanic_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "mechanics_to_games": { @@ -584,19 +771,103 @@ "columns": { "mechanic_id": { "name": "mechanic_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, + "foreignKeys": { + "mechanics_to_games_mechanic_id_mechanics_id_fk": { + "name": "mechanics_to_games_mechanic_id_mechanics_id_fk", + "tableFrom": "mechanics_to_games", + "tableTo": "mechanics", + "columnsFrom": [ + "mechanic_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "mechanics_to_games_game_id_games_id_fk": { + "name": "mechanics_to_games_game_id_games_id_fk", + "tableFrom": "mechanics_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "mechanics_to_games_mechanic_id_game_id_pk": { + "name": "mechanics_to_games_mechanic_id_game_id_pk", + "columns": [ + "mechanic_id", + "game_id" + ] + } + }, + "uniqueConstraints": {} + }, + "password_reset_tokens": { + "name": "password_reset_tokens", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "password_reset_tokens_user_id_users_id_fk": { + "name": "password_reset_tokens_user_id_users_id_fk", + "tableFrom": "password_reset_tokens", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, @@ -606,46 +877,111 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "publishers_cuid_unique": { + "name": "publishers_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "publishers_to_external_ids": { + "name": "publishers_to_external_ids", + "schema": "", + "columns": { + "publisher_id": { + "name": "publisher_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "publishers_to_external_ids_publisher_id_publishers_id_fk": { + "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", + "tableFrom": "publishers_to_external_ids", + "tableTo": "publishers", + "columnsFrom": [ + "publisher_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "publishers_to_external_ids_external_id_external_ids_id_fk": { + "name": "publishers_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "publishers_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "publishers_to_external_ids_publisher_id_external_id_pk": { + "name": "publishers_to_external_ids_publisher_id_external_id_pk", + "columns": [ + "publisher_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "publishers_to_games": { @@ -654,20 +990,55 @@ "columns": { "publisher_id": { "name": "publisher_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, + "foreignKeys": { + "publishers_to_games_publisher_id_publishers_id_fk": { + "name": "publishers_to_games_publisher_id_publishers_id_fk", + "tableFrom": "publishers_to_games", + "tableTo": "publishers", + "columnsFrom": [ + "publisher_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "publishers_to_games_game_id_games_id_fk": { + "name": "publishers_to_games_game_id_games_id_fk", + "tableFrom": "publishers_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "publishers_to_games_publisher_id_game_id_pk": { + "name": "publishers_to_games_publisher_id_game_id_pk", + "columns": [ + "publisher_id", + "game_id" + ] + } + }, "uniqueConstraints": {} }, "roles": { @@ -676,13 +1047,19 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false } @@ -691,6 +1068,13 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "roles_cuid_unique": { + "name": "roles_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, "roles_name_unique": { "name": "roles_name_unique", "nullsNotDistinct": false, @@ -706,13 +1090,13 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, @@ -724,13 +1108,13 @@ }, "ip_country": { "name": "ip_country", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "ip_address": { "name": "ip_address", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false } @@ -760,35 +1144,41 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "role_id": { "name": "role_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -821,7 +1211,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "user_roles_cuid_unique": { + "name": "user_roles_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "users": { "name": "users", @@ -829,37 +1227,43 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "username": { "name": "username", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "hashed_password": { "name": "hashed_password", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "email": { "name": "email", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "first_name": { "name": "first_name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "last_name": { "name": "last_name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, @@ -879,7 +1283,7 @@ }, "theme": { "name": "theme", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false, "default": "'system'" @@ -888,21 +1292,28 @@ "name": "created_at", "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "users_cuid_unique": { + "name": "users_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, "users_username_unique": { "name": "users_username_unique", "nullsNotDistinct": false, @@ -925,35 +1336,41 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "wishlist_id": { "name": "wishlist_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -986,7 +1403,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "wishlist_items_cuid_unique": { + "name": "wishlist_items_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "wishlists": { "name": "wishlists", @@ -994,29 +1419,35 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now(6))" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -1036,10 +1467,30 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "wishlists_cuid_unique": { + "name": "wishlists_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + } + }, + "enums": { + "external_id_type": { + "name": "external_id_type", + "values": { + "game": "game", + "category": "category", + "mechanic": "mechanic", + "publisher": "publisher", + "designer": "designer", + "artist": "artist" + } } }, - "enums": {}, "schemas": {}, "_meta": { "columns": {}, diff --git a/drizzle/meta/0001_snapshot.json b/drizzle/meta/0001_snapshot.json index 7f90628..129d9a9 100644 --- a/drizzle/meta/0001_snapshot.json +++ b/drizzle/meta/0001_snapshot.json @@ -1,125 +1,120 @@ { - "id": "99b2283f-80a5-44c6-be3b-b1fcd2a5818d", - "prevId": "620f89bd-01b9-4591-94e6-23a7bc63cdc3", + "id": "7fd9b34f-059f-41a9-9a4c-f9769825233d", + "prevId": "176e5b1f-d146-4604-ab17-b16052da13c0", "version": "5", "dialect": "pg", "tables": { - "artists": { - "name": "artists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "(now())" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "artists_to_games": { - "name": "artists_to_games", - "schema": "", - "columns": { - "artist_id": { - "name": "artist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, "categories": { "name": "categories", "schema": "", "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "categories_cuid_unique": { + "name": "categories_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "categories_to_external_ids": { + "name": "categories_to_external_ids", + "schema": "", + "columns": { + "category_id": { + "name": "category_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "categories_to_external_ids_category_id_categories_id_fk": { + "name": "categories_to_external_ids_category_id_categories_id_fk", + "tableFrom": "categories_to_external_ids", + "tableTo": "categories", + "columnsFrom": [ + "category_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "categories_to_external_ids_external_id_external_ids_id_fk": { + "name": "categories_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "categories_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "categories_to_external_ids_category_id_external_id_pk": { + "name": "categories_to_external_ids_category_id_external_id_pk", + "columns": [ + "category_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "categories_to_games": { @@ -128,20 +123,55 @@ "columns": { "category_id": { "name": "category_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, + "foreignKeys": { + "categories_to_games_category_id_categories_id_fk": { + "name": "categories_to_games_category_id_categories_id_fk", + "tableFrom": "categories_to_games", + "tableTo": "categories", + "columnsFrom": [ + "category_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "categories_to_games_game_id_games_id_fk": { + "name": "categories_to_games_game_id_games_id_fk", + "tableFrom": "categories_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "categories_to_games_category_id_game_id_pk": { + "name": "categories_to_games_category_id_game_id_pk", + "columns": [ + "category_id", + "game_id" + ] + } + }, "uniqueConstraints": {} }, "collection_items": { @@ -150,35 +180,48 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "collection_id": { "name": "collection_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", + "times_played": { + "name": "times_played", + "type": "integer", "primaryKey": false, "notNull": false, - "default": "(now())" + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -211,7 +254,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "collection_items_cuid_unique": { + "name": "collection_items_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "collections": { "name": "collections", @@ -219,29 +270,35 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -261,77 +318,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers": { - "name": "designers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "(now())" + "uniqueConstraints": { + "collections_cuid_unique": { + "name": "collections_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers_to_games": { - "name": "designers_to_games", - "schema": "", - "columns": { - "designer_id": { - "name": "designer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} + } }, "expansions": { "name": "expansions", @@ -339,35 +334,41 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "base_game_id": { "name": "base_game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -382,8 +383,8 @@ "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onDelete": "restrict", + "onUpdate": "cascade" }, "expansions_game_id_games_id_fk": { "name": "expansions_game_id_games_id_fk", @@ -395,12 +396,62 @@ "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onDelete": "restrict", + "onUpdate": "cascade" } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "expansions_cuid_unique": { + "name": "expansions_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "external_ids": { + "name": "external_ids", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "external_id_type", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "external_ids_cuid_unique": { + "name": "external_ids_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "games": { "name": "games", @@ -408,19 +459,25 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, @@ -474,25 +531,25 @@ }, "image_url": { "name": "image_url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "thumb_url": { "name": "thumb_url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "url": { "name": "url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, - "external_id": { - "name": "external_id", - "type": "integer", + "text_searchable_index": { + "name": "text_searchable_index", + "type": "tsvector", "primaryKey": false, "notNull": false }, @@ -504,78 +561,208 @@ }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "text_searchable_idx": { + "name": "text_searchable_idx", + "columns": [ + "text_searchable_index" + ], + "isUnique": false } }, - "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { - "games_external_id_unique": { - "name": "games_external_id_unique", + "games_cuid_unique": { + "name": "games_cuid_unique", "nullsNotDistinct": false, "columns": [ - "external_id" + "cuid" ] } } }, + "games_to_external_ids": { + "name": "games_to_external_ids", + "schema": "", + "columns": { + "game_id": { + "name": "game_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "games_to_external_ids_game_id_games_id_fk": { + "name": "games_to_external_ids_game_id_games_id_fk", + "tableFrom": "games_to_external_ids", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "games_to_external_ids_external_id_external_ids_id_fk": { + "name": "games_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "games_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "games_to_external_ids_game_id_external_id_pk": { + "name": "games_to_external_ids_game_id_external_id_pk", + "columns": [ + "game_id", + "external_id" + ] + } + }, + "uniqueConstraints": {} + }, "mechanics": { "name": "mechanics", "schema": "", "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mechanics_cuid_unique": { + "name": "mechanics_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "mechanics_to_external_ids": { + "name": "mechanics_to_external_ids", + "schema": "", + "columns": { + "mechanic_id": { + "name": "mechanic_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { + "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", + "tableFrom": "mechanics_to_external_ids", + "tableTo": "mechanics", + "columnsFrom": [ + "mechanic_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "mechanics_to_external_ids_external_id_external_ids_id_fk": { + "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "mechanics_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "mechanics_to_external_ids_mechanic_id_external_id_pk": { + "name": "mechanics_to_external_ids_mechanic_id_external_id_pk", + "columns": [ + "mechanic_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "mechanics_to_games": { @@ -584,19 +771,103 @@ "columns": { "mechanic_id": { "name": "mechanic_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, + "foreignKeys": { + "mechanics_to_games_mechanic_id_mechanics_id_fk": { + "name": "mechanics_to_games_mechanic_id_mechanics_id_fk", + "tableFrom": "mechanics_to_games", + "tableTo": "mechanics", + "columnsFrom": [ + "mechanic_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "mechanics_to_games_game_id_games_id_fk": { + "name": "mechanics_to_games_game_id_games_id_fk", + "tableFrom": "mechanics_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "mechanics_to_games_mechanic_id_game_id_pk": { + "name": "mechanics_to_games_mechanic_id_game_id_pk", + "columns": [ + "mechanic_id", + "game_id" + ] + } + }, + "uniqueConstraints": {} + }, + "password_reset_tokens": { + "name": "password_reset_tokens", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "password_reset_tokens_user_id_users_id_fk": { + "name": "password_reset_tokens_user_id_users_id_fk", + "tableFrom": "password_reset_tokens", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, @@ -606,46 +877,111 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "publishers_cuid_unique": { + "name": "publishers_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "publishers_to_external_ids": { + "name": "publishers_to_external_ids", + "schema": "", + "columns": { + "publisher_id": { + "name": "publisher_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "publishers_to_external_ids_publisher_id_publishers_id_fk": { + "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", + "tableFrom": "publishers_to_external_ids", + "tableTo": "publishers", + "columnsFrom": [ + "publisher_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "publishers_to_external_ids_external_id_external_ids_id_fk": { + "name": "publishers_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "publishers_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "publishers_to_external_ids_publisher_id_external_id_pk": { + "name": "publishers_to_external_ids_publisher_id_external_id_pk", + "columns": [ + "publisher_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "publishers_to_games": { @@ -654,20 +990,55 @@ "columns": { "publisher_id": { "name": "publisher_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, + "foreignKeys": { + "publishers_to_games_publisher_id_publishers_id_fk": { + "name": "publishers_to_games_publisher_id_publishers_id_fk", + "tableFrom": "publishers_to_games", + "tableTo": "publishers", + "columnsFrom": [ + "publisher_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "publishers_to_games_game_id_games_id_fk": { + "name": "publishers_to_games_game_id_games_id_fk", + "tableFrom": "publishers_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "publishers_to_games_publisher_id_game_id_pk": { + "name": "publishers_to_games_publisher_id_game_id_pk", + "columns": [ + "publisher_id", + "game_id" + ] + } + }, "uniqueConstraints": {} }, "roles": { @@ -676,13 +1047,19 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false } @@ -691,6 +1068,13 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "roles_cuid_unique": { + "name": "roles_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, "roles_name_unique": { "name": "roles_name_unique", "nullsNotDistinct": false, @@ -706,13 +1090,13 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, @@ -724,13 +1108,13 @@ }, "ip_country": { "name": "ip_country", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "ip_address": { "name": "ip_address", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false } @@ -760,35 +1144,41 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "role_id": { "name": "role_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -821,7 +1211,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "user_roles_cuid_unique": { + "name": "user_roles_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "users": { "name": "users", @@ -829,37 +1227,43 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "username": { "name": "username", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "hashed_password": { "name": "hashed_password", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "email": { "name": "email", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "first_name": { "name": "first_name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "last_name": { "name": "last_name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, @@ -879,7 +1283,7 @@ }, "theme": { "name": "theme", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false, "default": "'system'" @@ -888,21 +1292,28 @@ "name": "created_at", "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "users_cuid_unique": { + "name": "users_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, "users_username_unique": { "name": "users_username_unique", "nullsNotDistinct": false, @@ -925,35 +1336,41 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "wishlist_id": { "name": "wishlist_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -986,7 +1403,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "wishlist_items_cuid_unique": { + "name": "wishlist_items_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "wishlists": { "name": "wishlists", @@ -994,29 +1419,35 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, - "default": "(now())" + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -1036,10 +1467,30 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "wishlists_cuid_unique": { + "name": "wishlists_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + } + }, + "enums": { + "external_id_type": { + "name": "external_id_type", + "values": { + "game": "game", + "category": "category", + "mechanic": "mechanic", + "publisher": "publisher", + "designer": "designer", + "artist": "artist" + } } }, - "enums": {}, "schemas": {}, "_meta": { "columns": {}, diff --git a/drizzle/meta/0002_snapshot.json b/drizzle/meta/0002_snapshot.json index 696c724..aa00b2e 100644 --- a/drizzle/meta/0002_snapshot.json +++ b/drizzle/meta/0002_snapshot.json @@ -1,125 +1,120 @@ { - "id": "efbcf295-4499-4d80-9026-a0d8627b0e35", - "prevId": "99b2283f-80a5-44c6-be3b-b1fcd2a5818d", + "id": "e088433f-589d-4c15-953e-3b32e85e658f", + "prevId": "7fd9b34f-059f-41a9-9a4c-f9769825233d", "version": "5", "dialect": "pg", "tables": { - "artists": { - "name": "artists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "artists_to_games": { - "name": "artists_to_games", - "schema": "", - "columns": { - "artist_id": { - "name": "artist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, "categories": { "name": "categories", "schema": "", "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "categories_cuid_unique": { + "name": "categories_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "categories_to_external_ids": { + "name": "categories_to_external_ids", + "schema": "", + "columns": { + "category_id": { + "name": "category_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "categories_to_external_ids_category_id_categories_id_fk": { + "name": "categories_to_external_ids_category_id_categories_id_fk", + "tableFrom": "categories_to_external_ids", + "tableTo": "categories", + "columnsFrom": [ + "category_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "categories_to_external_ids_external_id_external_ids_id_fk": { + "name": "categories_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "categories_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "categories_to_external_ids_category_id_external_id_pk": { + "name": "categories_to_external_ids_category_id_external_id_pk", + "columns": [ + "category_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "categories_to_games": { @@ -128,20 +123,55 @@ "columns": { "category_id": { "name": "category_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, + "foreignKeys": { + "categories_to_games_category_id_categories_id_fk": { + "name": "categories_to_games_category_id_categories_id_fk", + "tableFrom": "categories_to_games", + "tableTo": "categories", + "columnsFrom": [ + "category_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "categories_to_games_game_id_games_id_fk": { + "name": "categories_to_games_game_id_games_id_fk", + "tableFrom": "categories_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "categories_to_games_category_id_game_id_pk": { + "name": "categories_to_games_category_id_game_id_pk", + "columns": [ + "category_id", + "game_id" + ] + } + }, "uniqueConstraints": {} }, "collection_items": { @@ -150,34 +180,47 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "collection_id": { "name": "collection_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", + "times_played": { + "name": "times_played", + "type": "integer", "primaryKey": false, "notNull": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -211,7 +254,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "collection_items_cuid_unique": { + "name": "collection_items_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "collections": { "name": "collections", @@ -219,28 +270,34 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -261,77 +318,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers": { - "name": "designers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" + "uniqueConstraints": { + "collections_cuid_unique": { + "name": "collections_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers_to_games": { - "name": "designers_to_games", - "schema": "", - "columns": { - "designer_id": { - "name": "designer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} + } }, "expansions": { "name": "expansions", @@ -339,34 +334,40 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "base_game_id": { "name": "base_game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -382,8 +383,8 @@ "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onDelete": "restrict", + "onUpdate": "cascade" }, "expansions_game_id_games_id_fk": { "name": "expansions_game_id_games_id_fk", @@ -395,12 +396,62 @@ "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onDelete": "restrict", + "onUpdate": "cascade" } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "expansions_cuid_unique": { + "name": "expansions_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "external_ids": { + "name": "external_ids", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "external_id_type", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "external_ids_cuid_unique": { + "name": "external_ids_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "games": { "name": "games", @@ -408,19 +459,25 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, @@ -474,19 +531,19 @@ }, "image_url": { "name": "image_url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "thumb_url": { "name": "thumb_url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "url": { "name": "url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, @@ -496,12 +553,6 @@ "primaryKey": false, "notNull": false }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, "last_sync_at": { "name": "last_sync_at", "type": "timestamp (6) with time zone", @@ -510,78 +561,208 @@ }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, - "indexes": {}, + "indexes": { + "text_searchable_idx": { + "name": "text_searchable_idx", + "columns": [ + "text_searchable_index" + ], + "isUnique": false + } + }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { - "games_external_id_unique": { - "name": "games_external_id_unique", + "games_cuid_unique": { + "name": "games_cuid_unique", "nullsNotDistinct": false, "columns": [ - "external_id" + "cuid" ] } } }, + "games_to_external_ids": { + "name": "games_to_external_ids", + "schema": "", + "columns": { + "game_id": { + "name": "game_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "games_to_external_ids_game_id_games_id_fk": { + "name": "games_to_external_ids_game_id_games_id_fk", + "tableFrom": "games_to_external_ids", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "games_to_external_ids_external_id_external_ids_id_fk": { + "name": "games_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "games_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "games_to_external_ids_game_id_external_id_pk": { + "name": "games_to_external_ids_game_id_external_id_pk", + "columns": [ + "game_id", + "external_id" + ] + } + }, + "uniqueConstraints": {} + }, "mechanics": { "name": "mechanics", "schema": "", "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mechanics_cuid_unique": { + "name": "mechanics_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "mechanics_to_external_ids": { + "name": "mechanics_to_external_ids", + "schema": "", + "columns": { + "mechanic_id": { + "name": "mechanic_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { + "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", + "tableFrom": "mechanics_to_external_ids", + "tableTo": "mechanics", + "columnsFrom": [ + "mechanic_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "mechanics_to_external_ids_external_id_external_ids_id_fk": { + "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "mechanics_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "mechanics_to_external_ids_mechanic_id_external_id_pk": { + "name": "mechanics_to_external_ids_mechanic_id_external_id_pk", + "columns": [ + "mechanic_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "mechanics_to_games": { @@ -590,19 +771,103 @@ "columns": { "mechanic_id": { "name": "mechanic_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, + "foreignKeys": { + "mechanics_to_games_mechanic_id_mechanics_id_fk": { + "name": "mechanics_to_games_mechanic_id_mechanics_id_fk", + "tableFrom": "mechanics_to_games", + "tableTo": "mechanics", + "columnsFrom": [ + "mechanic_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "mechanics_to_games_game_id_games_id_fk": { + "name": "mechanics_to_games_game_id_games_id_fk", + "tableFrom": "mechanics_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "mechanics_to_games_mechanic_id_game_id_pk": { + "name": "mechanics_to_games_mechanic_id_game_id_pk", + "columns": [ + "mechanic_id", + "game_id" + ] + } + }, + "uniqueConstraints": {} + }, + "password_reset_tokens": { + "name": "password_reset_tokens", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "password_reset_tokens_user_id_users_id_fk": { + "name": "password_reset_tokens_user_id_users_id_fk", + "tableFrom": "password_reset_tokens", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, @@ -612,46 +877,111 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "publishers_cuid_unique": { + "name": "publishers_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "publishers_to_external_ids": { + "name": "publishers_to_external_ids", + "schema": "", + "columns": { + "publisher_id": { + "name": "publisher_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "publishers_to_external_ids_publisher_id_publishers_id_fk": { + "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", + "tableFrom": "publishers_to_external_ids", + "tableTo": "publishers", + "columnsFrom": [ + "publisher_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "publishers_to_external_ids_external_id_external_ids_id_fk": { + "name": "publishers_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "publishers_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "publishers_to_external_ids_publisher_id_external_id_pk": { + "name": "publishers_to_external_ids_publisher_id_external_id_pk", + "columns": [ + "publisher_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "publishers_to_games": { @@ -660,20 +990,55 @@ "columns": { "publisher_id": { "name": "publisher_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, + "foreignKeys": { + "publishers_to_games_publisher_id_publishers_id_fk": { + "name": "publishers_to_games_publisher_id_publishers_id_fk", + "tableFrom": "publishers_to_games", + "tableTo": "publishers", + "columnsFrom": [ + "publisher_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "publishers_to_games_game_id_games_id_fk": { + "name": "publishers_to_games_game_id_games_id_fk", + "tableFrom": "publishers_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "publishers_to_games_publisher_id_game_id_pk": { + "name": "publishers_to_games_publisher_id_game_id_pk", + "columns": [ + "publisher_id", + "game_id" + ] + } + }, "uniqueConstraints": {} }, "roles": { @@ -682,13 +1047,19 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false } @@ -697,6 +1068,13 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "roles_cuid_unique": { + "name": "roles_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, "roles_name_unique": { "name": "roles_name_unique", "nullsNotDistinct": false, @@ -712,13 +1090,13 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, @@ -730,13 +1108,13 @@ }, "ip_country": { "name": "ip_country", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "ip_address": { "name": "ip_address", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false } @@ -766,34 +1144,40 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "role_id": { "name": "role_id", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -827,7 +1211,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "user_roles_cuid_unique": { + "name": "user_roles_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "users": { "name": "users", @@ -835,37 +1227,43 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "username": { "name": "username", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "hashed_password": { "name": "hashed_password", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "email": { "name": "email", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "first_name": { "name": "first_name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "last_name": { "name": "last_name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, @@ -885,7 +1283,7 @@ }, "theme": { "name": "theme", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false, "default": "'system'" @@ -894,14 +1292,14 @@ "name": "created_at", "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -909,6 +1307,13 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "users_cuid_unique": { + "name": "users_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, "users_username_unique": { "name": "users_username_unique", "nullsNotDistinct": false, @@ -931,34 +1336,40 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "wishlist_id": { "name": "wishlist_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -992,7 +1403,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "wishlist_items_cuid_unique": { + "name": "wishlist_items_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "wishlists": { "name": "wishlists", @@ -1000,28 +1419,34 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -1042,10 +1467,30 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "wishlists_cuid_unique": { + "name": "wishlists_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + } + }, + "enums": { + "external_id_type": { + "name": "external_id_type", + "values": { + "game": "game", + "category": "category", + "mechanic": "mechanic", + "publisher": "publisher", + "designer": "designer", + "artist": "artist" + } } }, - "enums": {}, "schemas": {}, "_meta": { "columns": {}, diff --git a/drizzle/meta/0003_snapshot.json b/drizzle/meta/0003_snapshot.json index 1d4401d..ac6731c 100644 --- a/drizzle/meta/0003_snapshot.json +++ b/drizzle/meta/0003_snapshot.json @@ -1,125 +1,120 @@ { - "id": "425a2ccd-b74a-4e51-8c80-1a6387cc6c5d", - "prevId": "efbcf295-4499-4d80-9026-a0d8627b0e35", + "id": "6f94b828-2e63-475a-b641-b5848972d8da", + "prevId": "e088433f-589d-4c15-953e-3b32e85e658f", "version": "5", "dialect": "pg", "tables": { - "artists": { - "name": "artists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "artists_to_games": { - "name": "artists_to_games", - "schema": "", - "columns": { - "artist_id": { - "name": "artist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, "categories": { "name": "categories", "schema": "", "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "categories_cuid_unique": { + "name": "categories_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "categories_to_external_ids": { + "name": "categories_to_external_ids", + "schema": "", + "columns": { + "category_id": { + "name": "category_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "categories_to_external_ids_category_id_categories_id_fk": { + "name": "categories_to_external_ids_category_id_categories_id_fk", + "tableFrom": "categories_to_external_ids", + "tableTo": "categories", + "columnsFrom": [ + "category_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "categories_to_external_ids_external_id_external_ids_id_fk": { + "name": "categories_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "categories_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "categories_to_external_ids_category_id_external_id_pk": { + "name": "categories_to_external_ids_category_id_external_id_pk", + "columns": [ + "category_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "categories_to_games": { @@ -128,20 +123,55 @@ "columns": { "category_id": { "name": "category_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, + "foreignKeys": { + "categories_to_games_category_id_categories_id_fk": { + "name": "categories_to_games_category_id_categories_id_fk", + "tableFrom": "categories_to_games", + "tableTo": "categories", + "columnsFrom": [ + "category_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "categories_to_games_game_id_games_id_fk": { + "name": "categories_to_games_game_id_games_id_fk", + "tableFrom": "categories_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "categories_to_games_category_id_game_id_pk": { + "name": "categories_to_games_category_id_game_id_pk", + "columns": [ + "category_id", + "game_id" + ] + } + }, "uniqueConstraints": {} }, "collection_items": { @@ -150,34 +180,47 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "collection_id": { "name": "collection_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", + "times_played": { + "name": "times_played", + "type": "integer", "primaryKey": false, "notNull": false, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -211,7 +254,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "collection_items_cuid_unique": { + "name": "collection_items_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "collections": { "name": "collections", @@ -219,28 +270,34 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -261,77 +318,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers": { - "name": "designers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" + "uniqueConstraints": { + "collections_cuid_unique": { + "name": "collections_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers_to_games": { - "name": "designers_to_games", - "schema": "", - "columns": { - "designer_id": { - "name": "designer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} + } }, "expansions": { "name": "expansions", @@ -339,34 +334,40 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "base_game_id": { "name": "base_game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -382,8 +383,8 @@ "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onDelete": "restrict", + "onUpdate": "cascade" }, "expansions_game_id_games_id_fk": { "name": "expansions_game_id_games_id_fk", @@ -395,12 +396,62 @@ "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onDelete": "restrict", + "onUpdate": "cascade" } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "expansions_cuid_unique": { + "name": "expansions_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "external_ids": { + "name": "external_ids", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "external_id_type", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "external_ids_cuid_unique": { + "name": "external_ids_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "games": { "name": "games", @@ -408,19 +459,25 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, @@ -474,19 +531,19 @@ }, "image_url": { "name": "image_url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "thumb_url": { "name": "thumb_url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "url": { "name": "url", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, @@ -496,12 +553,6 @@ "primaryKey": false, "notNull": false }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, "last_sync_at": { "name": "last_sync_at", "type": "timestamp (6) with time zone", @@ -510,16 +561,16 @@ }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -535,61 +586,183 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { - "games_external_id_unique": { - "name": "games_external_id_unique", + "games_cuid_unique": { + "name": "games_cuid_unique", "nullsNotDistinct": false, "columns": [ - "external_id" + "cuid" ] } } }, + "games_to_external_ids": { + "name": "games_to_external_ids", + "schema": "", + "columns": { + "game_id": { + "name": "game_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "games_to_external_ids_game_id_games_id_fk": { + "name": "games_to_external_ids_game_id_games_id_fk", + "tableFrom": "games_to_external_ids", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "games_to_external_ids_external_id_external_ids_id_fk": { + "name": "games_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "games_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "games_to_external_ids_game_id_external_id_pk": { + "name": "games_to_external_ids_game_id_external_id_pk", + "columns": [ + "game_id", + "external_id" + ] + } + }, + "uniqueConstraints": {} + }, "mechanics": { "name": "mechanics", "schema": "", "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mechanics_cuid_unique": { + "name": "mechanics_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "mechanics_to_external_ids": { + "name": "mechanics_to_external_ids", + "schema": "", + "columns": { + "mechanic_id": { + "name": "mechanic_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { + "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", + "tableFrom": "mechanics_to_external_ids", + "tableTo": "mechanics", + "columnsFrom": [ + "mechanic_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "mechanics_to_external_ids_external_id_external_ids_id_fk": { + "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "mechanics_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "mechanics_to_external_ids_mechanic_id_external_id_pk": { + "name": "mechanics_to_external_ids_mechanic_id_external_id_pk", + "columns": [ + "mechanic_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "mechanics_to_games": { @@ -598,19 +771,103 @@ "columns": { "mechanic_id": { "name": "mechanic_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, + "foreignKeys": { + "mechanics_to_games_mechanic_id_mechanics_id_fk": { + "name": "mechanics_to_games_mechanic_id_mechanics_id_fk", + "tableFrom": "mechanics_to_games", + "tableTo": "mechanics", + "columnsFrom": [ + "mechanic_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "mechanics_to_games_game_id_games_id_fk": { + "name": "mechanics_to_games_game_id_games_id_fk", + "tableFrom": "mechanics_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "mechanics_to_games_mechanic_id_game_id_pk": { + "name": "mechanics_to_games_mechanic_id_game_id_pk", + "columns": [ + "mechanic_id", + "game_id" + ] + } + }, + "uniqueConstraints": {} + }, + "password_reset_tokens": { + "name": "password_reset_tokens", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "password_reset_tokens_user_id_users_id_fk": { + "name": "password_reset_tokens_user_id_users_id_fk", + "tableFrom": "password_reset_tokens", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, @@ -620,46 +877,111 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "slug": { "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, + "uniqueConstraints": { + "publishers_cuid_unique": { + "name": "publishers_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + }, + "publishers_to_external_ids": { + "name": "publishers_to_external_ids", + "schema": "", + "columns": { + "publisher_id": { + "name": "publisher_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "external_id": { + "name": "external_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "publishers_to_external_ids_publisher_id_publishers_id_fk": { + "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", + "tableFrom": "publishers_to_external_ids", + "tableTo": "publishers", + "columnsFrom": [ + "publisher_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "publishers_to_external_ids_external_id_external_ids_id_fk": { + "name": "publishers_to_external_ids_external_id_external_ids_id_fk", + "tableFrom": "publishers_to_external_ids", + "tableTo": "external_ids", + "columnsFrom": [ + "external_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "publishers_to_external_ids_publisher_id_external_id_pk": { + "name": "publishers_to_external_ids_publisher_id_external_id_pk", + "columns": [ + "publisher_id", + "external_id" + ] + } + }, "uniqueConstraints": {} }, "publishers_to_games": { @@ -668,20 +990,55 @@ "columns": { "publisher_id": { "name": "publisher_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, - "notNull": false + "notNull": true } }, "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, + "foreignKeys": { + "publishers_to_games_publisher_id_publishers_id_fk": { + "name": "publishers_to_games_publisher_id_publishers_id_fk", + "tableFrom": "publishers_to_games", + "tableTo": "publishers", + "columnsFrom": [ + "publisher_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "publishers_to_games_game_id_games_id_fk": { + "name": "publishers_to_games_game_id_games_id_fk", + "tableFrom": "publishers_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "publishers_to_games_publisher_id_game_id_pk": { + "name": "publishers_to_games_publisher_id_game_id_pk", + "columns": [ + "publisher_id", + "game_id" + ] + } + }, "uniqueConstraints": {} }, "roles": { @@ -690,13 +1047,19 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "name": { "name": "name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false } @@ -705,6 +1068,13 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "roles_cuid_unique": { + "name": "roles_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, "roles_name_unique": { "name": "roles_name_unique", "nullsNotDistinct": false, @@ -720,13 +1090,13 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, @@ -738,13 +1108,13 @@ }, "ip_country": { "name": "ip_country", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "ip_address": { "name": "ip_address", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false } @@ -774,34 +1144,40 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "role_id": { "name": "role_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -835,7 +1211,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "user_roles_cuid_unique": { + "name": "user_roles_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "users": { "name": "users", @@ -843,37 +1227,43 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "username": { "name": "username", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "hashed_password": { "name": "hashed_password", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "email": { "name": "email", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "first_name": { "name": "first_name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, "last_name": { "name": "last_name", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false }, @@ -893,7 +1283,7 @@ }, "theme": { "name": "theme", - "type": "varchar(255)", + "type": "text", "primaryKey": false, "notNull": false, "default": "'system'" @@ -902,14 +1292,14 @@ "name": "created_at", "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -917,6 +1307,13 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "users_cuid_unique": { + "name": "users_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, "users_username_unique": { "name": "users_username_unique", "nullsNotDistinct": false, @@ -939,34 +1336,40 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "wishlist_id": { "name": "wishlist_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -1000,7 +1403,15 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "wishlist_items_cuid_unique": { + "name": "wishlist_items_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } }, "wishlists": { "name": "wishlists", @@ -1008,28 +1419,34 @@ "columns": { "id": { "name": "id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": true, "notNull": true }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, "user_id": { "name": "user_id", - "type": "varchar(255)", + "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp (6) with time zone", + "type": "timestamp", "primaryKey": false, - "notNull": false, + "notNull": true, "default": "now()" } }, @@ -1050,10 +1467,30 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "wishlists_cuid_unique": { + "name": "wishlists_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + } + } + } + }, + "enums": { + "external_id_type": { + "name": "external_id_type", + "values": { + "game": "game", + "category": "category", + "mechanic": "mechanic", + "publisher": "publisher", + "designer": "designer", + "artist": "artist" + } } }, - "enums": {}, "schemas": {}, "_meta": { "columns": {}, diff --git a/drizzle/meta/0004_snapshot.json b/drizzle/meta/0004_snapshot.json deleted file mode 100644 index bc86d53..0000000 --- a/drizzle/meta/0004_snapshot.json +++ /dev/null @@ -1,1138 +0,0 @@ -{ - "id": "40c111ed-60fd-4ca8-88df-7617bff20155", - "prevId": "425a2ccd-b74a-4e51-8c80-1a6387cc6c5d", - "version": "5", - "dialect": "pg", - "tables": { - "artists": { - "name": "artists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "artists_to_games": { - "name": "artists_to_games", - "schema": "", - "columns": { - "artist_id": { - "name": "artist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers": { - "name": "designers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers_to_games": { - "name": "designers_to_games", - "schema": "", - "columns": { - "designer_id": { - "name": "designer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "game_external_ids": { - "name": "game_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "game_external_ids_game_id_games_id_fk": { - "name": "game_external_ids_game_id_games_id_fk", - "tableFrom": "game_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "game_external_ids_external_id_external_ids_id_fk": { - "name": "game_external_ids_external_id_external_ids_id_fk", - "tableFrom": "game_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ 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 af293b8..0000000 --- a/drizzle/meta/0005_snapshot.json +++ /dev/null @@ -1,1138 +0,0 @@ -{ - "id": "a7cae337-1c11-4c7f-b15f-45ceb42c7256", - "prevId": "40c111ed-60fd-4ca8-88df-7617bff20155", - "version": "5", - "dialect": "pg", - "tables": { - "artists": { - "name": "artists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "artists_to_games": { - "name": "artists_to_games", - "schema": "", - "columns": { - "artist_id": { - "name": "artist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers": { - "name": "designers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers_to_games": { - "name": "designers_to_games", - "schema": "", - "columns": { - "designer_id": { - "name": "designer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ 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 bd720da..0000000 --- a/drizzle/meta/0006_snapshot.json +++ /dev/null @@ -1,1138 +0,0 @@ -{ - "id": "713ce980-a770-4f82-8414-a7bd9923262e", - "prevId": "a7cae337-1c11-4c7f-b15f-45ceb42c7256", - "version": "5", - "dialect": "pg", - "tables": { - "artists": { - "name": "artists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "artists_to_games": { - "name": "artists_to_games", - "schema": "", - "columns": { - "artist_id": { - "name": "artist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers": { - "name": "designers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "designers_to_games": { - "name": "designers_to_games", - "schema": "", - "columns": { - "designer_id": { - "name": "designer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ 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 f4c3326..0000000 --- a/drizzle/meta/0007_snapshot.json +++ /dev/null @@ -1,1194 +0,0 @@ -{ - "id": "8dc4605d-a330-4ccb-950d-d5f1471d9ab8", - "prevId": "713ce980-a770-4f82-8414-a7bd9923262e", - "version": "5", - "dialect": "pg", - "tables": { - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_external_ids": { - "name": "categories_to_external_ids", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_external_ids_category_id_categories_id_fk": { - "name": "categories_to_external_ids_category_id_categories_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "categories_to_external_ids_external_id_external_ids_id_fk": { - "name": "categories_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions_to_external_ids": { - "name": "expansions_to_external_ids", - "schema": "", - "columns": { - "expansion_id": { - "name": "expansion_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_to_external_ids_expansion_id_expansions_id_fk": { - "name": "expansions_to_external_ids_expansion_id_expansions_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "expansions", - "columnsFrom": [ - "expansion_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_to_external_ids_external_id_external_ids_id_fk": { - "name": "expansions_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_external_ids": { - "name": "mechanics_to_external_ids", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "mechanics_to_external_ids_external_id_external_ids_id_fk": { - "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_external_ids": { - "name": "publishers_to_external_ids", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_external_ids_publisher_id_publishers_id_fk": { - "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "publishers_to_external_ids_external_id_external_ids_id_fk": { - "name": "publishers_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ 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 1592db1..0000000 --- a/drizzle/meta/0008_snapshot.json +++ /dev/null @@ -1,1194 +0,0 @@ -{ - "id": "59566a68-510c-4b15-9ce5-7ee99b685378", - "prevId": "8dc4605d-a330-4ccb-950d-d5f1471d9ab8", - "version": "5", - "dialect": "pg", - "tables": { - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_external_ids": { - "name": "categories_to_external_ids", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_external_ids_category_id_categories_id_fk": { - "name": "categories_to_external_ids_category_id_categories_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "categories_to_external_ids_external_id_external_ids_id_fk": { - "name": "categories_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions_to_external_ids": { - "name": "expansions_to_external_ids", - "schema": "", - "columns": { - "expansion_id": { - "name": "expansion_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_to_external_ids_expansion_id_expansions_id_fk": { - "name": "expansions_to_external_ids_expansion_id_expansions_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "expansions", - "columnsFrom": [ - "expansion_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_to_external_ids_external_id_external_ids_id_fk": { - "name": "expansions_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "type", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_external_ids": { - "name": "mechanics_to_external_ids", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "mechanics_to_external_ids_external_id_external_ids_id_fk": { - "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_external_ids": { - "name": "publishers_to_external_ids", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_external_ids_publisher_id_publishers_id_fk": { - "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "publishers_to_external_ids_external_id_external_ids_id_fk": { - "name": "publishers_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "type": { - "name": "type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ 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 8b7a36b..0000000 --- a/drizzle/meta/0009_snapshot.json +++ /dev/null @@ -1,1194 +0,0 @@ -{ - "id": "5d25f562-1d4b-4274-84ea-6d15dcf7fd74", - "prevId": "59566a68-510c-4b15-9ce5-7ee99b685378", - "version": "5", - "dialect": "pg", - "tables": { - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_external_ids": { - "name": "categories_to_external_ids", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_external_ids_category_id_categories_id_fk": { - "name": "categories_to_external_ids_category_id_categories_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "categories_to_external_ids_external_id_external_ids_id_fk": { - "name": "categories_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions_to_external_ids": { - "name": "expansions_to_external_ids", - "schema": "", - "columns": { - "expansion_id": { - "name": "expansion_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_to_external_ids_expansion_id_expansions_id_fk": { - "name": "expansions_to_external_ids_expansion_id_expansions_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "expansions", - "columnsFrom": [ - "expansion_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_to_external_ids_external_id_external_ids_id_fk": { - "name": "expansions_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "external_id_type", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_external_ids": { - "name": "mechanics_to_external_ids", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "mechanics_to_external_ids_external_id_external_ids_id_fk": { - "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_external_ids": { - "name": "publishers_to_external_ids", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_external_ids_publisher_id_publishers_id_fk": { - "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "publishers_to_external_ids_external_id_external_ids_id_fk": { - "name": "publishers_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0010_snapshot.json b/drizzle/meta/0010_snapshot.json deleted file mode 100644 index 3f16465..0000000 --- a/drizzle/meta/0010_snapshot.json +++ /dev/null @@ -1,1201 +0,0 @@ -{ - "id": "cc27c22a-1208-4b61-b2b1-07f09147fde3", - "prevId": "5d25f562-1d4b-4274-84ea-6d15dcf7fd74", - "version": "5", - "dialect": "pg", - "tables": { - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_external_ids": { - "name": "categories_to_external_ids", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_external_ids_category_id_categories_id_fk": { - "name": "categories_to_external_ids_category_id_categories_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "categories_to_external_ids_external_id_external_ids_id_fk": { - "name": "categories_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "times_played": { - "name": "times_played", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions_to_external_ids": { - "name": "expansions_to_external_ids", - "schema": "", - "columns": { - "expansion_id": { - "name": "expansion_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_to_external_ids_expansion_id_expansions_id_fk": { - "name": "expansions_to_external_ids_expansion_id_expansions_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "expansions", - "columnsFrom": [ - "expansion_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "expansions_to_external_ids_external_id_external_ids_id_fk": { - "name": "expansions_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "external_id_type", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_external_ids": { - "name": "mechanics_to_external_ids", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "mechanics_to_external_ids_external_id_external_ids_id_fk": { - "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_external_ids": { - "name": "publishers_to_external_ids", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_external_ids_publisher_id_publishers_id_fk": { - "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "publishers_to_external_ids_external_id_external_ids_id_fk": { - "name": "publishers_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0011_snapshot.json b/drizzle/meta/0011_snapshot.json deleted file mode 100644 index d87bab7..0000000 --- a/drizzle/meta/0011_snapshot.json +++ /dev/null @@ -1,1346 +0,0 @@ -{ - "id": "e0ba3399-0ff3-4e9e-921f-3d6617354bc8", - "prevId": "cc27c22a-1208-4b61-b2b1-07f09147fde3", - "version": "5", - "dialect": "pg", - "tables": { - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_external_ids": { - "name": "categories_to_external_ids", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_external_ids_category_id_categories_id_fk": { - "name": "categories_to_external_ids_category_id_categories_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "categories_to_external_ids_external_id_external_ids_id_fk": { - "name": "categories_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "categories_to_external_ids_category_id_external_id_pk": { - "name": "categories_to_external_ids_category_id_external_id_pk", - "columns": [ - "category_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_games_category_id_categories_id_fk": { - "name": "categories_to_games_category_id_categories_id_fk", - "tableFrom": "categories_to_games", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "categories_to_games_game_id_games_id_fk": { - "name": "categories_to_games_game_id_games_id_fk", - "tableFrom": "categories_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "categories_to_games_category_id_game_id_pk": { - "name": "categories_to_games_category_id_game_id_pk", - "columns": [ - "category_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "times_played": { - "name": "times_played", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions_to_external_ids": { - "name": "expansions_to_external_ids", - "schema": "", - "columns": { - "expansion_id": { - "name": "expansion_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_to_external_ids_expansion_id_expansions_id_fk": { - "name": "expansions_to_external_ids_expansion_id_expansions_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "expansions", - "columnsFrom": [ - "expansion_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "expansions_to_external_ids_external_id_external_ids_id_fk": { - "name": "expansions_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "expansions_to_external_ids_expansion_id_external_id_pk": { - "name": "expansions_to_external_ids_expansion_id_external_id_pk", - "columns": [ - "expansion_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "external_id_type", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "games_to_external_ids_game_id_external_id_pk": { - "name": "games_to_external_ids_game_id_external_id_pk", - "columns": [ - "game_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_external_ids": { - "name": "mechanics_to_external_ids", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "mechanics_to_external_ids_external_id_external_ids_id_fk": { - "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "mechanics_to_external_ids_mechanic_id_external_id_pk": { - "name": "mechanics_to_external_ids_mechanic_id_external_id_pk", - "columns": [ - "mechanic_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_games_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_games_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_games", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "mechanics_to_games_game_id_games_id_fk": { - "name": "mechanics_to_games_game_id_games_id_fk", - "tableFrom": "mechanics_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "mechanics_to_games_mechanic_id_game_id_pk": { - "name": "mechanics_to_games_mechanic_id_game_id_pk", - "columns": [ - "mechanic_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_external_ids": { - "name": "publishers_to_external_ids", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_external_ids_publisher_id_publishers_id_fk": { - "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "publishers_to_external_ids_external_id_external_ids_id_fk": { - "name": "publishers_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "publishers_to_external_ids_publisher_id_external_id_pk": { - "name": "publishers_to_external_ids_publisher_id_external_id_pk", - "columns": [ - "publisher_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_games_publisher_id_publishers_id_fk": { - "name": "publishers_to_games_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_games", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "publishers_to_games_game_id_games_id_fk": { - "name": "publishers_to_games_game_id_games_id_fk", - "tableFrom": "publishers_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "publishers_to_games_publisher_id_game_id_pk": { - "name": "publishers_to_games_publisher_id_game_id_pk", - "columns": [ - "publisher_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0012_snapshot.json b/drizzle/meta/0012_snapshot.json deleted file mode 100644 index 93d28fa..0000000 --- a/drizzle/meta/0012_snapshot.json +++ /dev/null @@ -1,1346 +0,0 @@ -{ - "id": "58f18282-0b26-4fee-a68d-08867b5729df", - "prevId": "e0ba3399-0ff3-4e9e-921f-3d6617354bc8", - "version": "5", - "dialect": "pg", - "tables": { - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_external_ids": { - "name": "categories_to_external_ids", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_external_ids_category_id_categories_id_fk": { - "name": "categories_to_external_ids_category_id_categories_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "categories_to_external_ids_external_id_external_ids_id_fk": { - "name": "categories_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "categories_to_external_ids_category_id_external_id_pk": { - "name": "categories_to_external_ids_category_id_external_id_pk", - "columns": [ - "category_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_games_category_id_categories_id_fk": { - "name": "categories_to_games_category_id_categories_id_fk", - "tableFrom": "categories_to_games", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "categories_to_games_game_id_games_id_fk": { - "name": "categories_to_games_game_id_games_id_fk", - "tableFrom": "categories_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "categories_to_games_category_id_game_id_pk": { - "name": "categories_to_games_category_id_game_id_pk", - "columns": [ - "category_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "times_played": { - "name": "times_played", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions_to_external_ids": { - "name": "expansions_to_external_ids", - "schema": "", - "columns": { - "expansion_id": { - "name": "expansion_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_to_external_ids_expansion_id_expansions_id_fk": { - "name": "expansions_to_external_ids_expansion_id_expansions_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "expansions", - "columnsFrom": [ - "expansion_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "expansions_to_external_ids_external_id_external_ids_id_fk": { - "name": "expansions_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "expansions_to_external_ids_expansion_id_external_id_pk": { - "name": "expansions_to_external_ids_expansion_id_external_id_pk", - "columns": [ - "expansion_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "external_id_type", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "games_to_external_ids_game_id_external_id_pk": { - "name": "games_to_external_ids_game_id_external_id_pk", - "columns": [ - "game_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_external_ids": { - "name": "mechanics_to_external_ids", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "mechanics_to_external_ids_external_id_external_ids_id_fk": { - "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "mechanics_to_external_ids_mechanic_id_external_id_pk": { - "name": "mechanics_to_external_ids_mechanic_id_external_id_pk", - "columns": [ - "mechanic_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_games_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_games_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_games", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "mechanics_to_games_game_id_games_id_fk": { - "name": "mechanics_to_games_game_id_games_id_fk", - "tableFrom": "mechanics_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "mechanics_to_games_mechanic_id_game_id_pk": { - "name": "mechanics_to_games_mechanic_id_game_id_pk", - "columns": [ - "mechanic_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "external_id": { - "name": "external_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_external_ids": { - "name": "publishers_to_external_ids", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_external_ids_publisher_id_publishers_id_fk": { - "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "publishers_to_external_ids_external_id_external_ids_id_fk": { - "name": "publishers_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "publishers_to_external_ids_publisher_id_external_id_pk": { - "name": "publishers_to_external_ids_publisher_id_external_id_pk", - "columns": [ - "publisher_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_games_publisher_id_publishers_id_fk": { - "name": "publishers_to_games_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_games", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "publishers_to_games_game_id_games_id_fk": { - "name": "publishers_to_games_game_id_games_id_fk", - "tableFrom": "publishers_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "publishers_to_games_publisher_id_game_id_pk": { - "name": "publishers_to_games_publisher_id_game_id_pk", - "columns": [ - "publisher_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0013_snapshot.json b/drizzle/meta/0013_snapshot.json deleted file mode 100644 index 6f8cea3..0000000 --- a/drizzle/meta/0013_snapshot.json +++ /dev/null @@ -1,1328 +0,0 @@ -{ - "id": "453ae1fd-7b1f-4256-8323-cdb2da05902a", - "prevId": "58f18282-0b26-4fee-a68d-08867b5729df", - "version": "5", - "dialect": "pg", - "tables": { - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_external_ids": { - "name": "categories_to_external_ids", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_external_ids_category_id_categories_id_fk": { - "name": "categories_to_external_ids_category_id_categories_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "categories_to_external_ids_external_id_external_ids_id_fk": { - "name": "categories_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "categories_to_external_ids_category_id_external_id_pk": { - "name": "categories_to_external_ids_category_id_external_id_pk", - "columns": [ - "category_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_games_category_id_categories_id_fk": { - "name": "categories_to_games_category_id_categories_id_fk", - "tableFrom": "categories_to_games", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "categories_to_games_game_id_games_id_fk": { - "name": "categories_to_games_game_id_games_id_fk", - "tableFrom": "categories_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "categories_to_games_category_id_game_id_pk": { - "name": "categories_to_games_category_id_game_id_pk", - "columns": [ - "category_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "times_played": { - "name": "times_played", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions_to_external_ids": { - "name": "expansions_to_external_ids", - "schema": "", - "columns": { - "expansion_id": { - "name": "expansion_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_to_external_ids_expansion_id_expansions_id_fk": { - "name": "expansions_to_external_ids_expansion_id_expansions_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "expansions", - "columnsFrom": [ - "expansion_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "expansions_to_external_ids_external_id_external_ids_id_fk": { - "name": "expansions_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "expansions_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "expansions_to_external_ids_expansion_id_external_id_pk": { - "name": "expansions_to_external_ids_expansion_id_external_id_pk", - "columns": [ - "expansion_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "external_id_type", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "games_to_external_ids_game_id_external_id_pk": { - "name": "games_to_external_ids_game_id_external_id_pk", - "columns": [ - "game_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_external_ids": { - "name": "mechanics_to_external_ids", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "mechanics_to_external_ids_external_id_external_ids_id_fk": { - "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "mechanics_to_external_ids_mechanic_id_external_id_pk": { - "name": "mechanics_to_external_ids_mechanic_id_external_id_pk", - "columns": [ - "mechanic_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_games_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_games_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_games", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "mechanics_to_games_game_id_games_id_fk": { - "name": "mechanics_to_games_game_id_games_id_fk", - "tableFrom": "mechanics_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "mechanics_to_games_mechanic_id_game_id_pk": { - "name": "mechanics_to_games_mechanic_id_game_id_pk", - "columns": [ - "mechanic_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_external_ids": { - "name": "publishers_to_external_ids", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_external_ids_publisher_id_publishers_id_fk": { - "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "publishers_to_external_ids_external_id_external_ids_id_fk": { - "name": "publishers_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "publishers_to_external_ids_publisher_id_external_id_pk": { - "name": "publishers_to_external_ids_publisher_id_external_id_pk", - "columns": [ - "publisher_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_games_publisher_id_publishers_id_fk": { - "name": "publishers_to_games_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_games", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "publishers_to_games_game_id_games_id_fk": { - "name": "publishers_to_games_game_id_games_id_fk", - "tableFrom": "publishers_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "publishers_to_games_publisher_id_game_id_pk": { - "name": "publishers_to_games_publisher_id_game_id_pk", - "columns": [ - "publisher_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0014_snapshot.json b/drizzle/meta/0014_snapshot.json deleted file mode 100644 index 8d11ec3..0000000 --- a/drizzle/meta/0014_snapshot.json +++ /dev/null @@ -1,1271 +0,0 @@ -{ - "id": "2743a62f-6523-44af-8c31-b69fe40c749f", - "prevId": "453ae1fd-7b1f-4256-8323-cdb2da05902a", - "version": "5", - "dialect": "pg", - "tables": { - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_external_ids": { - "name": "categories_to_external_ids", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_external_ids_category_id_categories_id_fk": { - "name": "categories_to_external_ids_category_id_categories_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "categories_to_external_ids_external_id_external_ids_id_fk": { - "name": "categories_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "categories_to_external_ids_category_id_external_id_pk": { - "name": "categories_to_external_ids_category_id_external_id_pk", - "columns": [ - "category_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_games_category_id_categories_id_fk": { - "name": "categories_to_games_category_id_categories_id_fk", - "tableFrom": "categories_to_games", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "categories_to_games_game_id_games_id_fk": { - "name": "categories_to_games_game_id_games_id_fk", - "tableFrom": "categories_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "categories_to_games_category_id_game_id_pk": { - "name": "categories_to_games_category_id_game_id_pk", - "columns": [ - "category_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "times_played": { - "name": "times_played", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "external_id_type", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "games_to_external_ids_game_id_external_id_pk": { - "name": "games_to_external_ids_game_id_external_id_pk", - "columns": [ - "game_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_external_ids": { - "name": "mechanics_to_external_ids", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "mechanics_to_external_ids_external_id_external_ids_id_fk": { - "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "mechanics_to_external_ids_mechanic_id_external_id_pk": { - "name": "mechanics_to_external_ids_mechanic_id_external_id_pk", - "columns": [ - "mechanic_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_games_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_games_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_games", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "mechanics_to_games_game_id_games_id_fk": { - "name": "mechanics_to_games_game_id_games_id_fk", - "tableFrom": "mechanics_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "mechanics_to_games_mechanic_id_game_id_pk": { - "name": "mechanics_to_games_mechanic_id_game_id_pk", - "columns": [ - "mechanic_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_external_ids": { - "name": "publishers_to_external_ids", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_external_ids_publisher_id_publishers_id_fk": { - "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "publishers_to_external_ids_external_id_external_ids_id_fk": { - "name": "publishers_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "publishers_to_external_ids_publisher_id_external_id_pk": { - "name": "publishers_to_external_ids_publisher_id_external_id_pk", - "columns": [ - "publisher_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_games_publisher_id_publishers_id_fk": { - "name": "publishers_to_games_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_games", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "publishers_to_games_game_id_games_id_fk": { - "name": "publishers_to_games_game_id_games_id_fk", - "tableFrom": "publishers_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "publishers_to_games_publisher_id_game_id_pk": { - "name": "publishers_to_games_publisher_id_game_id_pk", - "columns": [ - "publisher_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0015_snapshot.json b/drizzle/meta/0015_snapshot.json deleted file mode 100644 index 066805e..0000000 --- a/drizzle/meta/0015_snapshot.json +++ /dev/null @@ -1,1320 +0,0 @@ -{ - "id": "5922694c-19d2-4103-a9e4-487dc742753b", - "prevId": "2743a62f-6523-44af-8c31-b69fe40c749f", - "version": "5", - "dialect": "pg", - "tables": { - "categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "categories_to_external_ids": { - "name": "categories_to_external_ids", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_external_ids_category_id_categories_id_fk": { - "name": "categories_to_external_ids_category_id_categories_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "categories_to_external_ids_external_id_external_ids_id_fk": { - "name": "categories_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "categories_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "categories_to_external_ids_category_id_external_id_pk": { - "name": "categories_to_external_ids_category_id_external_id_pk", - "columns": [ - "category_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "categories_to_games_category_id_categories_id_fk": { - "name": "categories_to_games_category_id_categories_id_fk", - "tableFrom": "categories_to_games", - "tableTo": "categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "categories_to_games_game_id_games_id_fk": { - "name": "categories_to_games_game_id_games_id_fk", - "tableFrom": "categories_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "categories_to_games_category_id_game_id_pk": { - "name": "categories_to_games_category_id_game_id_pk", - "columns": [ - "category_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "collection_id": { - "name": "collection_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "times_played": { - "name": "times_played", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collection_items_collection_id_collections_id_fk": { - "name": "collection_items_collection_id_collections_id_fk", - "tableFrom": "collection_items", - "tableTo": "collections", - "columnsFrom": [ - "collection_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "collection_items_game_id_games_id_fk": { - "name": "collection_items_game_id_games_id_fk", - "tableFrom": "collection_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "collections_user_id_users_id_fk": { - "name": "collections_user_id_users_id_fk", - "tableFrom": "collections", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "base_game_id": { - "name": "base_game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "expansions_base_game_id_games_id_fk": { - "name": "expansions_base_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "base_game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "expansions_game_id_games_id_fk": { - "name": "expansions_game_id_games_id_fk", - "tableFrom": "expansions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "external_id_type", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "year_published": { - "name": "year_published", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_players": { - "name": "min_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_players": { - "name": "max_players", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "playtime": { - "name": "playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_playtime": { - "name": "min_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_playtime": { - "name": "max_playtime", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_age": { - "name": "min_age", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "text_searchable_index": { - "name": "text_searchable_index", - "type": "tsvector", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "text_searchable_idx": { - "name": "text_searchable_idx", - "columns": [ - "text_searchable_index" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "games_to_external_ids": { - "name": "games_to_external_ids", - "schema": "", - "columns": { - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "games_to_external_ids_game_id_games_id_fk": { - "name": "games_to_external_ids_game_id_games_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "games_to_external_ids_external_id_external_ids_id_fk": { - "name": "games_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "games_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "games_to_external_ids_game_id_external_id_pk": { - "name": "games_to_external_ids_game_id_external_id_pk", - "columns": [ - "game_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "mechanics_to_external_ids": { - "name": "mechanics_to_external_ids", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_external_ids_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_external_ids_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "mechanics_to_external_ids_external_id_external_ids_id_fk": { - "name": "mechanics_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "mechanics_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "mechanics_to_external_ids_mechanic_id_external_id_pk": { - "name": "mechanics_to_external_ids_mechanic_id_external_id_pk", - "columns": [ - "mechanic_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "mechanics_to_games_mechanic_id_mechanics_id_fk": { - "name": "mechanics_to_games_mechanic_id_mechanics_id_fk", - "tableFrom": "mechanics_to_games", - "tableTo": "mechanics", - "columnsFrom": [ - "mechanic_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "mechanics_to_games_game_id_games_id_fk": { - "name": "mechanics_to_games_game_id_games_id_fk", - "tableFrom": "mechanics_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "mechanics_to_games_mechanic_id_game_id_pk": { - "name": "mechanics_to_games_mechanic_id_game_id_pk", - "columns": [ - "mechanic_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "password_reset_tokens": { - "name": "password_reset_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_tokens_user_id_users_id_fk": { - "name": "password_reset_tokens_user_id_users_id_fk", - "tableFrom": "password_reset_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "publishers_to_external_ids": { - "name": "publishers_to_external_ids", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "external_id": { - "name": "external_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_external_ids_publisher_id_publishers_id_fk": { - "name": "publishers_to_external_ids_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "publishers_to_external_ids_external_id_external_ids_id_fk": { - "name": "publishers_to_external_ids_external_id_external_ids_id_fk", - "tableFrom": "publishers_to_external_ids", - "tableTo": "external_ids", - "columnsFrom": [ - "external_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "publishers_to_external_ids_publisher_id_external_id_pk": { - "name": "publishers_to_external_ids_publisher_id_external_id_pk", - "columns": [ - "publisher_id", - "external_id" - ] - } - }, - "uniqueConstraints": {} - }, - "publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "publishers_to_games_publisher_id_publishers_id_fk": { - "name": "publishers_to_games_publisher_id_publishers_id_fk", - "tableFrom": "publishers_to_games", - "tableTo": "publishers", - "columnsFrom": [ - "publisher_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - }, - "publishers_to_games_game_id_games_id_fk": { - "name": "publishers_to_games_game_id_games_id_fk", - "tableFrom": "publishers_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "publishers_to_games_publisher_id_game_id_pk": { - "name": "publishers_to_games_publisher_id_game_id_pk", - "columns": [ - "publisher_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "sessions": { - "name": "sessions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "verified": { - "name": "verified", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "receive_email": { - "name": "receive_email", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "theme": { - "name": "theme", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlist_items_wishlist_id_wishlists_id_fk": { - "name": "wishlist_items_wishlist_id_wishlists_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "wishlists", - "columnsFrom": [ - "wishlist_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "wishlist_items_game_id_games_id_fk": { - "name": "wishlist_items_game_id_games_id_fk", - "tableFrom": "wishlist_items", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (6) with time zone", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "wishlists_user_id_users_id_fk": { - "name": "wishlists_user_id_users_id_fk", - "tableFrom": "wishlists", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "external_id_type": { - "name": "external_id_type", - "values": { - "game": "game", - "category": "category", - "mechanic": "mechanic", - "publisher": "publisher", - "designer": "designer", - "artist": "artist" - } - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index 370dbcd..70be3e7 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -5,113 +5,29 @@ { "idx": 0, "version": "5", - "when": 1707437865821, - "tag": "0000_oval_wolverine", + "when": 1710268038944, + "tag": "0000_tricky_hitman", "breakpoints": true }, { "idx": 1, "version": "5", - "when": 1707438055782, - "tag": "0001_giant_tomorrow_man", + "when": 1710268191378, + "tag": "0001_numerous_dragon_man", "breakpoints": true }, { "idx": 2, "version": "5", - "when": 1707524139123, - "tag": "0002_sour_silverclaw", + "when": 1710268300740, + "tag": "0002_thick_lyja", "breakpoints": true }, { "idx": 3, "version": "5", - "when": 1707526808124, - "tag": "0003_thick_tinkerer", - "breakpoints": true - }, - { - "idx": 4, - "version": "5", - "when": 1707932397672, - "tag": "0004_fancy_umar", - "breakpoints": true - }, - { - "idx": 5, - "version": "5", - "when": 1707932466413, - "tag": "0005_uneven_lifeguard", - "breakpoints": true - }, - { - "idx": 6, - "version": "5", - "when": 1707932522909, - "tag": "0006_light_corsair", - "breakpoints": true - }, - { - "idx": 7, - "version": "5", - "when": 1707951501716, - "tag": "0007_same_valeria_richards", - "breakpoints": true - }, - { - "idx": 8, - "version": "5", - "when": 1708105454143, - "tag": "0008_complete_manta", - "breakpoints": true - }, - { - "idx": 9, - "version": "5", - "when": 1708105890146, - "tag": "0009_equal_christian_walker", - "breakpoints": true - }, - { - "idx": 10, - "version": "5", - "when": 1708243232524, - "tag": "0010_flat_mister_sinister", - "breakpoints": true - }, - { - "idx": 11, - "version": "5", - "when": 1708330668971, - "tag": "0011_gigantic_mister_sinister", - "breakpoints": true - }, - { - "idx": 12, - "version": "5", - "when": 1708330799655, - "tag": "0012_dizzy_lethal_legion", - "breakpoints": true - }, - { - "idx": 13, - "version": "5", - "when": 1708453431550, - "tag": "0013_clever_monster_badoon", - "breakpoints": true - }, - { - "idx": 14, - "version": "5", - "when": 1708479971410, - "tag": "0014_organic_morlocks", - "breakpoints": true - }, - { - "idx": 15, - "version": "5", - "when": 1709344835732, - "tag": "0015_awesome_gabe_jones", + "when": 1710268371021, + "tag": "0003_mushy_madame_masque", "breakpoints": true } ] diff --git a/package.json b/package.json index 2de44f3..8ab3649 100644 --- a/package.json +++ b/package.json @@ -22,15 +22,15 @@ }, "devDependencies": { "@melt-ui/pp": "^0.3.0", - "@melt-ui/svelte": "^0.75.3", - "@playwright/test": "^1.42.0", + "@melt-ui/svelte": "^0.76.0", + "@playwright/test": "^1.42.1", "@resvg/resvg-js": "^2.6.0", "@sveltejs/adapter-auto": "^3.1.1", "@sveltejs/enhanced-img": "^0.1.8", "@sveltejs/kit": "^2.5.3", "@sveltejs/vite-plugin-svelte": "^3.0.2", "@types/cookie": "^0.6.0", - "@types/node": "^20.11.25", + "@types/node": "^20.11.26", "@types/pg": "^8.11.2", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", @@ -64,7 +64,7 @@ "tslib": "^2.6.1", "tsx": "^4.7.1", "typescript": "^5.4.2", - "vite": "^5.1.5", + "vite": "^5.1.6", "vitest": "^1.3.1", "zod": "^3.22.4" }, @@ -83,10 +83,10 @@ "@paralleldrive/cuid2": "^2.2.2", "@planetscale/database": "^1.16.0", "@sentry/sveltekit": "^7.100.1", - "@sveltejs/adapter-vercel": "^5.1.0", + "@sveltejs/adapter-vercel": "^5.1.1", "@types/feather-icons": "^4.29.4", "@vercel/og": "^0.5.20", - "bits-ui": "^0.19.5", + "bits-ui": "^0.19.6", "boardgamegeekclient": "^1.9.1", "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", @@ -99,9 +99,7 @@ "just-kebab-case": "^4.2.0", "loader": "^2.1.1", "lucia": "3.1.1", - "lucide-svelte": "^0.354.0", - "mysql2": "^3.9.2", - "nanoid": "^5.0.6", + "lucide-svelte": "^0.356.0", "open-props": "^1.6.21", "oslo": "^1.1.3", "pg": "^8.11.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2592c49..88e7bfa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ dependencies: specifier: ^7.100.1 version: 7.100.1(@sveltejs/kit@2.5.3)(svelte@4.2.12) '@sveltejs/adapter-vercel': - specifier: ^5.1.0 - version: 5.1.0(@sveltejs/kit@2.5.3) + specifier: ^5.1.1 + version: 5.1.1(@sveltejs/kit@2.5.3) '@types/feather-icons': specifier: ^4.29.4 version: 4.29.4 @@ -42,8 +42,8 @@ dependencies: specifier: ^0.5.20 version: 0.5.20 bits-ui: - specifier: ^0.19.5 - version: 0.19.5(svelte@4.2.12) + specifier: ^0.19.6 + version: 0.19.6(svelte@4.2.12) boardgamegeekclient: specifier: ^1.9.1 version: 1.9.1 @@ -58,7 +58,7 @@ dependencies: version: 0.6.0 drizzle-orm: specifier: ^0.30.1 - version: 0.30.1(@neondatabase/serverless@0.9.0)(@planetscale/database@1.16.0)(@types/pg@8.11.2)(mysql2@3.9.2)(pg@8.11.3)(postgres@3.4.3) + version: 0.30.1(@neondatabase/serverless@0.9.0)(@planetscale/database@1.16.0)(@types/pg@8.11.2)(pg@8.11.3)(postgres@3.4.3) feather-icons: specifier: ^4.29.1 version: 4.29.1 @@ -81,14 +81,8 @@ dependencies: specifier: 3.1.1 version: 3.1.1 lucide-svelte: - specifier: ^0.354.0 - version: 0.354.0(svelte@4.2.12) - mysql2: - specifier: ^3.9.2 - version: 3.9.2 - nanoid: - specifier: ^5.0.6 - version: 5.0.6 + specifier: ^0.356.0 + version: 0.356.0(svelte@4.2.12) open-props: specifier: ^1.6.21 version: 1.6.21 @@ -126,13 +120,13 @@ dependencies: devDependencies: '@melt-ui/pp': specifier: ^0.3.0 - version: 0.3.0(@melt-ui/svelte@0.75.3)(svelte@4.2.12) + version: 0.3.0(@melt-ui/svelte@0.76.0)(svelte@4.2.12) '@melt-ui/svelte': - specifier: ^0.75.3 - version: 0.75.3(svelte@4.2.12) + specifier: ^0.76.0 + version: 0.76.0(svelte@4.2.12) '@playwright/test': - specifier: ^1.42.0 - version: 1.42.0 + specifier: ^1.42.1 + version: 1.42.1 '@resvg/resvg-js': specifier: ^2.6.0 version: 2.6.0 @@ -144,16 +138,16 @@ devDependencies: version: 0.1.8(svelte@4.2.12) '@sveltejs/kit': specifier: ^2.5.3 - version: 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.5) + version: 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6) '@sveltejs/vite-plugin-svelte': specifier: ^3.0.2 - version: 3.0.2(svelte@4.2.12)(vite@5.1.5) + version: 3.0.2(svelte@4.2.12)(vite@5.1.6) '@types/cookie': specifier: ^0.6.0 version: 0.6.0 '@types/node': - specifier: ^20.11.25 - version: 20.11.25 + specifier: ^20.11.26 + version: 20.11.26 '@types/pg': specifier: ^8.11.2 version: 8.11.2 @@ -243,7 +237,7 @@ devDependencies: version: 3.4.1(ts-node@10.9.2) ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@20.11.25)(typescript@5.4.2) + version: 10.9.2(@types/node@20.11.26)(typescript@5.4.2) tslib: specifier: ^2.6.1 version: 2.6.2 @@ -254,11 +248,11 @@ devDependencies: specifier: ^5.4.2 version: 5.4.2 vite: - specifier: ^5.1.5 - version: 5.1.5(@types/node@20.11.25)(sass@1.71.1) + specifier: ^5.1.6 + version: 5.1.6(@types/node@20.11.26)(sass@1.71.1) vitest: specifier: ^1.3.1 - version: 1.3.1(@types/node@20.11.25)(sass@1.71.1) + version: 1.3.1(@types/node@20.11.26)(sass@1.71.1) zod: specifier: ^3.22.4 version: 3.22.4 @@ -787,6 +781,7 @@ packages: cpu: [ppc64] os: [aix] requiresBuild: true + dev: true optional: true /@esbuild/aix-ppc64@0.19.12: @@ -820,6 +815,7 @@ packages: cpu: [arm64] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-arm64@0.19.12: @@ -853,6 +849,7 @@ packages: cpu: [arm] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-arm@0.19.12: @@ -886,6 +883,7 @@ packages: cpu: [x64] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-x64@0.19.12: @@ -919,6 +917,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: true optional: true /@esbuild/darwin-arm64@0.19.12: @@ -952,6 +951,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: true optional: true /@esbuild/darwin-x64@0.19.12: @@ -985,6 +985,7 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: true optional: true /@esbuild/freebsd-arm64@0.19.12: @@ -1018,6 +1019,7 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: true optional: true /@esbuild/freebsd-x64@0.19.12: @@ -1051,6 +1053,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-arm64@0.19.12: @@ -1084,6 +1087,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-arm@0.19.12: @@ -1117,6 +1121,7 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-ia32@0.19.12: @@ -1150,6 +1155,7 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-loong64@0.19.12: @@ -1183,6 +1189,7 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-mips64el@0.19.12: @@ -1216,6 +1223,7 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-ppc64@0.19.12: @@ -1249,6 +1257,7 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-riscv64@0.19.12: @@ -1282,6 +1291,7 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-s390x@0.19.12: @@ -1315,6 +1325,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-x64@0.19.12: @@ -1348,6 +1359,7 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true + dev: true optional: true /@esbuild/netbsd-x64@0.19.12: @@ -1381,6 +1393,7 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: true optional: true /@esbuild/openbsd-x64@0.19.12: @@ -1414,6 +1427,7 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: true optional: true /@esbuild/sunos-x64@0.19.12: @@ -1447,6 +1461,7 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-arm64@0.19.12: @@ -1480,6 +1495,7 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-ia32@0.19.12: @@ -1513,6 +1529,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-x64@0.19.12: @@ -1958,28 +1975,28 @@ packages: nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.5.4 + semver: 7.6.0 tar: 6.2.0 transitivePeerDependencies: - encoding - supports-color dev: false - /@melt-ui/pp@0.3.0(@melt-ui/svelte@0.75.3)(svelte@4.2.12): + /@melt-ui/pp@0.3.0(@melt-ui/svelte@0.76.0)(svelte@4.2.12): resolution: {integrity: sha512-b07Bdh8l2KcwKVCXOY+SoBw1dk9eWvQfMSi6SoacpRVyVmmfpi0kV4oGt3HYF0tUCB3sEmVicxse50ZzZxEzEA==} engines: {pnpm: '>=8.6.3'} peerDependencies: '@melt-ui/svelte': '>= 0.29.0' svelte: ^3.55.0 || ^4.0.0 || ^5.0.0-next.1 dependencies: - '@melt-ui/svelte': 0.75.3(svelte@4.2.12) + '@melt-ui/svelte': 0.76.0(svelte@4.2.12) estree-walker: 3.0.3 magic-string: 0.30.5 svelte: 4.2.12 dev: true - /@melt-ui/svelte@0.75.3(svelte@4.2.12): - resolution: {integrity: sha512-EA2IKn7w9qtzO/M7VEENpphQ9A4az+QDMQbA8SJLuKyu+S8NWliln5y9vvmnx9dZF8GtKtUKuxpwRNyPg5LAOg==} + /@melt-ui/svelte@0.76.0(svelte@4.2.12): + resolution: {integrity: sha512-X1ktxKujjLjOBt8LBvfckHGDMrkHWceRt1jdsUTf0EH76ikNPP1ofSoiV0IhlduDoCBV+2YchJ8kXCDfDXfC9Q==} peerDependencies: svelte: '>=3 <5' dependencies: @@ -2635,12 +2652,12 @@ packages: engines: {node: '>=16'} dev: false - /@playwright/test@1.42.0: - resolution: {integrity: sha512-2k1HzC28Fs+HiwbJOQDUwrWMttqSLUVdjCqitBOjdCD0svWOMQUVqrXX6iFD7POps6xXAojsX/dGBpKnjZctLA==} + /@playwright/test@1.42.1: + resolution: {integrity: sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==} engines: {node: '>=16'} hasBin: true dependencies: - playwright: 1.42.0 + playwright: 1.42.1 dev: true /@polka/url@1.0.0-next.25: @@ -2805,92 +2822,92 @@ packages: picomatch: 2.3.1 dev: true - /@rollup/rollup-android-arm-eabi@4.12.0: - resolution: {integrity: sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==} + /@rollup/rollup-android-arm-eabi@4.12.1: + resolution: {integrity: sha512-iU2Sya8hNn1LhsYyf0N+L4Gf9Qc+9eBTJJJsaOGUp+7x4n2M9dxTt8UvhJl3oeftSjblSlpCfvjA/IfP3g5VjQ==} cpu: [arm] os: [android] requiresBuild: true optional: true - /@rollup/rollup-android-arm64@4.12.0: - resolution: {integrity: sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==} + /@rollup/rollup-android-arm64@4.12.1: + resolution: {integrity: sha512-wlzcWiH2Ir7rdMELxFE5vuM7D6TsOcJ2Yw0c3vaBR3VOsJFVTx9xvwnAvhgU5Ii8Gd6+I11qNHwndDscIm0HXg==} cpu: [arm64] os: [android] requiresBuild: true optional: true - /@rollup/rollup-darwin-arm64@4.12.0: - resolution: {integrity: sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==} + /@rollup/rollup-darwin-arm64@4.12.1: + resolution: {integrity: sha512-YRXa1+aZIFN5BaImK+84B3uNK8C6+ynKLPgvn29X9s0LTVCByp54TB7tdSMHDR7GTV39bz1lOmlLDuedgTwwHg==} cpu: [arm64] os: [darwin] requiresBuild: true optional: true - /@rollup/rollup-darwin-x64@4.12.0: - resolution: {integrity: sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==} + /@rollup/rollup-darwin-x64@4.12.1: + resolution: {integrity: sha512-opjWJ4MevxeA8FhlngQWPBOvVWYNPFkq6/25rGgG+KOy0r8clYwL1CFd+PGwRqqMFVQ4/Qd3sQu5t7ucP7C/Uw==} cpu: [x64] os: [darwin] requiresBuild: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.12.0: - resolution: {integrity: sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==} + /@rollup/rollup-linux-arm-gnueabihf@4.12.1: + resolution: {integrity: sha512-uBkwaI+gBUlIe+EfbNnY5xNyXuhZbDSx2nzzW8tRMjUmpScd6lCQYKY2V9BATHtv5Ef2OBq6SChEP8h+/cxifQ==} cpu: [arm] os: [linux] requiresBuild: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.12.0: - resolution: {integrity: sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==} + /@rollup/rollup-linux-arm64-gnu@4.12.1: + resolution: {integrity: sha512-0bK9aG1kIg0Su7OcFTlexkVeNZ5IzEsnz1ept87a0TUgZ6HplSgkJAnFpEVRW7GRcikT4GlPV0pbtVedOaXHQQ==} cpu: [arm64] os: [linux] requiresBuild: true optional: true - /@rollup/rollup-linux-arm64-musl@4.12.0: - resolution: {integrity: sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==} + /@rollup/rollup-linux-arm64-musl@4.12.1: + resolution: {integrity: sha512-qB6AFRXuP8bdkBI4D7UPUbE7OQf7u5OL+R94JE42Z2Qjmyj74FtDdLGeriRyBDhm4rQSvqAGCGC01b8Fu2LthQ==} cpu: [arm64] os: [linux] requiresBuild: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.12.0: - resolution: {integrity: sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==} + /@rollup/rollup-linux-riscv64-gnu@4.12.1: + resolution: {integrity: sha512-sHig3LaGlpNgDj5o8uPEoGs98RII8HpNIqFtAI8/pYABO8i0nb1QzT0JDoXF/pxzqO+FkxvwkHZo9k0NJYDedg==} cpu: [riscv64] os: [linux] requiresBuild: true optional: true - /@rollup/rollup-linux-x64-gnu@4.12.0: - resolution: {integrity: sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==} + /@rollup/rollup-linux-x64-gnu@4.12.1: + resolution: {integrity: sha512-nD3YcUv6jBJbBNFvSbp0IV66+ba/1teuBcu+fBBPZ33sidxitc6ErhON3JNavaH8HlswhWMC3s5rgZpM4MtPqQ==} cpu: [x64] os: [linux] requiresBuild: true optional: true - /@rollup/rollup-linux-x64-musl@4.12.0: - resolution: {integrity: sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==} + /@rollup/rollup-linux-x64-musl@4.12.1: + resolution: {integrity: sha512-7/XVZqgBby2qp/cO0TQ8uJK+9xnSdJ9ct6gSDdEr4MfABrjTyrW6Bau7HQ73a2a5tPB7hno49A0y1jhWGDN9OQ==} cpu: [x64] os: [linux] requiresBuild: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.12.0: - resolution: {integrity: sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==} + /@rollup/rollup-win32-arm64-msvc@4.12.1: + resolution: {integrity: sha512-CYc64bnICG42UPL7TrhIwsJW4QcKkIt9gGlj21gq3VV0LL6XNb1yAdHVp1pIi9gkts9gGcT3OfUYHjGP7ETAiw==} cpu: [arm64] os: [win32] requiresBuild: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.12.0: - resolution: {integrity: sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==} + /@rollup/rollup-win32-ia32-msvc@4.12.1: + resolution: {integrity: sha512-LN+vnlZ9g0qlHGlS920GR4zFCqAwbv2lULrR29yGaWP9u7wF5L7GqWu9Ah6/kFZPXPUkpdZwd//TNR+9XC9hvA==} cpu: [ia32] os: [win32] requiresBuild: true optional: true - /@rollup/rollup-win32-x64-msvc@4.12.0: - resolution: {integrity: sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==} + /@rollup/rollup-win32-x64-msvc@4.12.1: + resolution: {integrity: sha512-n+vkrSyphvmU0qkQ6QBNXCGr2mKjhP08mPRM/Xp5Ck2FV4NrHU+y6axzDeixUrCBHVUS51TZhjqrKBBsHLKb2Q==} cpu: [x64] os: [win32] requiresBuild: true @@ -3053,7 +3070,7 @@ packages: '@sentry/types': 7.100.1 '@sentry/utils': 7.100.1 '@sentry/vite-plugin': 0.6.1 - '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.5) + '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6) magicast: 0.2.8 sorcery: 0.11.0 transitivePeerDependencies: @@ -3147,18 +3164,18 @@ packages: peerDependencies: '@sveltejs/kit': ^2.0.0 dependencies: - '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.5) + '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6) import-meta-resolve: 4.0.0 dev: true - /@sveltejs/adapter-vercel@5.1.0(@sveltejs/kit@2.5.3): - resolution: {integrity: sha512-Z9yRJ4H2/7LcBlvN2/TKu1H0hWoRGonr8kPhP1GJ23LRW76IbiiX5gs/MLc6+ZGogCZYVJ4USmx6m+RFtvQTRw==} + /@sveltejs/adapter-vercel@5.1.1(@sveltejs/kit@2.5.3): + resolution: {integrity: sha512-OBb4/she4MCat+topk8x2EHXX2qX3Ju3xGumHCDtVq4zLEZ3LEomhht79jO+7Q1qia2bKk9o6hYEO0JLZjv7XQ==} peerDependencies: '@sveltejs/kit': ^2.4.0 dependencies: - '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.5) - '@vercel/nft': 0.26.2 - esbuild: 0.19.11 + '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6) + '@vercel/nft': 0.26.4 + esbuild: 0.19.12 transitivePeerDependencies: - encoding - supports-color @@ -3175,7 +3192,7 @@ packages: - svelte dev: true - /@sveltejs/kit@2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.5): + /@sveltejs/kit@2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6): resolution: {integrity: sha512-s6x7HBn/Fp+UNvyhJohjIA0FcJ+BWHGUDQ4PCg1D0EboUlvbimJQYchINu8G6sspLXYmlcsuNsp8bbcrRk85iw==} engines: {node: '>=18.13'} hasBin: true @@ -3185,7 +3202,7 @@ packages: svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.3 dependencies: - '@sveltejs/vite-plugin-svelte': 3.0.2(svelte@4.2.12)(vite@5.1.5) + '@sveltejs/vite-plugin-svelte': 3.0.2(svelte@4.2.12)(vite@5.1.6) '@types/cookie': 0.6.0 cookie: 0.6.0 devalue: 4.3.2 @@ -3199,9 +3216,9 @@ packages: sirv: 2.0.4 svelte: 4.2.12 tiny-glob: 0.2.9 - vite: 5.1.5(@types/node@20.11.25)(sass@1.71.1) + vite: 5.1.6(@types/node@20.11.26)(sass@1.71.1) - /@sveltejs/vite-plugin-svelte-inspector@2.0.0(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.5): + /@sveltejs/vite-plugin-svelte-inspector@2.0.0(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6): resolution: {integrity: sha512-gjr9ZFg1BSlIpfZ4PRewigrvYmHWbDrq2uvvPB1AmTWKuM+dI1JXQSUu2pIrYLb/QncyiIGkFDFKTwJ0XqQZZg==} engines: {node: ^18.0.0 || >=20} peerDependencies: @@ -3209,29 +3226,29 @@ packages: svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.0 dependencies: - '@sveltejs/vite-plugin-svelte': 3.0.2(svelte@4.2.12)(vite@5.1.5) + '@sveltejs/vite-plugin-svelte': 3.0.2(svelte@4.2.12)(vite@5.1.6) debug: 4.3.4 svelte: 4.2.12 - vite: 5.1.5(@types/node@20.11.25)(sass@1.71.1) + vite: 5.1.6(@types/node@20.11.26)(sass@1.71.1) transitivePeerDependencies: - supports-color - /@sveltejs/vite-plugin-svelte@3.0.2(svelte@4.2.12)(vite@5.1.5): + /@sveltejs/vite-plugin-svelte@3.0.2(svelte@4.2.12)(vite@5.1.6): resolution: {integrity: sha512-MpmF/cju2HqUls50WyTHQBZUV3ovV/Uk8k66AN2gwHogNAG8wnW8xtZDhzNBsFJJuvmq1qnzA5kE7YfMJNFv2Q==} engines: {node: ^18.0.0 || >=20} peerDependencies: svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.0 dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.0.0(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.5) + '@sveltejs/vite-plugin-svelte-inspector': 2.0.0(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6) debug: 4.3.4 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.5 svelte: 4.2.12 svelte-hmr: 0.15.3(svelte@4.2.12) - vite: 5.1.5(@types/node@20.11.25)(sass@1.71.1) - vitefu: 0.2.5(vite@5.1.5) + vite: 5.1.6(@types/node@20.11.26)(sass@1.71.1) + vitefu: 0.2.5(vite@5.1.6) transitivePeerDependencies: - supports-color @@ -3273,22 +3290,22 @@ packages: /@types/json-schema@7.0.15: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - /@types/node@20.11.25: - resolution: {integrity: sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==} + /@types/node@20.11.26: + resolution: {integrity: sha512-YwOMmyhNnAWijOBQweOJnQPl068Oqd4K3OFbTc6AHJwzweUwwWG3GIFY74OKks2PJUDkQPeddOQES9mLn1CTEQ==} dependencies: undici-types: 5.26.5 /@types/pg@8.11.2: resolution: {integrity: sha512-G2Mjygf2jFMU/9hCaTYxJrwdObdcnuQde1gndooZSOHsNSaCehAuwc7EIuSA34Do8Jx2yZ19KtvW8P0j4EuUXw==} dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.26 pg-protocol: 1.6.0 pg-types: 4.0.2 /@types/pg@8.6.6: resolution: {integrity: sha512-O2xNmXebtwVekJDD+02udOncjVcMZQuTEQEMpKJ0ZRf5E7/9JJX3izhKUcUifBkyKpljyUM6BTgy2trmviKlpw==} dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.26 pg-protocol: 1.6.0 pg-types: 2.2.0 dev: false @@ -3442,8 +3459,8 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vercel/nft@0.26.2: - resolution: {integrity: sha512-bxe2iShmKZi7476xYamyKvhhKwQ6JPEtQ2FSq1AjMUH2buMd8LQMkdoHinTqZYc+1sMTh3G0ARdjzNvV1FEisA==} + /@vercel/nft@0.26.4: + resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} engines: {node: '>=16'} hasBin: true dependencies: @@ -3721,13 +3738,13 @@ packages: file-uri-to-path: 1.0.0 dev: false - /bits-ui@0.19.5(svelte@4.2.12): - resolution: {integrity: sha512-jrt0pGZdixtl27VrfzLj5yJxha29CK+6nClZZSoJCL5DlXFT1sluF9NnOSMP48D3kczR5YjpArvCe0BEnGq4jA==} + /bits-ui@0.19.6(svelte@4.2.12): + resolution: {integrity: sha512-ZKWHa1Vt8YW7DdooeNleVdtOtk9hxXZIo8El0myqn7r8S8OkJaSPXhQn/jp4/Q6BphYxZ2Tatqb/WLphmrSfUg==} peerDependencies: svelte: ^4.0.0 dependencies: '@internationalized/date': 3.5.2 - '@melt-ui/svelte': 0.75.3(svelte@4.2.12) + '@melt-ui/svelte': 0.76.0(svelte@4.2.12) nanoid: 5.0.6 svelte: 4.2.12 dev: false @@ -4129,11 +4146,6 @@ packages: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} dev: false - /denque@2.1.0: - resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} - engines: {node: '>=0.10'} - dev: false - /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} @@ -4219,7 +4231,7 @@ packages: - supports-color dev: true - /drizzle-orm@0.30.1(@neondatabase/serverless@0.9.0)(@planetscale/database@1.16.0)(@types/pg@8.11.2)(mysql2@3.9.2)(pg@8.11.3)(postgres@3.4.3): + /drizzle-orm@0.30.1(@neondatabase/serverless@0.9.0)(@planetscale/database@1.16.0)(@types/pg@8.11.2)(pg@8.11.3)(postgres@3.4.3): resolution: {integrity: sha512-5P6CXl4XyWtDDiYOX/jYOJp1HTUmBlXRAwaq+muUOgaSykMEy5sJesCxceMT0oCGvxeWkKfSXo5owLnfKwCIdw==} peerDependencies: '@aws-sdk/client-rds-data': '>=3' @@ -4296,7 +4308,6 @@ packages: '@neondatabase/serverless': 0.9.0 '@planetscale/database': 1.16.0 '@types/pg': 8.11.2 - mysql2: 3.9.2 pg: 8.11.3 postgres: 3.4.3 dev: false @@ -4435,6 +4446,7 @@ packages: '@esbuild/win32-arm64': 0.19.11 '@esbuild/win32-ia32': 0.19.11 '@esbuild/win32-x64': 0.19.11 + dev: true /esbuild@0.19.12: resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} @@ -4851,12 +4863,6 @@ packages: wide-align: 1.1.5 dev: false - /generate-function@2.3.1: - resolution: {integrity: sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==} - dependencies: - is-property: 1.0.2 - dev: false - /get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} dev: true @@ -5050,13 +5056,6 @@ packages: '@iconify/types': 2.0.0 dev: false - /iconv-lite@0.6.3: - resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} - engines: {node: '>=0.10.0'} - dependencies: - safer-buffer: 2.1.2 - dev: false - /ignore@5.3.0: resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} engines: {node: '>= 4'} @@ -5177,10 +5176,6 @@ packages: resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} dev: true - /is-property@1.0.2: - resolution: {integrity: sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==} - dev: false - /is-reference@3.0.2: resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} dependencies: @@ -5374,10 +5369,6 @@ packages: resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==} dev: true - /long@5.2.3: - resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==} - dev: false - /loupe@2.3.7: resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} dependencies: @@ -5395,16 +5386,6 @@ packages: dependencies: yallist: 4.0.0 - /lru-cache@7.18.3: - resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} - engines: {node: '>=12'} - dev: false - - /lru-cache@8.0.5: - resolution: {integrity: sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==} - engines: {node: '>=16.14'} - dev: false - /lru-queue@0.1.0: resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} dependencies: @@ -5417,8 +5398,8 @@ packages: oslo: 1.0.1 dev: false - /lucide-svelte@0.354.0(svelte@4.2.12): - resolution: {integrity: sha512-70SspM/VC9E9OLJj1Jg6IhF40vf22aanW9vhUvtBwORogK4TP2oTd27YkY/3zOgi/Y5OAEOU4ZYtLxsAiOHPjQ==} + /lucide-svelte@0.356.0(svelte@4.2.12): + resolution: {integrity: sha512-aUr+L9uJkRvT15egByH4KLPoIXh47fG7Dm03b4G1Dk2nfTDuuLebloUaBKUzFsBUcVrBKBje+L5/Xnz3OoUyCg==} peerDependencies: svelte: ^3 || ^4 || ^5.0.0-next.42 dependencies: @@ -5624,20 +5605,6 @@ packages: /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - /mysql2@3.9.2: - resolution: {integrity: sha512-3Cwg/UuRkAv/wm6RhtPE5L7JlPB877vwSF6gfLAS68H+zhH+u5oa3AieqEd0D0/kC3W7qIhYbH419f7O9i/5nw==} - engines: {node: '>= 8.0'} - dependencies: - denque: 2.1.0 - generate-function: 2.3.1 - iconv-lite: 0.6.3 - long: 5.2.3 - lru-cache: 8.0.5 - named-placeholders: 1.1.3 - seq-queue: 0.0.5 - sqlstring: 2.3.3 - dev: false - /mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} dependencies: @@ -5645,13 +5612,6 @@ packages: object-assign: 4.1.1 thenify-all: 1.6.0 - /named-placeholders@1.1.3: - resolution: {integrity: sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==} - engines: {node: '>=12.0.0'} - dependencies: - lru-cache: 7.18.3 - dev: false - /nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -5995,18 +5955,18 @@ packages: pathe: 1.1.2 dev: true - /playwright-core@1.42.0: - resolution: {integrity: sha512-0HD9y8qEVlcbsAjdpBaFjmaTHf+1FeIddy8VJLeiqwhcNqGCBe4Wp2e8knpqiYbzxtxarxiXyNDw2cG8sCaNMQ==} + /playwright-core@1.42.1: + resolution: {integrity: sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==} engines: {node: '>=16'} hasBin: true dev: true - /playwright@1.42.0: - resolution: {integrity: sha512-Ko7YRUgj5xBHbntrgt4EIw/nE//XBHOKVKnBjO1KuZkmkhlbgyggTe5s9hjqQ1LpN+Xg+kHsQyt5Pa0Bw5XpvQ==} + /playwright@1.42.1: + resolution: {integrity: sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==} engines: {node: '>=16'} hasBin: true dependencies: - playwright-core: 1.42.0 + playwright-core: 1.42.1 optionalDependencies: fsevents: 2.3.2 dev: true @@ -6237,7 +6197,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.35 - ts-node: 10.9.2(@types/node@20.11.25)(typescript@5.4.2) + ts-node: 10.9.2(@types/node@20.11.26)(typescript@5.4.2) yaml: 1.10.2 dev: true @@ -6255,7 +6215,7 @@ packages: dependencies: lilconfig: 3.0.0 postcss: 8.4.35 - ts-node: 10.9.2(@types/node@20.11.25)(typescript@5.4.2) + ts-node: 10.9.2(@types/node@20.11.26)(typescript@5.4.2) yaml: 2.3.4 /postcss-load-config@5.0.3(postcss@8.4.35): @@ -6676,26 +6636,26 @@ packages: dependencies: glob: 7.2.3 - /rollup@4.12.0: - resolution: {integrity: sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==} + /rollup@4.12.1: + resolution: {integrity: sha512-ggqQKvx/PsB0FaWXhIvVkSWh7a/PCLQAsMjBc+nA2M8Rv2/HG0X6zvixAB7KyZBRtifBUhy5k8voQX/mRnABPg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.12.0 - '@rollup/rollup-android-arm64': 4.12.0 - '@rollup/rollup-darwin-arm64': 4.12.0 - '@rollup/rollup-darwin-x64': 4.12.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.12.0 - '@rollup/rollup-linux-arm64-gnu': 4.12.0 - '@rollup/rollup-linux-arm64-musl': 4.12.0 - '@rollup/rollup-linux-riscv64-gnu': 4.12.0 - '@rollup/rollup-linux-x64-gnu': 4.12.0 - '@rollup/rollup-linux-x64-musl': 4.12.0 - '@rollup/rollup-win32-arm64-msvc': 4.12.0 - '@rollup/rollup-win32-ia32-msvc': 4.12.0 - '@rollup/rollup-win32-x64-msvc': 4.12.0 + '@rollup/rollup-android-arm-eabi': 4.12.1 + '@rollup/rollup-android-arm64': 4.12.1 + '@rollup/rollup-darwin-arm64': 4.12.1 + '@rollup/rollup-darwin-x64': 4.12.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.12.1 + '@rollup/rollup-linux-arm64-gnu': 4.12.1 + '@rollup/rollup-linux-arm64-musl': 4.12.1 + '@rollup/rollup-linux-riscv64-gnu': 4.12.1 + '@rollup/rollup-linux-x64-gnu': 4.12.1 + '@rollup/rollup-linux-x64-musl': 4.12.1 + '@rollup/rollup-win32-arm64-msvc': 4.12.1 + '@rollup/rollup-win32-ia32-msvc': 4.12.1 + '@rollup/rollup-win32-x64-msvc': 4.12.1 fsevents: 2.3.3 /run-parallel@1.2.0: @@ -6713,10 +6673,6 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: false - /safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - dev: false - /sander@0.5.1: resolution: {integrity: sha512-3lVqBir7WuKDHGrKRDn/1Ye3kwpXaDOMsiRP1wd6wpZW56gJhsbp5RqQpA6JG/P+pkXizygnr1dKR8vzWaVsfA==} dependencies: @@ -6791,6 +6747,7 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 + dev: true /semver@7.6.0: resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} @@ -6798,11 +6755,6 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 - dev: true - - /seq-queue@0.0.5: - resolution: {integrity: sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==} - dev: false /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} @@ -6927,11 +6879,6 @@ packages: engines: {node: '>= 10.x'} dev: false - /sqlstring@2.3.3: - resolution: {integrity: sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==} - engines: {node: '>= 0.6'} - dev: false - /stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} dev: true @@ -7011,8 +6958,8 @@ packages: copy-anything: 3.0.5 dev: true - /superstruct@1.0.3: - resolution: {integrity: sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg==} + /superstruct@1.0.4: + resolution: {integrity: sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==} engines: {node: '>=14.0.0'} requiresBuild: true optional: true @@ -7203,7 +7150,7 @@ packages: '@sveltejs/kit': 1.x || 2.x svelte: 3.x || 4.x || >=5.0.0-next.51 dependencies: - '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.5) + '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6) svelte: 4.2.12 dev: true @@ -7213,7 +7160,7 @@ packages: '@sveltejs/kit': 1.x || 2.x dependencies: '@isaacs/ttlcache': 1.4.1 - '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.5) + '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6) dev: true /sveltekit-superforms@2.8.1(@sveltejs/kit@2.5.3)(@types/json-schema@7.0.15)(esbuild-runner@2.2.2)(esbuild@0.20.1)(svelte@4.2.12): @@ -7222,7 +7169,7 @@ packages: '@sveltejs/kit': 1.x || 2.x svelte: 3.x || 4.x || >=5.0.0-next.51 dependencies: - '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.5) + '@sveltejs/kit': 2.5.3(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6) devalue: 4.3.2 just-clone: 6.2.0 memoize-weak: 1.0.2 @@ -7235,7 +7182,7 @@ packages: '@vinejs/vine': 1.7.1 arktype: 1.0.29-alpha joi: 17.12.2 - superstruct: 1.0.3 + superstruct: 1.0.4 valibot: 0.29.0 yup: 1.4.0 zod: 3.22.4 @@ -7413,7 +7360,7 @@ packages: /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - /ts-node@10.9.2(@types/node@20.11.25)(typescript@5.4.2): + /ts-node@10.9.2(@types/node@20.11.26)(typescript@5.4.2): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -7432,7 +7379,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.11.25 + '@types/node': 20.11.26 acorn: 8.11.2 acorn-walk: 8.3.0 arg: 4.1.3 @@ -7581,7 +7528,7 @@ packages: - rollup dev: true - /vite-node@1.3.1(@types/node@20.11.25)(sass@1.71.1): + /vite-node@1.3.1(@types/node@20.11.26)(sass@1.71.1): resolution: {integrity: sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -7590,7 +7537,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.1.5(@types/node@20.11.25)(sass@1.71.1) + vite: 5.1.6(@types/node@20.11.26)(sass@1.71.1) transitivePeerDependencies: - '@types/node' - less @@ -7602,8 +7549,8 @@ packages: - terser dev: true - /vite@5.1.5(@types/node@20.11.25)(sass@1.71.1): - resolution: {integrity: sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==} + /vite@5.1.6(@types/node@20.11.26)(sass@1.71.1): + resolution: {integrity: sha512-yYIAZs9nVfRJ/AiOLCA91zzhjsHUgMjB+EigzFb6W2XTLO8JixBCKCjvhKZaye+NKYHCrkv3Oh50dH9EdLU2RA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -7630,15 +7577,15 @@ packages: terser: optional: true dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.26 esbuild: 0.19.12 postcss: 8.4.35 - rollup: 4.12.0 + rollup: 4.12.1 sass: 1.71.1 optionalDependencies: fsevents: 2.3.3 - /vitefu@0.2.5(vite@5.1.5): + /vitefu@0.2.5(vite@5.1.6): resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} peerDependencies: vite: ^3.0.0 || ^4.0.0 || ^5.0.0 @@ -7646,9 +7593,9 @@ packages: vite: optional: true dependencies: - vite: 5.1.5(@types/node@20.11.25)(sass@1.71.1) + vite: 5.1.6(@types/node@20.11.26)(sass@1.71.1) - /vitest@1.3.1(@types/node@20.11.25)(sass@1.71.1): + /vitest@1.3.1(@types/node@20.11.26)(sass@1.71.1): resolution: {integrity: sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -7673,7 +7620,7 @@ packages: jsdom: optional: true dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.26 '@vitest/expect': 1.3.1 '@vitest/runner': 1.3.1 '@vitest/snapshot': 1.3.1 @@ -7691,8 +7638,8 @@ packages: strip-literal: 2.0.0 tinybench: 2.6.0 tinypool: 0.8.2 - vite: 5.1.5(@types/node@20.11.25)(sass@1.71.1) - vite-node: 1.3.1(@types/node@20.11.25)(sass@1.71.1) + vite: 5.1.6(@types/node@20.11.26)(sass@1.71.1) + vite-node: 1.3.1(@types/node@20.11.26)(sass@1.71.1) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/src/lib/server/auth-utils.ts b/src/lib/server/auth-utils.ts index cb6509d..9a62cc7 100644 --- a/src/lib/server/auth-utils.ts +++ b/src/lib/server/auth-utils.ts @@ -1,8 +1,8 @@ import db from "$lib/drizzle"; import { eq } from "drizzle-orm"; -import { password_reset_tokens } from "../../schema"; import { generateId } from "lucia"; import { TimeSpan, createDate } from "oslo"; +import { password_reset_tokens } from "../../schema"; export async function createPasswordResetToken(userId: string): Promise { // optionally invalidate all existing tokens diff --git a/src/lib/server/auth.ts b/src/lib/server/auth.ts index 7113754..078733f 100644 --- a/src/lib/server/auth.ts +++ b/src/lib/server/auth.ts @@ -1,7 +1,6 @@ // lib/server/lucia.ts import { Lucia, TimeSpan } from 'lucia'; import { DrizzlePostgreSQLAdapter } from "@lucia-auth/adapter-drizzle"; -import { dev } from '$app/environment'; import db from '$lib/drizzle'; import { sessions, users } from '../../schema'; @@ -29,9 +28,9 @@ export const lucia = new Lucia(adapter, { expires: false, // session cookies have very long lifespan (2 years) attributes: { // set to `true` when using HTTPS - secure: !dev, + secure: process.env.NODE_ENV === 'production', sameSite: 'strict', - domain: dev ? 'localhost' : 'boredgame.vercel.app', + domain: process.env.NODE_ENV === 'production' ? 'boredgame.vercel.app' : 'localhost', } }, }); diff --git a/src/migrate.ts b/src/migrate.ts index e329010..685c9e9 100644 --- a/src/migrate.ts +++ b/src/migrate.ts @@ -5,11 +5,11 @@ import { migrate } from 'drizzle-orm/postgres-js/migrator'; const connection = postgres({ host: process.env.DATABASE_HOST || 'localhost', - port: 5432, + port: process.env.DATABASE_PORT, user: process.env.DATABASE_USER || 'root', password: process.env.DATABASE_PASSWORD || '', database: process.env.DATABASE_DB || 'boredgame', - ssl: process.env.DATABASE_HOST === 'localhost' ? false : 'require', + ssl: process.env.NODE_ENV === 'development' ? false : 'require', max: 1 }); const db = drizzle(connection); @@ -21,5 +21,5 @@ try { console.error(e); } -await connection.end(); +// await connection.end(); process.exit(); diff --git a/src/routes/(auth)/login/+page.server.ts b/src/routes/(auth)/login/+page.server.ts index 1c0b028..3e2955e 100644 --- a/src/routes/(auth)/login/+page.server.ts +++ b/src/routes/(auth)/login/+page.server.ts @@ -1,4 +1,4 @@ -import { fail, type Actions } from '@sveltejs/kit'; +import { fail, error, type Actions } from '@sveltejs/kit'; import { eq } from 'drizzle-orm'; import { zod } from 'sveltekit-superforms/adapters'; import { setError, superValidate } from 'sveltekit-superforms/server'; @@ -6,9 +6,10 @@ import { redirect } from 'sveltekit-flash-message/server'; import { Argon2id } from 'oslo/password'; import db from '$lib/drizzle'; import { lucia } from '$lib/server/auth'; -import { signInSchema } from '$lib/validations/auth' +import { signInSchema } from '$lib/validations/auth'; import { collections, users, wishlists } from '../../../schema'; import type { PageServerLoad } from './$types'; +import { RateLimiter } from 'sveltekit-rate-limiter/server'; export const load: PageServerLoad = async (event) => { if (event.locals.user) { @@ -23,8 +24,17 @@ export const load: PageServerLoad = async (event) => { }; }; +const limiter = new RateLimiter({ + // A rate is defined by [number, unit] + IPUA: [5, 'm'] +}); + export const actions: Actions = { default: async (event) => { + if (await limiter.isLimited(event)) { + throw error(429); + } + const { locals } = event; const form = await superValidate(event, zod(signInSchema)); @@ -87,8 +97,9 @@ export const actions: Actions = { return setError(form, '', 'Your username or password is incorrect.'); } + console.log('setting session cookie', sessionCookie); event.cookies.set(sessionCookie.name, sessionCookie.value, { - path: ".", + path: '.', ...sessionCookie.attributes }); diff --git a/src/routes/(auth)/sign-up/+page.server.ts b/src/routes/(auth)/sign-up/+page.server.ts index c3eca08..4d10548 100644 --- a/src/routes/(auth)/sign-up/+page.server.ts +++ b/src/routes/(auth)/sign-up/+page.server.ts @@ -5,6 +5,7 @@ import { nanoid } from 'nanoid'; import { zod } from 'sveltekit-superforms/adapters'; import { setError, superValidate } from 'sveltekit-superforms/server'; import { redirect } from 'sveltekit-flash-message/server'; +import { RateLimiter } from 'sveltekit-rate-limiter/server'; import type { PageServerLoad } from './$types'; import { lucia } from '$lib/server/auth'; import { signUpSchema } from '$lib/validations/auth'; @@ -12,6 +13,11 @@ import { add_user_to_role } from '$server/roles'; import db from '$lib/drizzle'; import { collections, users, wishlists } from '../../../schema'; +const limiter = new RateLimiter({ + // A rate is defined by [number, unit] + IPUA: [5, 'm'] +}); + const signUpDefaults = { firstName: '', lastName: '', @@ -39,6 +45,9 @@ export const load: PageServerLoad = async (event) => { export const actions: Actions = { default: async (event) => { + if (await limiter.isLimited(event)) { + throw error(429); + } // fail(401, { message: 'Sign-up not yet available. Please add your email to the waitlist!' }); const form = await superValidate(event, zod(signUpSchema)); if (!form.valid) { @@ -54,9 +63,9 @@ export const actions: Actions = { // Adding user to the db console.log('Check if user already exists'); - const existing_user = await db.query - .users - .findFirst({ where: eq(users.username, form.data.username) }); + const existing_user = await db.query.users.findFirst({ + where: eq(users.username, form.data.username) + }); if (existing_user) { return setError(form, 'username', 'You cannot create an account with that username'); @@ -66,7 +75,8 @@ export const actions: Actions = { const hashedPassword = await new Argon2id().hash(form.data.password); - const user = await db.insert(users) + const user = await db + .insert(users) .values({ username: form.data.username, hashed_password: hashedPassword, @@ -76,7 +86,8 @@ export const actions: Actions = { verified: false, receive_email: false, theme: 'system' - }).returning(); + }) + .returning(); console.log('signup user', user); if (!user || user.length === 0) { @@ -87,14 +98,12 @@ export const actions: Actions = { } add_user_to_role(user[0].id, 'user'); - await db.insert(collections) - .values({ - user_id: user[0].id - }); - await db.insert(wishlists) - .values({ - user_id: user[0].id - }); + await db.insert(collections).values({ + user_id: user[0].id + }); + await db.insert(wishlists).values({ + user_id: user[0].id + }); try { session = await lucia.createSession(user[0].id, { @@ -118,7 +127,7 @@ export const actions: Actions = { } event.cookies.set(sessionCookie.name, sessionCookie.value, { - path: ".", + path: '.', ...sessionCookie.attributes }); diff --git a/src/schema.ts b/src/schema.ts index 5cf68f3..579d949 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -2,55 +2,34 @@ import { relations, sql, type InferSelectModel } from 'drizzle-orm'; import { pgTable, timestamp, - varchar, + text, boolean, integer, - text, index, pgEnum, - primaryKey + primaryKey, + uuid } from 'drizzle-orm/pg-core'; -import { nanoid } from 'nanoid'; +import { createId as cuid2 } from '@paralleldrive/cuid2'; import { tsvector } from './tsVector'; // User Related Schemas export const users = pgTable('users', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - username: varchar('username', { - length: 255 - }).unique(), - hashed_password: varchar('hashed_password', { - length: 255 - }), - email: varchar('email', { - length: 255 - }).unique(), - first_name: varchar('first_name', { - length: 255 - }), - last_name: varchar('last_name', { - length: 255 - }), + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + username: text('username').unique(), + hashed_password: text('hashed_password'), + email: text('email').unique(), + first_name: text('first_name'), + last_name: text('last_name'), verified: boolean('verified').default(false), receive_email: boolean('receive_email').default(false), - theme: varchar('theme', { - length: 255 - }).default('system'), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + theme: text('theme').default('system'), + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }); export const user_relations = relations(users, ({ many }) => ({ @@ -60,35 +39,24 @@ export const user_relations = relations(users, ({ many }) => ({ export type Users = InferSelectModel; export const sessions = pgTable('sessions', { - id: varchar('id', { - length: 255 - }).primaryKey(), - userId: varchar('user_id', { - length: 255 - }) + id: text('id').primaryKey(), + userId: uuid('user_id') .notNull() .references(() => users.id), expiresAt: timestamp('expires_at', { withTimezone: true, mode: 'date' }).notNull(), - ipCountry: varchar('ip_country', { - length: 255 - }), - ipAddress: varchar('ip_address', { - length: 255 - }) + ipCountry: text('ip_country'), + ipAddress: text('ip_address') }); export const roles = pgTable('roles', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - name: varchar('name', { - length: 255 - }).unique() + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + name: text('name').unique() }); export type Roles = InferSelectModel; @@ -98,31 +66,18 @@ export const role_relations = relations(roles, ({ many }) => ({ })); export const user_roles = pgTable('user_roles', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - user_id: varchar('user_id', { - length: 255 - }) + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + user_id: uuid('user_id') .notNull() .references(() => users.id, { onDelete: 'cascade' }), - role_id: varchar('role_id', { - length: 255 - }) + role_id: uuid('role_id') .notNull() .references(() => roles.id, { onDelete: 'cascade' }), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }); export const user_role_relations = relations(user_roles, ({ one }) => ({ @@ -139,14 +94,10 @@ export const user_role_relations = relations(user_roles, ({ one }) => ({ export type UserRoles = InferSelectModel; export const password_reset_tokens = pgTable('password_reset_tokens', { - id: varchar('id', { - length: 255 - }) + id: text('id') .primaryKey() - .$defaultFn(() => nanoid()), - user_id: varchar('user_id', { - length: 255 - }) + .$defaultFn(() => cuid2()), + user_id: uuid('user_id') .notNull() .references(() => users.id, { onDelete: 'cascade' }), expires_at: timestamp('expires_at', { @@ -154,11 +105,7 @@ export const password_reset_tokens = pgTable('password_reset_tokens', { mode: 'date', precision: 6 }), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + created_at: timestamp('created_at').notNull().defaultNow() }); export const password_reset_token_relations = relations(password_reset_tokens, ({ one }) => ({ @@ -169,26 +116,15 @@ export const password_reset_token_relations = relations(password_reset_tokens, ( })); export const collections = pgTable('collections', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - user_id: varchar('user_id', { - length: 255 - }) + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + user_id: uuid('user_id') .notNull() .references(() => users.id, { onDelete: 'cascade' }), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }); export const collection_relations = relations(collections, ({ one }) => ({ @@ -199,32 +135,19 @@ export const collection_relations = relations(collections, ({ one }) => ({ })); export const collection_items = pgTable('collection_items', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - collection_id: varchar('collection_id', { - length: 255 - }) + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + collection_id: uuid('collection_id') .notNull() .references(() => collections.id, { onDelete: 'cascade' }), - game_id: varchar('game_id', { - length: 255 - }) + game_id: uuid('game_id') .notNull() .references(() => games.id, { onDelete: 'cascade' }), times_played: integer('times_played').default(0), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }); export type CollectionItems = InferSelectModel; @@ -241,26 +164,15 @@ export const collection_item_relations = relations(collection_items, ({ one }) = })); export const wishlists = pgTable('wishlists', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - user_id: varchar('user_id', { - length: 255 - }) + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + user_id: uuid('user_id') .notNull() .references(() => users.id, { onDelete: 'cascade' }), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }); export type Wishlists = InferSelectModel; @@ -269,35 +181,22 @@ export const wishlists_relations = relations(wishlists, ({ one }) => ({ user: one(users, { fields: [wishlists.user_id], references: [users.id] - }), + }) })); export const wishlist_items = pgTable('wishlist_items', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - wishlist_id: varchar('wishlist_id', { - length: 255 - }) + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + wishlist_id: uuid('wishlist_id') .notNull() .references(() => wishlists.id, { onDelete: 'cascade' }), - game_id: varchar('game_id', { - length: 255 - }) + game_id: uuid('game_id') .notNull() .references(() => games.id, { onDelete: 'cascade' }), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }); export type WishlistItems = InferSelectModel; @@ -325,15 +224,12 @@ export const externalIdType = pgEnum('external_id_type', [ ]); export const externalIds = pgTable('external_ids', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), type: externalIdType('type').notNull(), - externalId: varchar('external_id', { - length: 255 - }).notNull() + externalId: text('external_id').notNull() }); export type ExternalIds = InferSelectModel; @@ -341,17 +237,12 @@ export type ExternalIds = InferSelectModel; export const games = pgTable( 'games', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - name: varchar('name', { - length: 255 - }), - slug: varchar('slug', { - length: 255 - }), + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + name: text('name'), + slug: text('slug'), description: text('description'), year_published: integer('year_published'), min_players: integer('min_players'), @@ -360,31 +251,17 @@ export const games = pgTable( min_playtime: integer('min_playtime'), max_playtime: integer('max_playtime'), min_age: integer('min_age'), - image_url: varchar('image_url', { - length: 255 - }), - thumb_url: varchar('thumb_url', { - length: 255 - }), - url: varchar('url', { - length: 255 - }), + image_url: text('image_url'), + thumb_url: text('thumb_url'), + url: text('url'), text_searchable_index: tsvector('text_searchable_index'), last_sync_at: timestamp('last_sync_at', { withTimezone: true, mode: 'date', precision: 6 }), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }, (table) => { return { @@ -400,14 +277,10 @@ export type Games = InferSelectModel; export const gamesToExternalIds = pgTable( 'games_to_external_ids', { - gameId: varchar('game_id', { - length: 255 - }) + gameId: uuid('game_id') .notNull() .references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }), - externalId: varchar('external_id', { - length: 255 - }) + externalId: uuid('external_id') .notNull() .references(() => externalIds.id, { onDelete: 'restrict', onUpdate: 'cascade' }) }, @@ -428,31 +301,18 @@ export const gameRelations = relations(games, ({ many }) => ({ })); export const expansions = pgTable('expansions', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - base_game_id: varchar('base_game_id', { - length: 255 - }) + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + base_game_id: uuid('base_game_id') .notNull() .references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }), - game_id: varchar('game_id', { - length: 255 - }) + game_id: uuid('game_id') .notNull() .references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }); export type Expansions = InferSelectModel; @@ -469,49 +329,36 @@ export const expansion_relations = relations(expansions, ({ one }) => ({ })); export const publishers = pgTable('publishers', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - name: varchar('name', { - length: 255 - }), - slug: varchar('slug', { - length: 255 - }), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + name: text('name'), + slug: text('slug'), + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }); export type Publishers = InferSelectModel; -export const publishersToExternalIds = pgTable('publishers_to_external_ids', { - publisherId: varchar('publisher_id', { - length: 255 - }) - .notNull() - .references(() => publishers.id, { onDelete: 'restrict', onUpdate: 'cascade' }), - externalId: varchar('external_id', { - length: 255 - }) - .notNull() - .references(() => externalIds.id, { onDelete: 'restrict', onUpdate: 'cascade' }) -}, (table) => { - return { - publishersToExternalIdsPkey: primaryKey({ - columns: [table.publisherId, table.externalId] - }) +export const publishersToExternalIds = pgTable( + 'publishers_to_external_ids', + { + publisherId: uuid('publisher_id') + .notNull() + .references(() => publishers.id, { onDelete: 'restrict', onUpdate: 'cascade' }), + externalId: uuid('external_id') + .notNull() + .references(() => externalIds.id, { onDelete: 'restrict', onUpdate: 'cascade' }) + }, + (table) => { + return { + publishersToExternalIdsPkey: primaryKey({ + columns: [table.publisherId, table.externalId] + }) + }; } -}); +); export const publishers_relations = relations(publishers, ({ many }) => ({ publishers_to_games: many(publishers_to_games), @@ -519,68 +366,55 @@ export const publishers_relations = relations(publishers, ({ many }) => ({ })); export const categories = pgTable('categories', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - name: varchar('name', { - length: 255 - }), - slug: varchar('slug', { - length: 255 - }), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + name: text('name'), + slug: text('slug'), + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }); export type Categories = InferSelectModel; -export const categoriesToExternalIds = pgTable('categories_to_external_ids', { - categoryId: varchar('category_id', { - length: 255 - }) - .notNull() - .references(() => categories.id, { onDelete: 'restrict', onUpdate: 'cascade' }), - externalId: varchar('external_id', { - length: 255 - }) - .notNull() - .references(() => externalIds.id, { onDelete: 'restrict', onUpdate: 'cascade' }) -}, (table) => { - return { - categoriesToExternalIdsPkey: primaryKey({ - columns: [table.categoryId, table.externalId] - }) +export const categoriesToExternalIds = pgTable( + 'categories_to_external_ids', + { + categoryId: uuid('category_id') + .notNull() + .references(() => categories.id, { onDelete: 'restrict', onUpdate: 'cascade' }), + externalId: uuid('external_id') + .notNull() + .references(() => externalIds.id, { onDelete: 'restrict', onUpdate: 'cascade' }) + }, + (table) => { + return { + categoriesToExternalIdsPkey: primaryKey({ + columns: [table.categoryId, table.externalId] + }) + }; } -}); +); -export const categories_to_games = pgTable('categories_to_games', { - category_id: varchar('category_id', { - length: 255 - }) - .notNull() - .references(() => categories.id, { onDelete: 'restrict', onUpdate: 'cascade' }), - game_id: varchar('game_id', { - length: 255 - }) - .notNull() - .references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }) -}, (table) => { - return { - categoriesToGamesPkey: primaryKey({ - columns: [table.category_id, table.game_id] - }) +export const categories_to_games = pgTable( + 'categories_to_games', + { + category_id: uuid('category_id') + .notNull() + .references(() => categories.id, { onDelete: 'restrict', onUpdate: 'cascade' }), + game_id: uuid('game_id') + .notNull() + .references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }) + }, + (table) => { + return { + categoriesToGamesPkey: primaryKey({ + columns: [table.category_id, table.game_id] + }) + }; } -}); +); export const categories_to_games_relations = relations(categories_to_games, ({ one }) => ({ category: one(categories, { @@ -599,73 +433,60 @@ export const categories_relations = relations(categories, ({ many }) => ({ })); export const mechanics = pgTable('mechanics', { - id: varchar('id', { - length: 255 - }) - .primaryKey() - .$defaultFn(() => nanoid()), - name: varchar('name', { - length: 255 - }), - slug: varchar('slug', { - length: 255 - }), - created_at: timestamp('created_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`), - updated_at: timestamp('updated_at', { - withTimezone: true, - mode: 'date', - precision: 6 - }).default(sql`now()`) + id: uuid('id').primaryKey(), + cuid: text('cuid') + .unique() + .$defaultFn(() => cuid2()), + name: text('name'), + slug: text('slug'), + created_at: timestamp('created_at').notNull().defaultNow(), + updated_at: timestamp('updated_at').notNull().defaultNow() }); export type Mechanics = InferSelectModel; -export const mechanicsToExternalIds = pgTable('mechanics_to_external_ids', { - mechanicId: varchar('mechanic_id', { - length: 255 - }) - .notNull() - .references(() => mechanics.id, { onDelete: 'restrict', onUpdate: 'cascade' }), - externalId: varchar('external_id', { - length: 255 - }) - .notNull() - .references(() => externalIds.id, { onDelete: 'restrict', onUpdate: 'cascade' }) -}, (table) => { - return { - mechanicsToExternalIdsPkey: primaryKey({ - columns: [table.mechanicId, table.externalId] - }) +export const mechanicsToExternalIds = pgTable( + 'mechanics_to_external_ids', + { + mechanicId: uuid('mechanic_id') + .notNull() + .references(() => mechanics.id, { onDelete: 'restrict', onUpdate: 'cascade' }), + externalId: uuid('external_id') + .notNull() + .references(() => externalIds.id, { onDelete: 'restrict', onUpdate: 'cascade' }) + }, + (table) => { + return { + mechanicsToExternalIdsPkey: primaryKey({ + columns: [table.mechanicId, table.externalId] + }) + }; } -}); +); export const mechanic_relations = relations(mechanics, ({ many }) => ({ mechanics_to_games: many(mechanics_to_games), mechanicsToExternalIds: many(mechanicsToExternalIds) })); -export const mechanics_to_games = pgTable('mechanics_to_games', { - mechanic_id: varchar('mechanic_id', { - length: 255 - }) - .notNull() - .references(() => mechanics.id, { onDelete: 'restrict', onUpdate: 'cascade' }), - game_id: varchar('game_id', { - length: 255 - }) - .notNull() - .references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }) -}, (table) => { - return { - mechanicsToGamesPkey: primaryKey({ - columns: [table.mechanic_id, table.game_id] - }) +export const mechanics_to_games = pgTable( + 'mechanics_to_games', + { + mechanic_id: uuid('mechanic_id') + .notNull() + .references(() => mechanics.id, { onDelete: 'restrict', onUpdate: 'cascade' }), + game_id: uuid('game_id') + .notNull() + .references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }) + }, + (table) => { + return { + mechanicsToGamesPkey: primaryKey({ + columns: [table.mechanic_id, table.game_id] + }) + }; } -}); +); export const mechanics_to_games_relations = relations(mechanics_to_games, ({ one }) => ({ mechanic: one(mechanics, { @@ -678,24 +499,24 @@ export const mechanics_to_games_relations = relations(mechanics_to_games, ({ one }) })); -export const publishers_to_games = pgTable('publishers_to_games', { - publisher_id: varchar('publisher_id', { - length: 255 - }) - .notNull() - .references(() => publishers.id, { onDelete: 'restrict', onUpdate: 'cascade' }), - game_id: varchar('game_id', { - length: 255 - }) - .notNull() - .references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }) -}, (table) => { - return { - publishersToGamesPkey: primaryKey({ - columns: [table.publisher_id, table.game_id] - }) +export const publishers_to_games = pgTable( + 'publishers_to_games', + { + publisher_id: uuid('publisher_id') + .notNull() + .references(() => publishers.id, { onDelete: 'restrict', onUpdate: 'cascade' }), + game_id: uuid('game_id') + .notNull() + .references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }) + }, + (table) => { + return { + publishersToGamesPkey: primaryKey({ + columns: [table.publisher_id, table.game_id] + }) + }; } -}); +); export const publishers_to_games_relations = relations(publishers_to_games, ({ one }) => ({ publisher: one(publishers, {