From 42292c15b2e2e6fde6f51530b8f6e1b5ff37ea10 Mon Sep 17 00:00:00 2001 From: Bradley Shellnut Date: Thu, 11 Jul 2024 15:53:56 -0700 Subject: [PATCH] Using Svelte 5, refactor to use a separate table for user two factor details, and update the whole application to use the new table. --- package.json | 14 +- pnpm-lock.yaml | 613 ++++-- src/db/migrate.ts | 1 - ...pper_potts.sql => 0000_dazzling_stick.sql} | 84 +- src/db/migrations/0001_noisy_sally_floyd.sql | 2 + src/db/migrations/0001_spicy_legion.sql | 1 - src/db/migrations/0002_fancy_valkyrie.sql | 1 + src/db/migrations/0002_third_black_tom.sql | 5 - src/db/migrations/0003_premium_ravenous.sql | 1 - src/db/migrations/0004_glossy_gideon.sql | 24 - src/db/migrations/meta/0000_snapshot.json | 185 +- src/db/migrations/meta/0001_snapshot.json | 185 +- src/db/migrations/meta/0002_snapshot.json | 170 +- src/db/migrations/meta/0003_snapshot.json | 1650 ---------------- src/db/migrations/meta/0004_snapshot.json | 1721 ----------------- src/db/migrations/meta/_journal.json | 26 +- src/db/schema/categories.ts | 6 +- src/db/schema/collectionItems.ts | 6 +- src/db/schema/collections.ts | 4 +- src/db/schema/expansions.ts | 4 +- src/db/schema/games.ts | 4 +- src/db/schema/mechanics.ts | 6 +- src/db/schema/passwordResetTokens.ts | 3 +- src/db/schema/publishers.ts | 6 +- src/db/schema/recoveryCodes.ts | 6 +- src/db/schema/roles.ts | 6 +- src/db/schema/two-factor.table.ts | 17 +- src/db/schema/userRoles.ts | 6 +- src/db/schema/wishlistItems.ts | 6 +- src/db/schema/wishlists.ts | 6 +- src/env.ts | 1 + .../(app)/(protected)/profile/+page.server.ts | 8 +- .../security/two-factor/+page.server.ts | 108 +- .../two-factor/recovery-codes/+page.server.ts | 9 +- src/routes/(auth)/login/+page.server.ts | 50 +- src/routes/(auth)/login/+page.svelte | 4 +- src/routes/(auth)/totp/+page.server.ts | 27 +- 37 files changed, 1095 insertions(+), 3881 deletions(-) rename src/db/migrations/{0000_premium_pepper_potts.sql => 0000_dazzling_stick.sql} (83%) create mode 100644 src/db/migrations/0001_noisy_sally_floyd.sql delete mode 100644 src/db/migrations/0001_spicy_legion.sql create mode 100644 src/db/migrations/0002_fancy_valkyrie.sql delete mode 100644 src/db/migrations/0002_third_black_tom.sql delete mode 100644 src/db/migrations/0003_premium_ravenous.sql delete mode 100644 src/db/migrations/0004_glossy_gideon.sql delete mode 100644 src/db/migrations/meta/0003_snapshot.json delete mode 100644 src/db/migrations/meta/0004_snapshot.json diff --git a/package.json b/package.json index 730613c..c033990 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@typescript-eslint/eslint-plugin": "^7.13.0", "@typescript-eslint/parser": "^7.13.0", "autoprefixer": "^10.4.19", - "drizzle-kit": "^0.22.8", + "drizzle-kit": "^0.23.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.41.0", @@ -47,18 +47,18 @@ "postcss-preset-env": "^9.6.0", "prettier": "^3.3.2", "prettier-plugin-svelte": "^3.2.5", - "sass": "^1.77.6", + "sass": "^1.77.8", "satori": "^0.10.13", "satori-html": "^0.3.2", "svelte": "5.0.0-next.175", "svelte-check": "^3.8.4", "svelte-headless-table": "^0.18.2", "svelte-meta-tags": "^3.1.2", - "svelte-preprocess": "^6.0.1", + "svelte-preprocess": "^6.0.2", "svelte-sequential-preprocessor": "^2.0.1", "sveltekit-flash-message": "^2.4.4", "sveltekit-rate-limiter": "^0.5.1", - "sveltekit-superforms": "^2.15.2", + "sveltekit-superforms": "^2.16.0", "tailwindcss": "^3.4.4", "ts-node": "^10.9.2", "tslib": "^2.6.3", @@ -91,7 +91,7 @@ "cookie": "^0.6.0", "dotenv": "^16.4.5", "dotenv-expand": "^11.0.6", - "drizzle-orm": "^0.31.2", + "drizzle-orm": "^0.32.0", "feather-icons": "^4.29.2", "formsnap": "^1.0.1", "html-entities": "^2.5.2", @@ -100,7 +100,7 @@ "just-kebab-case": "^4.2.0", "loader": "^2.1.1", "lucia": "3.2.0", - "lucide-svelte": "^0.390.0", + "lucide-svelte": "^0.407.0", "open-props": "^1.7.5", "oslo": "^1.2.1", "pg": "^8.12.0", @@ -109,7 +109,7 @@ "radix-svelte": "^0.9.0", "svelte-french-toast": "^1.2.0", "svelte-lazy-loader": "^1.0.0", - "tailwind-merge": "^2.3.0", + "tailwind-merge": "^2.4.0", "tailwind-variants": "^0.2.1", "tailwindcss-animate": "^1.0.7", "zod-to-json-schema": "^3.23.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0fa2adf..151f3a7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,7 +31,7 @@ importers: version: 2.2.2 '@sveltejs/adapter-vercel': specifier: ^5.4.1 - version: 5.4.1(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6))) + version: 5.4.1(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8))) '@types/feather-icons': specifier: ^4.29.4 version: 4.29.4 @@ -60,14 +60,14 @@ importers: specifier: ^11.0.6 version: 11.0.6 drizzle-orm: - specifier: ^0.31.2 - version: 0.31.2(@neondatabase/serverless@0.9.4)(@types/pg@8.11.6)(pg@8.12.0)(postgres@3.4.4) + specifier: ^0.32.0 + version: 0.32.0(@neondatabase/serverless@0.9.4)(@types/pg@8.11.6)(pg@8.12.0)(postgres@3.4.4) feather-icons: specifier: ^4.29.2 version: 4.29.2 formsnap: specifier: ^1.0.1 - version: 1.0.1(svelte@5.0.0-next.175)(sveltekit-superforms@2.15.2(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)) + version: 1.0.1(svelte@5.0.0-next.175)(sveltekit-superforms@2.16.0(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)) html-entities: specifier: ^2.5.2 version: 2.5.2 @@ -87,8 +87,8 @@ importers: specifier: 3.2.0 version: 3.2.0 lucide-svelte: - specifier: ^0.390.0 - version: 0.390.0(svelte@5.0.0-next.175) + specifier: ^0.407.0 + version: 0.407.0(svelte@5.0.0-next.175) open-props: specifier: ^1.7.5 version: 1.7.5 @@ -114,8 +114,8 @@ importers: specifier: ^1.0.0 version: 1.0.0 tailwind-merge: - specifier: ^2.3.0 - version: 2.3.0 + specifier: ^2.4.0 + version: 2.4.0 tailwind-variants: specifier: ^0.2.1 version: 0.2.1(tailwindcss@3.4.4(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3))) @@ -140,16 +140,16 @@ importers: version: 2.6.2 '@sveltejs/adapter-auto': specifier: ^3.2.2 - version: 3.2.2(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6))) + version: 3.2.2(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8))) '@sveltejs/enhanced-img': specifier: ^0.3.0 - version: 0.3.0(rollup@4.18.0)(svelte@5.0.0-next.175) + version: 0.3.0(rollup@4.18.1)(svelte@5.0.0-next.175) '@sveltejs/kit': specifier: ^2.5.18 - version: 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + version: 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) '@sveltejs/vite-plugin-svelte': specifier: ^3.1.1 - version: 3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + version: 3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) '@types/cookie': specifier: ^0.6.0 version: 0.6.0 @@ -169,8 +169,8 @@ importers: specifier: ^10.4.19 version: 10.4.19(postcss@8.4.39) drizzle-kit: - specifier: ^0.22.8 - version: 0.22.8 + specifier: ^0.23.0 + version: 0.23.0 eslint: specifier: ^8.57.0 version: 8.57.0 @@ -205,8 +205,8 @@ importers: specifier: ^3.2.5 version: 3.2.5(prettier@3.3.2)(svelte@5.0.0-next.175) sass: - specifier: ^1.77.6 - version: 1.77.6 + specifier: ^1.77.8 + version: 1.77.8 satori: specifier: ^0.10.13 version: 0.10.13 @@ -218,7 +218,7 @@ importers: version: 5.0.0-next.175 svelte-check: specifier: ^3.8.4 - version: 3.8.4(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.6)(svelte@5.0.0-next.175) + version: 3.8.4(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.8)(svelte@5.0.0-next.175) svelte-headless-table: specifier: ^0.18.2 version: 0.18.2(svelte@5.0.0-next.175) @@ -226,20 +226,20 @@ importers: specifier: ^3.1.2 version: 3.1.2(svelte@5.0.0-next.175)(typescript@5.5.3) svelte-preprocess: - specifier: ^6.0.1 - version: 6.0.1(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.6)(svelte@5.0.0-next.175)(typescript@5.5.3) + specifier: ^6.0.2 + version: 6.0.2(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.8)(svelte@5.0.0-next.175)(typescript@5.5.3) svelte-sequential-preprocessor: specifier: ^2.0.1 version: 2.0.1 sveltekit-flash-message: specifier: ^2.4.4 - version: 2.4.4(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175) + version: 2.4.4(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175) sveltekit-rate-limiter: specifier: ^0.5.1 - version: 0.5.1(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6))) + version: 0.5.1(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8))) sveltekit-superforms: - specifier: ^2.15.2 - version: 2.15.2(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175) + specifier: ^2.16.0 + version: 2.16.0(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175) tailwindcss: specifier: ^3.4.4 version: 3.4.4(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) @@ -257,10 +257,10 @@ importers: version: 5.5.3 vite: specifier: ^5.3.3 - version: 5.3.3(@types/node@20.14.10)(sass@1.77.6) + version: 5.3.3(@types/node@20.14.10)(sass@1.77.8) vitest: specifier: ^1.6.0 - version: 1.6.0(@types/node@20.14.10)(sass@1.77.6) + version: 1.6.0(@types/node@20.14.10)(sass@1.77.8) zod: specifier: ^3.23.8 version: 3.23.8 @@ -281,8 +281,8 @@ packages: '@arktype/util@0.0.48': resolution: {integrity: sha512-U5FO5EUAJ4LoYtLSyAMmTf6CEVgslObfSQuua2zoK5Tv2FB3aESVQ3rdLfhuz+coRhlzlynbkmimyoQWwQT+aQ==} - '@babel/runtime@7.24.5': - resolution: {integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==} + '@babel/runtime@7.24.8': + resolution: {integrity: sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==} engines: {node: '>=6.9.0'} '@cspotcode/source-map-support@0.8.1': @@ -556,6 +556,12 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/aix-ppc64@0.23.0': + resolution: {integrity: sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/android-arm64@0.18.20': resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} @@ -574,6 +580,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm64@0.23.0': + resolution: {integrity: sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm@0.18.20': resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} @@ -592,6 +604,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-arm@0.23.0': + resolution: {integrity: sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-x64@0.18.20': resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} @@ -610,6 +628,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/android-x64@0.23.0': + resolution: {integrity: sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/darwin-arm64@0.18.20': resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} @@ -628,6 +652,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-arm64@0.23.0': + resolution: {integrity: sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-x64@0.18.20': resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} @@ -646,6 +676,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/darwin-x64@0.23.0': + resolution: {integrity: sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/freebsd-arm64@0.18.20': resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} @@ -664,6 +700,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-arm64@0.23.0': + resolution: {integrity: sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-x64@0.18.20': resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} @@ -682,6 +724,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/freebsd-x64@0.23.0': + resolution: {integrity: sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/linux-arm64@0.18.20': resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} @@ -700,6 +748,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm64@0.23.0': + resolution: {integrity: sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm@0.18.20': resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} @@ -718,6 +772,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-arm@0.23.0': + resolution: {integrity: sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-ia32@0.18.20': resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} @@ -736,6 +796,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-ia32@0.23.0': + resolution: {integrity: sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-loong64@0.18.20': resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} @@ -754,6 +820,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-loong64@0.23.0': + resolution: {integrity: sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-mips64el@0.18.20': resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} @@ -772,6 +844,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-mips64el@0.23.0': + resolution: {integrity: sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-ppc64@0.18.20': resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} @@ -790,6 +868,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-ppc64@0.23.0': + resolution: {integrity: sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-riscv64@0.18.20': resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} @@ -808,6 +892,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-riscv64@0.23.0': + resolution: {integrity: sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-s390x@0.18.20': resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} @@ -826,6 +916,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-s390x@0.23.0': + resolution: {integrity: sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-x64@0.18.20': resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} @@ -844,6 +940,12 @@ packages: cpu: [x64] os: [linux] + '@esbuild/linux-x64@0.23.0': + resolution: {integrity: sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + '@esbuild/netbsd-x64@0.18.20': resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} @@ -862,6 +964,18 @@ packages: cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.23.0': + resolution: {integrity: sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.23.0': + resolution: {integrity: sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-x64@0.18.20': resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} @@ -880,6 +994,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/openbsd-x64@0.23.0': + resolution: {integrity: sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/sunos-x64@0.18.20': resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} @@ -898,6 +1018,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/sunos-x64@0.23.0': + resolution: {integrity: sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/win32-arm64@0.18.20': resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} @@ -916,6 +1042,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-arm64@0.23.0': + resolution: {integrity: sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-ia32@0.18.20': resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} @@ -934,6 +1066,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-ia32@0.23.0': + resolution: {integrity: sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-x64@0.18.20': resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} @@ -952,6 +1090,12 @@ packages: cpu: [x64] os: [win32] + '@esbuild/win32-x64@0.23.0': + resolution: {integrity: sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@eslint-community/eslint-utils@4.4.0': resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1522,8 +1666,8 @@ packages: cpu: [arm] os: [android] - '@rollup/rollup-android-arm-eabi@4.18.0': - resolution: {integrity: sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==} + '@rollup/rollup-android-arm-eabi@4.18.1': + resolution: {integrity: sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA==} cpu: [arm] os: [android] @@ -1532,8 +1676,8 @@ packages: cpu: [arm64] os: [android] - '@rollup/rollup-android-arm64@4.18.0': - resolution: {integrity: sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==} + '@rollup/rollup-android-arm64@4.18.1': + resolution: {integrity: sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg==} cpu: [arm64] os: [android] @@ -1542,8 +1686,8 @@ packages: cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-arm64@4.18.0': - resolution: {integrity: sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==} + '@rollup/rollup-darwin-arm64@4.18.1': + resolution: {integrity: sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ==} cpu: [arm64] os: [darwin] @@ -1552,8 +1696,8 @@ packages: cpu: [x64] os: [darwin] - '@rollup/rollup-darwin-x64@4.18.0': - resolution: {integrity: sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==} + '@rollup/rollup-darwin-x64@4.18.1': + resolution: {integrity: sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA==} cpu: [x64] os: [darwin] @@ -1562,8 +1706,8 @@ packages: cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-gnueabihf@4.18.0': - resolution: {integrity: sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==} + '@rollup/rollup-linux-arm-gnueabihf@4.18.1': + resolution: {integrity: sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g==} cpu: [arm] os: [linux] @@ -1572,8 +1716,8 @@ packages: cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.18.0': - resolution: {integrity: sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==} + '@rollup/rollup-linux-arm-musleabihf@4.18.1': + resolution: {integrity: sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ==} cpu: [arm] os: [linux] @@ -1582,8 +1726,8 @@ packages: cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.18.0': - resolution: {integrity: sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==} + '@rollup/rollup-linux-arm64-gnu@4.18.1': + resolution: {integrity: sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ==} cpu: [arm64] os: [linux] @@ -1592,8 +1736,8 @@ packages: cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.18.0': - resolution: {integrity: sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==} + '@rollup/rollup-linux-arm64-musl@4.18.1': + resolution: {integrity: sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ==} cpu: [arm64] os: [linux] @@ -1602,8 +1746,8 @@ packages: cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': - resolution: {integrity: sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==} + '@rollup/rollup-linux-powerpc64le-gnu@4.18.1': + resolution: {integrity: sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ==} cpu: [ppc64] os: [linux] @@ -1612,8 +1756,8 @@ packages: cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.18.0': - resolution: {integrity: sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==} + '@rollup/rollup-linux-riscv64-gnu@4.18.1': + resolution: {integrity: sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg==} cpu: [riscv64] os: [linux] @@ -1622,8 +1766,8 @@ packages: cpu: [s390x] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.18.0': - resolution: {integrity: sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==} + '@rollup/rollup-linux-s390x-gnu@4.18.1': + resolution: {integrity: sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg==} cpu: [s390x] os: [linux] @@ -1632,8 +1776,8 @@ packages: cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.18.0': - resolution: {integrity: sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==} + '@rollup/rollup-linux-x64-gnu@4.18.1': + resolution: {integrity: sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g==} cpu: [x64] os: [linux] @@ -1642,8 +1786,8 @@ packages: cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.18.0': - resolution: {integrity: sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==} + '@rollup/rollup-linux-x64-musl@4.18.1': + resolution: {integrity: sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ==} cpu: [x64] os: [linux] @@ -1652,8 +1796,8 @@ packages: cpu: [arm64] os: [win32] - '@rollup/rollup-win32-arm64-msvc@4.18.0': - resolution: {integrity: sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==} + '@rollup/rollup-win32-arm64-msvc@4.18.1': + resolution: {integrity: sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g==} cpu: [arm64] os: [win32] @@ -1662,8 +1806,8 @@ packages: cpu: [ia32] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.18.0': - resolution: {integrity: sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==} + '@rollup/rollup-win32-ia32-msvc@4.18.1': + resolution: {integrity: sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg==} cpu: [ia32] os: [win32] @@ -1672,8 +1816,8 @@ packages: cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.18.0': - resolution: {integrity: sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==} + '@rollup/rollup-win32-x64-msvc@4.18.1': + resolution: {integrity: sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw==} cpu: [x64] os: [win32] @@ -1776,8 +1920,8 @@ packages: '@types/pug@2.0.10': resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==} - '@types/validator@13.11.9': - resolution: {integrity: sha512-FCTsikRozryfayPuiI46QzH3fnrOoctTjvOYZkho9BTFLCOZ2rgZJHMOVgCOfttjPJcgOx52EpkY0CMfy87MIw==} + '@types/validator@13.12.0': + resolution: {integrity: sha512-nH45Lk7oPIJ1RVOF6JgFI6Dy0QpHEzq4QecZhvguxYPDwT8c93prCMqAtiIttm39voZ+DDR+qkNnMpJmMBRqag==} '@typescript-eslint/eslint-plugin@7.13.0': resolution: {integrity: sha512-FX1X6AF0w8MdVFLSdqwqN/me2hyhuQg4ykN6ZpVhh1ij/80pTvDKclX1sZB9iqex8SjQfVhwMKs3JtnnMLzG9w==} @@ -2277,12 +2421,12 @@ packages: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} - drizzle-kit@0.22.8: - resolution: {integrity: sha512-VjI4wsJjk3hSqHSa3TwBf+uvH6M6pRHyxyoVbt935GUzP9tUR/BRZ+MhEJNgryqbzN2Za1KP0eJMTgKEPsalYQ==} + drizzle-kit@0.23.0: + resolution: {integrity: sha512-w9jE97z193dd4jzAyj4Uv2SOh8Ydue70Ki6W0awy4bGM1aPXan6zD6Yv+nNTA6oGgNTDl2MJFxutjHG4fden5g==} hasBin: true - drizzle-orm@0.31.2: - resolution: {integrity: sha512-QnenevbnnAzmbNzQwbhklvIYrDE8YER8K7kSrAWQSV1YvFCdSQPzj+jzqRdTSsV2cDqSpQ0NXGyL1G9I43LDLg==} + drizzle-orm@0.32.0: + resolution: {integrity: sha512-99IlfVGPNHzOFEXo9Phyu5At5TALLsY2t6WxFFy68rYd9Ej4cHX/7WjdPOn7JNRW69MNeNtP8XrDQg43SppuAA==} peerDependencies: '@aws-sdk/client-rds-data': '>=3' '@cloudflare/workers-types': '>=3' @@ -2292,6 +2436,7 @@ packages: '@op-engineering/op-sqlite': '>=2' '@opentelemetry/api': ^1.4.1 '@planetscale/database': '>=1' + '@prisma/client': '*' '@tidbcloud/serverless': '*' '@types/better-sqlite3': '*' '@types/pg': '*' @@ -2307,6 +2452,7 @@ packages: mysql2: '>=2' pg: '>=8' postgres: '>=3' + prisma: '*' react: '>=18' sql.js: '>=1' sqlite3: '>=5' @@ -2327,6 +2473,8 @@ packages: optional: true '@planetscale/database': optional: true + '@prisma/client': + optional: true '@tidbcloud/serverless': optional: true '@types/better-sqlite3': @@ -2357,6 +2505,8 @@ packages: optional: true postgres: optional: true + prisma: + optional: true react: optional: true sql.js: @@ -2414,6 +2564,11 @@ packages: engines: {node: '>=12'} hasBin: true + esbuild@0.23.0: + resolution: {integrity: sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==} + engines: {node: '>=18'} + hasBin: true + escalade@3.1.2: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} @@ -2861,8 +3016,8 @@ packages: lucia@3.2.0: resolution: {integrity: sha512-eXMxXwk6hqtjRTj4W/x3EnTUtAztLPm0p2N2TEBMDEbakDLXiYnDQ9z/qahjPdPdhPguQc+vwO0/88zIWxlpuw==} - lucide-svelte@0.390.0: - resolution: {integrity: sha512-zaHTuk1KB2PqYrF/UY87g8DkforXEj7sYOo2Ml3LokNzx35dRJMHZHsuEXXTj9gqB76Da0o6Tud15bmtNBX1/Q==} + lucide-svelte@0.407.0: + resolution: {integrity: sha512-gtFkn8/+4XedQh1WMm6FVed7v1yny4q8IjjIlhlhZZ5syAUVFrsnuPPuzCgmb0zNSo/fvn4RnytO/DX4iP3iUQ==} peerDependencies: svelte: ^3 || ^4 || ^5.0.0-next.42 @@ -3581,8 +3736,8 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - rollup@4.18.0: - resolution: {integrity: sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==} + rollup@4.18.1: + resolution: {integrity: sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3599,8 +3754,8 @@ packages: sander@0.5.1: resolution: {integrity: sha512-3lVqBir7WuKDHGrKRDn/1Ye3kwpXaDOMsiRP1wd6wpZW56gJhsbp5RqQpA6JG/P+pkXizygnr1dKR8vzWaVsfA==} - sass@1.77.6: - resolution: {integrity: sha512-ByXE1oLD79GVq9Ht1PeHWCPMPB8XHpBuz1r85oByKHjZY6qV6rWnQovQzXJXuQ/XyE1Oj3iPk3lo28uzaRA2/Q==} + sass@1.77.8: + resolution: {integrity: sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ==} engines: {node: '>=14.0.0'} hasBin: true @@ -3738,8 +3893,8 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true - superstruct@1.0.4: - resolution: {integrity: sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==} + superstruct@2.0.2: + resolution: {integrity: sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==} engines: {node: '>=14.0.0'} supports-color@7.2.0: @@ -3836,8 +3991,8 @@ packages: typescript: optional: true - svelte-preprocess@6.0.1: - resolution: {integrity: sha512-vNgXoyqWwahdpEX9XbQHcAHt41TkXnf8bRDxT5PjISHbZD1dVH4b2OsJ2fVQTBb3qP05x0GuYE9iS5vhD+Dniw==} + svelte-preprocess@6.0.2: + resolution: {integrity: sha512-OvDTLfaOkkhjprbDKO0SOCkjNYuHy16dbD4SpqbIi6QiabOMHxRT4km5/dzbFFkmW1L0E2INF3MFltG2pgOyKQ==} engines: {node: '>= 18.0.0'} peerDependencies: '@babel/core': ^7.10.2 @@ -3911,8 +4066,8 @@ packages: peerDependencies: '@sveltejs/kit': 1.x || 2.x - sveltekit-superforms@2.15.2: - resolution: {integrity: sha512-8mraZXhTL43z2H7mqmkpfqMvIGmV9mtRabHIYM2B6I3ZmEvWESS9tQPhHFY8uIEFKL6oG6BP9Tvi/aP4QKdcyg==} + sveltekit-superforms@2.16.0: + resolution: {integrity: sha512-t5aZyMCXyahgvn7VAJ7l9S+wAv9YyMAZHYQ6gcGVZ6ecr4/DMMD2r3ajGCj1h1dWaMQ3w5zVw+SqHSAkbHsWVQ==} peerDependencies: '@sveltejs/kit': 1.x || 2.x svelte: 3.x || 4.x || >=5.0.0-next.51 @@ -3920,8 +4075,8 @@ packages: tabbable@6.2.0: resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} - tailwind-merge@2.3.0: - resolution: {integrity: sha512-vkYrLpIP+lgR0tQCG6AP7zZXCTLc1Lnv/CCRT3BqJ9CZ3ui2++GPaGb1x/ILsINIMSYqqvrpqjUFsMNLlW99EA==} + tailwind-merge@2.4.0: + resolution: {integrity: sha512-49AwoOQNKdqKPd9CViyH5wJoSKsCDjUlzL8DxuGp3P1FsGY36NJDAa18jLZcaHAUUuTj+JB8IAo8zWgBNvBF7A==} tailwind-variants@0.2.1: resolution: {integrity: sha512-2xmhAf4UIc3PijOUcJPA1LP4AbxhpcHuHM2C26xM0k81r0maAO6uoUSHl3APmvHZcY5cZCY/bYuJdfFa4eGoaw==} @@ -4091,8 +4246,8 @@ packages: valibot@0.35.0: resolution: {integrity: sha512-+i2aCRkReTrd5KBN/dW2BrPOvFnU5LXTV2xjZnjnqUIO8YUx6P2+MgRrkwF2FhkexgyKq/NIZdPdknhHf5A/Ww==} - validator@13.11.0: - resolution: {integrity: sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==} + validator@13.12.0: + resolution: {integrity: sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==} engines: {node: '>= 0.10'} vite-imagetools@7.0.2: @@ -4284,9 +4439,10 @@ snapshots: '@arktype/util@0.0.48': optional: true - '@babel/runtime@7.24.5': + '@babel/runtime@7.24.8': dependencies: regenerator-runtime: 0.14.1 + optional: true '@cspotcode/source-map-support@0.8.1': dependencies: @@ -4561,6 +4717,9 @@ snapshots: '@esbuild/aix-ppc64@0.21.5': optional: true + '@esbuild/aix-ppc64@0.23.0': + optional: true + '@esbuild/android-arm64@0.18.20': optional: true @@ -4570,6 +4729,9 @@ snapshots: '@esbuild/android-arm64@0.21.5': optional: true + '@esbuild/android-arm64@0.23.0': + optional: true + '@esbuild/android-arm@0.18.20': optional: true @@ -4579,6 +4741,9 @@ snapshots: '@esbuild/android-arm@0.21.5': optional: true + '@esbuild/android-arm@0.23.0': + optional: true + '@esbuild/android-x64@0.18.20': optional: true @@ -4588,6 +4753,9 @@ snapshots: '@esbuild/android-x64@0.21.5': optional: true + '@esbuild/android-x64@0.23.0': + optional: true + '@esbuild/darwin-arm64@0.18.20': optional: true @@ -4597,6 +4765,9 @@ snapshots: '@esbuild/darwin-arm64@0.21.5': optional: true + '@esbuild/darwin-arm64@0.23.0': + optional: true + '@esbuild/darwin-x64@0.18.20': optional: true @@ -4606,6 +4777,9 @@ snapshots: '@esbuild/darwin-x64@0.21.5': optional: true + '@esbuild/darwin-x64@0.23.0': + optional: true + '@esbuild/freebsd-arm64@0.18.20': optional: true @@ -4615,6 +4789,9 @@ snapshots: '@esbuild/freebsd-arm64@0.21.5': optional: true + '@esbuild/freebsd-arm64@0.23.0': + optional: true + '@esbuild/freebsd-x64@0.18.20': optional: true @@ -4624,6 +4801,9 @@ snapshots: '@esbuild/freebsd-x64@0.21.5': optional: true + '@esbuild/freebsd-x64@0.23.0': + optional: true + '@esbuild/linux-arm64@0.18.20': optional: true @@ -4633,6 +4813,9 @@ snapshots: '@esbuild/linux-arm64@0.21.5': optional: true + '@esbuild/linux-arm64@0.23.0': + optional: true + '@esbuild/linux-arm@0.18.20': optional: true @@ -4642,6 +4825,9 @@ snapshots: '@esbuild/linux-arm@0.21.5': optional: true + '@esbuild/linux-arm@0.23.0': + optional: true + '@esbuild/linux-ia32@0.18.20': optional: true @@ -4651,6 +4837,9 @@ snapshots: '@esbuild/linux-ia32@0.21.5': optional: true + '@esbuild/linux-ia32@0.23.0': + optional: true + '@esbuild/linux-loong64@0.18.20': optional: true @@ -4660,6 +4849,9 @@ snapshots: '@esbuild/linux-loong64@0.21.5': optional: true + '@esbuild/linux-loong64@0.23.0': + optional: true + '@esbuild/linux-mips64el@0.18.20': optional: true @@ -4669,6 +4861,9 @@ snapshots: '@esbuild/linux-mips64el@0.21.5': optional: true + '@esbuild/linux-mips64el@0.23.0': + optional: true + '@esbuild/linux-ppc64@0.18.20': optional: true @@ -4678,6 +4873,9 @@ snapshots: '@esbuild/linux-ppc64@0.21.5': optional: true + '@esbuild/linux-ppc64@0.23.0': + optional: true + '@esbuild/linux-riscv64@0.18.20': optional: true @@ -4687,6 +4885,9 @@ snapshots: '@esbuild/linux-riscv64@0.21.5': optional: true + '@esbuild/linux-riscv64@0.23.0': + optional: true + '@esbuild/linux-s390x@0.18.20': optional: true @@ -4696,6 +4897,9 @@ snapshots: '@esbuild/linux-s390x@0.21.5': optional: true + '@esbuild/linux-s390x@0.23.0': + optional: true + '@esbuild/linux-x64@0.18.20': optional: true @@ -4705,6 +4909,9 @@ snapshots: '@esbuild/linux-x64@0.21.5': optional: true + '@esbuild/linux-x64@0.23.0': + optional: true + '@esbuild/netbsd-x64@0.18.20': optional: true @@ -4714,6 +4921,12 @@ snapshots: '@esbuild/netbsd-x64@0.21.5': optional: true + '@esbuild/netbsd-x64@0.23.0': + optional: true + + '@esbuild/openbsd-arm64@0.23.0': + optional: true + '@esbuild/openbsd-x64@0.18.20': optional: true @@ -4723,6 +4936,9 @@ snapshots: '@esbuild/openbsd-x64@0.21.5': optional: true + '@esbuild/openbsd-x64@0.23.0': + optional: true + '@esbuild/sunos-x64@0.18.20': optional: true @@ -4732,6 +4948,9 @@ snapshots: '@esbuild/sunos-x64@0.21.5': optional: true + '@esbuild/sunos-x64@0.23.0': + optional: true + '@esbuild/win32-arm64@0.18.20': optional: true @@ -4741,6 +4960,9 @@ snapshots: '@esbuild/win32-arm64@0.21.5': optional: true + '@esbuild/win32-arm64@0.23.0': + optional: true + '@esbuild/win32-ia32@0.18.20': optional: true @@ -4750,6 +4972,9 @@ snapshots: '@esbuild/win32-ia32@0.21.5': optional: true + '@esbuild/win32-ia32@0.23.0': + optional: true + '@esbuild/win32-x64@0.18.20': optional: true @@ -4759,6 +4984,9 @@ snapshots: '@esbuild/win32-x64@0.21.5': optional: true + '@esbuild/win32-x64@0.23.0': + optional: true + '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': dependencies: eslint: 8.57.0 @@ -4818,8 +5046,8 @@ snapshots: valibot: 0.31.1 optionalDependencies: '@types/json-schema': 7.0.15 - esbuild: 0.21.5 - esbuild-runner: 2.2.2(esbuild@0.21.5) + esbuild: 0.23.0 + esbuild-runner: 2.2.2(esbuild@0.23.0) optional: true '@hapi/hoek@9.3.0': @@ -5244,108 +5472,108 @@ snapshots: estree-walker: 2.0.2 picomatch: 2.3.1 - '@rollup/pluginutils@5.1.0(rollup@4.18.0)': + '@rollup/pluginutils@5.1.0(rollup@4.18.1)': dependencies: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.18.0 + rollup: 4.18.1 '@rollup/rollup-android-arm-eabi@4.17.2': optional: true - '@rollup/rollup-android-arm-eabi@4.18.0': + '@rollup/rollup-android-arm-eabi@4.18.1': optional: true '@rollup/rollup-android-arm64@4.17.2': optional: true - '@rollup/rollup-android-arm64@4.18.0': + '@rollup/rollup-android-arm64@4.18.1': optional: true '@rollup/rollup-darwin-arm64@4.17.2': optional: true - '@rollup/rollup-darwin-arm64@4.18.0': + '@rollup/rollup-darwin-arm64@4.18.1': optional: true '@rollup/rollup-darwin-x64@4.17.2': optional: true - '@rollup/rollup-darwin-x64@4.18.0': + '@rollup/rollup-darwin-x64@4.18.1': optional: true '@rollup/rollup-linux-arm-gnueabihf@4.17.2': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.18.0': + '@rollup/rollup-linux-arm-gnueabihf@4.18.1': optional: true '@rollup/rollup-linux-arm-musleabihf@4.17.2': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.18.0': + '@rollup/rollup-linux-arm-musleabihf@4.18.1': optional: true '@rollup/rollup-linux-arm64-gnu@4.17.2': optional: true - '@rollup/rollup-linux-arm64-gnu@4.18.0': + '@rollup/rollup-linux-arm64-gnu@4.18.1': optional: true '@rollup/rollup-linux-arm64-musl@4.17.2': optional: true - '@rollup/rollup-linux-arm64-musl@4.18.0': + '@rollup/rollup-linux-arm64-musl@4.18.1': optional: true '@rollup/rollup-linux-powerpc64le-gnu@4.17.2': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': + '@rollup/rollup-linux-powerpc64le-gnu@4.18.1': optional: true '@rollup/rollup-linux-riscv64-gnu@4.17.2': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.18.0': + '@rollup/rollup-linux-riscv64-gnu@4.18.1': optional: true '@rollup/rollup-linux-s390x-gnu@4.17.2': optional: true - '@rollup/rollup-linux-s390x-gnu@4.18.0': + '@rollup/rollup-linux-s390x-gnu@4.18.1': optional: true '@rollup/rollup-linux-x64-gnu@4.17.2': optional: true - '@rollup/rollup-linux-x64-gnu@4.18.0': + '@rollup/rollup-linux-x64-gnu@4.18.1': optional: true '@rollup/rollup-linux-x64-musl@4.17.2': optional: true - '@rollup/rollup-linux-x64-musl@4.18.0': + '@rollup/rollup-linux-x64-musl@4.18.1': optional: true '@rollup/rollup-win32-arm64-msvc@4.17.2': optional: true - '@rollup/rollup-win32-arm64-msvc@4.18.0': + '@rollup/rollup-win32-arm64-msvc@4.18.1': optional: true '@rollup/rollup-win32-ia32-msvc@4.17.2': optional: true - '@rollup/rollup-win32-ia32-msvc@4.18.0': + '@rollup/rollup-win32-ia32-msvc@4.18.1': optional: true '@rollup/rollup-win32-x64-msvc@4.17.2': optional: true - '@rollup/rollup-win32-x64-msvc@4.18.0': + '@rollup/rollup-win32-x64-msvc@4.18.1': optional: true '@shuding/opentype.js@1.4.0-beta.0': @@ -5372,32 +5600,32 @@ snapshots: '@sodaru/yup-to-json-schema@2.0.1': optional: true - '@sveltejs/adapter-auto@3.2.2(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))': + '@sveltejs/adapter-auto@3.2.2(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))': dependencies: - '@sveltejs/kit': 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + '@sveltejs/kit': 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) import-meta-resolve: 4.1.0 - '@sveltejs/adapter-vercel@5.4.1(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))': + '@sveltejs/adapter-vercel@5.4.1(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))': dependencies: - '@sveltejs/kit': 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + '@sveltejs/kit': 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) '@vercel/nft': 0.27.2 esbuild: 0.21.5 transitivePeerDependencies: - encoding - supports-color - '@sveltejs/enhanced-img@0.3.0(rollup@4.18.0)(svelte@5.0.0-next.175)': + '@sveltejs/enhanced-img@0.3.0(rollup@4.18.1)(svelte@5.0.0-next.175)': dependencies: magic-string: 0.30.10 svelte-parse-markup: 0.1.5(svelte@5.0.0-next.175) - vite-imagetools: 7.0.2(rollup@4.18.0) + vite-imagetools: 7.0.2(rollup@4.18.1) transitivePeerDependencies: - rollup - svelte - '@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6))': + '@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) '@types/cookie': 0.6.0 cookie: 0.6.0 devalue: 5.0.0 @@ -5411,28 +5639,28 @@ snapshots: sirv: 2.0.4 svelte: 5.0.0-next.175 tiny-glob: 0.2.9 - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.6) + vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8) - '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6))': + '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) debug: 4.3.4 svelte: 5.0.0-next.175 - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.6) + vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6))': + '@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) debug: 4.3.4 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.10 svelte: 5.0.0-next.175 svelte-hmr: 0.16.0(svelte@5.0.0-next.175) - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.6) - vitefu: 0.2.5(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8) + vitefu: 0.2.5(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) transitivePeerDependencies: - supports-color @@ -5474,7 +5702,7 @@ snapshots: '@types/pug@2.0.10': {} - '@types/validator@13.11.9': + '@types/validator@13.12.0': optional: true '@typescript-eslint/eslint-plugin@7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0)(typescript@5.5.3)': @@ -5590,13 +5818,13 @@ snapshots: '@vinejs/vine@1.8.0': dependencies: '@poppinss/macroable': 1.0.2 - '@types/validator': 13.11.9 + '@types/validator': 13.12.0 '@vinejs/compiler': 2.5.0 camelcase: 8.0.0 dayjs: 1.11.11 dlv: 1.1.3 normalize-url: 8.0.1 - validator: 13.11.0 + validator: 13.12.0 optional: true '@vitest/expect@1.6.0': @@ -5987,7 +6215,7 @@ snapshots: dotenv@16.4.5: {} - drizzle-kit@0.22.8: + drizzle-kit@0.23.0: dependencies: '@esbuild-kit/esm-loader': 2.6.5 esbuild: 0.19.12 @@ -5995,7 +6223,7 @@ snapshots: transitivePeerDependencies: - supports-color - drizzle-orm@0.31.2(@neondatabase/serverless@0.9.4)(@types/pg@8.11.6)(pg@8.12.0)(postgres@3.4.4): + drizzle-orm@0.32.0(@neondatabase/serverless@0.9.4)(@types/pg@8.11.6)(pg@8.12.0)(postgres@3.4.4): optionalDependencies: '@neondatabase/serverless': 0.9.4 '@types/pg': 8.11.6 @@ -6025,9 +6253,9 @@ snapshots: transitivePeerDependencies: - supports-color - esbuild-runner@2.2.2(esbuild@0.21.5): + esbuild-runner@2.2.2(esbuild@0.23.0): dependencies: - esbuild: 0.21.5 + esbuild: 0.23.0 source-map-support: 0.5.21 tslib: 2.4.0 optional: true @@ -6109,6 +6337,34 @@ snapshots: '@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-x64': 0.21.5 + esbuild@0.23.0: + optionalDependencies: + '@esbuild/aix-ppc64': 0.23.0 + '@esbuild/android-arm': 0.23.0 + '@esbuild/android-arm64': 0.23.0 + '@esbuild/android-x64': 0.23.0 + '@esbuild/darwin-arm64': 0.23.0 + '@esbuild/darwin-x64': 0.23.0 + '@esbuild/freebsd-arm64': 0.23.0 + '@esbuild/freebsd-x64': 0.23.0 + '@esbuild/linux-arm': 0.23.0 + '@esbuild/linux-arm64': 0.23.0 + '@esbuild/linux-ia32': 0.23.0 + '@esbuild/linux-loong64': 0.23.0 + '@esbuild/linux-mips64el': 0.23.0 + '@esbuild/linux-ppc64': 0.23.0 + '@esbuild/linux-riscv64': 0.23.0 + '@esbuild/linux-s390x': 0.23.0 + '@esbuild/linux-x64': 0.23.0 + '@esbuild/netbsd-x64': 0.23.0 + '@esbuild/openbsd-arm64': 0.23.0 + '@esbuild/openbsd-x64': 0.23.0 + '@esbuild/sunos-x64': 0.23.0 + '@esbuild/win32-arm64': 0.23.0 + '@esbuild/win32-ia32': 0.23.0 + '@esbuild/win32-x64': 0.23.0 + optional: true + escalade@3.1.2: {} escape-html@1.0.3: {} @@ -6306,11 +6562,11 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - formsnap@1.0.1(svelte@5.0.0-next.175)(sveltekit-superforms@2.15.2(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)): + formsnap@1.0.1(svelte@5.0.0-next.175)(sveltekit-superforms@2.16.0(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)): dependencies: nanoid: 5.0.7 svelte: 5.0.0-next.175 - sveltekit-superforms: 2.15.2(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175) + sveltekit-superforms: 2.16.0(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175) fraction.js@4.3.7: {} @@ -6522,7 +6778,7 @@ snapshots: json-schema-to-ts@3.1.0: dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.8 ts-algebra: 2.0.0 optional: true @@ -6595,7 +6851,7 @@ snapshots: dependencies: oslo: 1.2.0 - lucide-svelte@0.390.0(svelte@5.0.0-next.175): + lucide-svelte@0.407.0(svelte@5.0.0-next.175): dependencies: svelte: 5.0.0-next.175 @@ -7257,7 +7513,8 @@ snapshots: reflect-metadata@0.1.14: {} - regenerator-runtime@0.14.1: {} + regenerator-runtime@0.14.1: + optional: true require-directory@2.1.1: {} @@ -7307,26 +7564,26 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.17.2 fsevents: 2.3.3 - rollup@4.18.0: + rollup@4.18.1: dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.18.0 - '@rollup/rollup-android-arm64': 4.18.0 - '@rollup/rollup-darwin-arm64': 4.18.0 - '@rollup/rollup-darwin-x64': 4.18.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.18.0 - '@rollup/rollup-linux-arm-musleabihf': 4.18.0 - '@rollup/rollup-linux-arm64-gnu': 4.18.0 - '@rollup/rollup-linux-arm64-musl': 4.18.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.18.0 - '@rollup/rollup-linux-riscv64-gnu': 4.18.0 - '@rollup/rollup-linux-s390x-gnu': 4.18.0 - '@rollup/rollup-linux-x64-gnu': 4.18.0 - '@rollup/rollup-linux-x64-musl': 4.18.0 - '@rollup/rollup-win32-arm64-msvc': 4.18.0 - '@rollup/rollup-win32-ia32-msvc': 4.18.0 - '@rollup/rollup-win32-x64-msvc': 4.18.0 + '@rollup/rollup-android-arm-eabi': 4.18.1 + '@rollup/rollup-android-arm64': 4.18.1 + '@rollup/rollup-darwin-arm64': 4.18.1 + '@rollup/rollup-darwin-x64': 4.18.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.18.1 + '@rollup/rollup-linux-arm-musleabihf': 4.18.1 + '@rollup/rollup-linux-arm64-gnu': 4.18.1 + '@rollup/rollup-linux-arm64-musl': 4.18.1 + '@rollup/rollup-linux-powerpc64le-gnu': 4.18.1 + '@rollup/rollup-linux-riscv64-gnu': 4.18.1 + '@rollup/rollup-linux-s390x-gnu': 4.18.1 + '@rollup/rollup-linux-x64-gnu': 4.18.1 + '@rollup/rollup-linux-x64-musl': 4.18.1 + '@rollup/rollup-win32-arm64-msvc': 4.18.1 + '@rollup/rollup-win32-ia32-msvc': 4.18.1 + '@rollup/rollup-win32-x64-msvc': 4.18.1 fsevents: 2.3.3 optional: true @@ -7347,7 +7604,7 @@ snapshots: mkdirp: 0.5.6 rimraf: 2.7.1 - sass@1.77.6: + sass@1.77.8: dependencies: chokidar: 3.6.0 immutable: 4.3.5 @@ -7517,7 +7774,7 @@ snapshots: pirates: 4.0.6 ts-interface-checker: 0.1.13 - superstruct@1.0.4: + superstruct@2.0.2: optional: true supports-color@7.2.0: @@ -7526,14 +7783,14 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-check@3.8.4(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.6)(svelte@5.0.0-next.175): + svelte-check@3.8.4(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.8)(svelte@5.0.0-next.175): dependencies: '@jridgewell/trace-mapping': 0.3.25 chokidar: 3.6.0 picocolors: 1.0.0 sade: 1.8.1 svelte: 5.0.0-next.175 - svelte-preprocess: 5.1.4(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.6)(svelte@5.0.0-next.175)(typescript@5.5.3) + svelte-preprocess: 5.1.4(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.8)(svelte@5.0.0-next.175)(typescript@5.5.3) typescript: 5.5.3 transitivePeerDependencies: - '@babel/core' @@ -7589,7 +7846,7 @@ snapshots: dependencies: svelte: 5.0.0-next.175 - svelte-preprocess@5.1.4(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.6)(svelte@5.0.0-next.175)(typescript@5.5.3): + svelte-preprocess@5.1.4(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.8)(svelte@5.0.0-next.175)(typescript@5.5.3): dependencies: '@types/pug': 2.0.10 detect-indent: 6.1.0 @@ -7600,18 +7857,16 @@ snapshots: optionalDependencies: postcss: 8.4.39 postcss-load-config: 5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2) - sass: 1.77.6 + sass: 1.77.8 typescript: 5.5.3 - svelte-preprocess@6.0.1(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.6)(svelte@5.0.0-next.175)(typescript@5.5.3): + svelte-preprocess@6.0.2(postcss-load-config@5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2))(postcss@8.4.39)(sass@1.77.8)(svelte@5.0.0-next.175)(typescript@5.5.3): dependencies: - detect-indent: 6.1.0 - strip-indent: 3.0.0 svelte: 5.0.0-next.175 optionalDependencies: postcss: 8.4.39 postcss-load-config: 5.1.0(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2) - sass: 1.77.6 + sass: 1.77.8 typescript: 5.5.3 svelte-render@2.0.1(svelte@5.0.0-next.175): @@ -7665,19 +7920,19 @@ snapshots: magic-string: 0.30.10 zimmerframe: 1.1.2 - sveltekit-flash-message@2.4.4(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175): + sveltekit-flash-message@2.4.4(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175): dependencies: - '@sveltejs/kit': 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + '@sveltejs/kit': 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) svelte: 5.0.0-next.175 - sveltekit-rate-limiter@0.5.1(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6))): + sveltekit-rate-limiter@0.5.1(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8))): dependencies: '@isaacs/ttlcache': 1.4.1 - '@sveltejs/kit': 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + '@sveltejs/kit': 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) - sveltekit-superforms@2.15.2(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175): + sveltekit-superforms@2.16.0(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175): dependencies: - '@sveltejs/kit': 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)) + '@sveltejs/kit': 2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)))(svelte@5.0.0-next.175)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)) devalue: 5.0.0 just-clone: 6.2.0 memoize-weak: 1.0.2 @@ -7692,7 +7947,7 @@ snapshots: arktype: 2.0.0-dev.21 joi: 17.13.3 json-schema-to-ts: 3.1.0 - superstruct: 1.0.4 + superstruct: 2.0.2 valibot: 0.35.0 yup: 1.4.0 zod: 3.23.8 @@ -7700,13 +7955,11 @@ snapshots: tabbable@6.2.0: {} - tailwind-merge@2.3.0: - dependencies: - '@babel/runtime': 7.24.5 + tailwind-merge@2.4.0: {} tailwind-variants@0.2.1(tailwindcss@3.4.4(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3))): dependencies: - tailwind-merge: 2.3.0 + tailwind-merge: 2.4.0 tailwindcss: 3.4.4(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) tailwindcss-animate@1.0.7(tailwindcss@3.4.4(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3))): @@ -7879,23 +8132,23 @@ snapshots: valibot@0.35.0: optional: true - validator@13.11.0: + validator@13.12.0: optional: true - vite-imagetools@7.0.2(rollup@4.18.0): + vite-imagetools@7.0.2(rollup@4.18.1): dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.0) + '@rollup/pluginutils': 5.1.0(rollup@4.18.1) imagetools-core: 7.0.0 transitivePeerDependencies: - rollup - vite-node@1.6.0(@types/node@20.14.10)(sass@1.77.6): + vite-node@1.6.0(@types/node@20.14.10)(sass@1.77.8): dependencies: cac: 6.7.14 debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.6) + vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8) transitivePeerDependencies: - '@types/node' - less @@ -7906,7 +8159,7 @@ snapshots: - supports-color - terser - vite@5.3.3(@types/node@20.14.10)(sass@1.77.6): + vite@5.3.3(@types/node@20.14.10)(sass@1.77.8): dependencies: esbuild: 0.21.5 postcss: 8.4.39 @@ -7914,13 +8167,13 @@ snapshots: optionalDependencies: '@types/node': 20.14.10 fsevents: 2.3.3 - sass: 1.77.6 + sass: 1.77.8 - vitefu@0.2.5(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)): + vitefu@0.2.5(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)): optionalDependencies: - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.6) + vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8) - vitest@1.6.0(@types/node@20.14.10)(sass@1.77.6): + vitest@1.6.0(@types/node@20.14.10)(sass@1.77.8): dependencies: '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 @@ -7939,8 +8192,8 @@ snapshots: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.6) - vite-node: 1.6.0(@types/node@20.14.10)(sass@1.77.6) + vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8) + vite-node: 1.6.0(@types/node@20.14.10)(sass@1.77.8) why-is-node-running: 2.2.2 optionalDependencies: '@types/node': 20.14.10 diff --git a/src/db/migrate.ts b/src/db/migrate.ts index b891b47..a1198be 100644 --- a/src/db/migrate.ts +++ b/src/db/migrate.ts @@ -23,5 +23,4 @@ try { console.error(e); } -// await connection.end(); process.exit(); diff --git a/src/db/migrations/0000_premium_pepper_potts.sql b/src/db/migrations/0000_dazzling_stick.sql similarity index 83% rename from src/db/migrations/0000_premium_pepper_potts.sql rename to src/db/migrations/0000_dazzling_stick.sql index 1541eee..d02362e 100644 --- a/src/db/migrations/0000_premium_pepper_potts.sql +++ b/src/db/migrations/0000_dazzling_stick.sql @@ -1,10 +1,16 @@ +DO $$ BEGIN + CREATE TYPE "public"."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 DEFAULT gen_random_uuid() NOT NULL, "cuid" text, "name" text, "slug" text, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "categories_cuid_unique" UNIQUE("cuid") ); --> statement-breakpoint @@ -26,8 +32,8 @@ CREATE TABLE IF NOT EXISTS "collection_items" ( "collection_id" uuid NOT NULL, "game_id" uuid NOT NULL, "times_played" integer DEFAULT 0, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "collection_items_cuid_unique" UNIQUE("cuid") ); --> statement-breakpoint @@ -36,8 +42,8 @@ CREATE TABLE IF NOT EXISTS "collections" ( "cuid" text, "user_id" uuid NOT NULL, "name" text DEFAULT 'My Collection' NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "collections_cuid_unique" UNIQUE("cuid") ); --> statement-breakpoint @@ -46,15 +52,15 @@ CREATE TABLE IF NOT EXISTS "expansions" ( "cuid" text, "base_game_id" uuid NOT NULL, "game_id" uuid NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "expansions_cuid_unique" UNIQUE("cuid") ); --> statement-breakpoint CREATE TABLE IF NOT EXISTS "external_ids" ( "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, "cuid" text, - "type" "external_id_type" NOT NULL, + "type" "external_id_type", "external_id" text NOT NULL, CONSTRAINT "external_ids_cuid_unique" UNIQUE("cuid") ); @@ -76,8 +82,8 @@ CREATE TABLE IF NOT EXISTS "games" ( "thumb_url" text, "url" text, "last_sync_at" timestamp, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "games_cuid_unique" UNIQUE("cuid") ); --> statement-breakpoint @@ -92,8 +98,8 @@ CREATE TABLE IF NOT EXISTS "mechanics" ( "cuid" text, "name" text, "slug" text, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "mechanics_cuid_unique" UNIQUE("cuid") ); --> statement-breakpoint @@ -113,7 +119,8 @@ CREATE TABLE IF NOT EXISTS "password_reset_tokens" ( "id" text PRIMARY KEY NOT NULL, "user_id" uuid NOT NULL, "expires_at" timestamp, - "created_at" timestamp DEFAULT now() NOT NULL + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL ); --> statement-breakpoint CREATE TABLE IF NOT EXISTS "publishers" ( @@ -121,8 +128,8 @@ CREATE TABLE IF NOT EXISTS "publishers" ( "cuid" text, "name" text, "slug" text, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "publishers_cuid_unique" UNIQUE("cuid") ); --> statement-breakpoint @@ -143,16 +150,16 @@ CREATE TABLE IF NOT EXISTS "recovery_codes" ( "user_id" uuid NOT NULL, "code" text NOT NULL, "used" boolean DEFAULT false, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL ); --> statement-breakpoint CREATE TABLE IF NOT EXISTS "roles" ( "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, "cuid" text NOT NULL, "name" text NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "roles_cuid_unique" UNIQUE("cuid"), CONSTRAINT "roles_name_unique" UNIQUE("name") ); @@ -167,14 +174,27 @@ CREATE TABLE IF NOT EXISTS "sessions" ( "is_two_factor_authenticated" boolean DEFAULT false ); --> statement-breakpoint +CREATE TABLE IF NOT EXISTS "two_factor" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "cuid" text, + "two_factor_secret" text NOT NULL, + "two_factor_enabled" boolean DEFAULT false NOT NULL, + "initiated_time" timestamp with time zone NOT NULL, + "user_id" uuid NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, + CONSTRAINT "two_factor_cuid_unique" UNIQUE("cuid"), + CONSTRAINT "two_factor_user_id_unique" UNIQUE("user_id") +); +--> statement-breakpoint CREATE TABLE IF NOT EXISTS "user_roles" ( "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, "cuid" text, "user_id" uuid NOT NULL, "role_id" uuid NOT NULL, "primary" boolean DEFAULT false, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "user_roles_cuid_unique" UNIQUE("cuid") ); --> statement-breakpoint @@ -189,10 +209,8 @@ CREATE TABLE IF NOT EXISTS "users" ( "verified" boolean DEFAULT false, "receive_email" boolean DEFAULT false, "theme" text DEFAULT 'system', - "two_factor_secret" text DEFAULT '', - "two_factor_enabled" boolean DEFAULT false, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "users_cuid_unique" UNIQUE("cuid"), CONSTRAINT "users_username_unique" UNIQUE("username"), CONSTRAINT "users_email_unique" UNIQUE("email") @@ -203,8 +221,8 @@ CREATE TABLE IF NOT EXISTS "wishlist_items" ( "cuid" text, "wishlist_id" uuid NOT NULL, "game_id" uuid NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "wishlist_items_cuid_unique" UNIQUE("cuid") ); --> statement-breakpoint @@ -213,8 +231,8 @@ CREATE TABLE IF NOT EXISTS "wishlists" ( "cuid" text, "user_id" uuid NOT NULL, "name" text DEFAULT 'My Wishlist' NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "wishlists_cuid_unique" UNIQUE("cuid") ); --> statement-breakpoint @@ -350,6 +368,12 @@ EXCEPTION WHEN duplicate_object THEN null; END $$; --> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "two_factor" ADD CONSTRAINT "two_factor_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."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 "public"."users"("id") ON DELETE cascade ON UPDATE no action; EXCEPTION diff --git a/src/db/migrations/0001_noisy_sally_floyd.sql b/src/db/migrations/0001_noisy_sally_floyd.sql new file mode 100644 index 0000000..5809aa6 --- /dev/null +++ b/src/db/migrations/0001_noisy_sally_floyd.sql @@ -0,0 +1,2 @@ +ALTER TABLE "two_factor" RENAME COLUMN "two_factor_secret" TO "secret";--> statement-breakpoint +ALTER TABLE "two_factor" RENAME COLUMN "two_factor_enabled" TO "enabled"; \ No newline at end of file diff --git a/src/db/migrations/0001_spicy_legion.sql b/src/db/migrations/0001_spicy_legion.sql deleted file mode 100644 index c76ac6c..0000000 --- a/src/db/migrations/0001_spicy_legion.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "external_ids" ALTER COLUMN "type" DROP NOT NULL; \ No newline at end of file diff --git a/src/db/migrations/0002_fancy_valkyrie.sql b/src/db/migrations/0002_fancy_valkyrie.sql new file mode 100644 index 0000000..e05cd36 --- /dev/null +++ b/src/db/migrations/0002_fancy_valkyrie.sql @@ -0,0 +1 @@ +ALTER TABLE "two_factor" ALTER COLUMN "initiated_time" DROP NOT NULL; \ No newline at end of file diff --git a/src/db/migrations/0002_third_black_tom.sql b/src/db/migrations/0002_third_black_tom.sql deleted file mode 100644 index d281ba1..0000000 --- a/src/db/migrations/0002_third_black_tom.sql +++ /dev/null @@ -1,5 +0,0 @@ -DO $$ BEGIN - CREATE TYPE "public"."external_id_type" AS ENUM('game', 'category', 'mechanic', 'publisher', 'designer', 'artist'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/src/db/migrations/0003_premium_ravenous.sql b/src/db/migrations/0003_premium_ravenous.sql deleted file mode 100644 index d78d1af..0000000 --- a/src/db/migrations/0003_premium_ravenous.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "users" ADD COLUMN "initiated_time" timestamp; \ No newline at end of file diff --git a/src/db/migrations/0004_glossy_gideon.sql b/src/db/migrations/0004_glossy_gideon.sql deleted file mode 100644 index bb2198d..0000000 --- a/src/db/migrations/0004_glossy_gideon.sql +++ /dev/null @@ -1,24 +0,0 @@ -CREATE TABLE IF NOT EXISTS "two_factor" ( - "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, - "cuid" text, - "two_factor_secret" text NOT NULL, - "two_factor_enabled" boolean DEFAULT false NOT NULL, - "initiated_time" timestamp with time zone NOT NULL, - "user_id" text NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "two_factor_cuid_unique" UNIQUE("cuid"), - CONSTRAINT "two_factor_user_id_unique" UNIQUE("user_id") -); ---> statement-breakpoint -ALTER TABLE "users" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint -ALTER TABLE "users" ALTER COLUMN "updated_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "two_factor" ADD CONSTRAINT "two_factor_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "users" DROP COLUMN IF EXISTS "two_factor_secret";--> statement-breakpoint -ALTER TABLE "users" DROP COLUMN IF EXISTS "two_factor_enabled";--> statement-breakpoint -ALTER TABLE "users" DROP COLUMN IF EXISTS "initiated_time"; \ No newline at end of file diff --git a/src/db/migrations/meta/0000_snapshot.json b/src/db/migrations/meta/0000_snapshot.json index e4cc64c..91e2a6e 100644 --- a/src/db/migrations/meta/0000_snapshot.json +++ b/src/db/migrations/meta/0000_snapshot.json @@ -1,5 +1,5 @@ { - "id": "7871a9e4-6916-4122-b200-42a9f21d4c8d", + "id": "e120d11a-bf28-4c96-9f2f-96e23e23c7e2", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", @@ -35,14 +35,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -213,14 +213,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -298,14 +298,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -369,14 +369,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -444,7 +444,7 @@ "type": "external_id_type", "typeSchema": "public", "primaryKey": false, - "notNull": true + "notNull": false }, "external_id": { "name": "external_id", @@ -569,14 +569,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -699,14 +699,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -863,7 +863,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -919,14 +926,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1091,14 +1098,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1148,14 +1155,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1249,6 +1256,97 @@ "compositePrimaryKeys": {}, "uniqueConstraints": {} }, + "public.two_factor": { + "name": "two_factor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "two_factor_secret": { + "name": "two_factor_secret", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "two_factor_enabled": { + "name": "two_factor_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "initiated_time": { + "name": "initiated_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "two_factor_user_id_users_id_fk": { + "name": "two_factor_user_id_users_id_fk", + "tableFrom": "two_factor", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "two_factor_cuid_unique": { + "name": "two_factor_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, + "two_factor_user_id_unique": { + "name": "two_factor_user_id_unique", + "nullsNotDistinct": false, + "columns": [ + "user_id" + ] + } + } + }, "public.user_roles": { "name": "user_roles", "schema": "", @@ -1287,14 +1385,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1408,30 +1506,16 @@ "notNull": false, "default": "'system'" }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "''" - }, - "two_factor_enabled": { - "name": "two_factor_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1495,14 +1579,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1580,14 +1664,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1621,7 +1705,20 @@ } } }, - "enums": {}, + "enums": { + "public.external_id_type": { + "name": "external_id_type", + "schema": "public", + "values": [ + "game", + "category", + "mechanic", + "publisher", + "designer", + "artist" + ] + } + }, "schemas": {}, "_meta": { "columns": {}, diff --git a/src/db/migrations/meta/0001_snapshot.json b/src/db/migrations/meta/0001_snapshot.json index 51ab72f..4de88b6 100644 --- a/src/db/migrations/meta/0001_snapshot.json +++ b/src/db/migrations/meta/0001_snapshot.json @@ -1,6 +1,6 @@ { - "id": "c4b2e9ac-5e60-4de1-b860-eb11e4ca6bd6", - "prevId": "7871a9e4-6916-4122-b200-42a9f21d4c8d", + "id": "52e7c416-89cb-4c6a-9118-68a03cfc2920", + "prevId": "e120d11a-bf28-4c96-9f2f-96e23e23c7e2", "version": "7", "dialect": "postgresql", "tables": { @@ -35,14 +35,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -213,14 +213,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -298,14 +298,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -369,14 +369,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -569,14 +569,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -699,14 +699,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -863,7 +863,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -919,14 +926,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1091,14 +1098,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1148,14 +1155,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1249,6 +1256,97 @@ "compositePrimaryKeys": {}, "uniqueConstraints": {} }, + "public.two_factor": { + "name": "two_factor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "initiated_time": { + "name": "initiated_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "two_factor_user_id_users_id_fk": { + "name": "two_factor_user_id_users_id_fk", + "tableFrom": "two_factor", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "two_factor_cuid_unique": { + "name": "two_factor_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, + "two_factor_user_id_unique": { + "name": "two_factor_user_id_unique", + "nullsNotDistinct": false, + "columns": [ + "user_id" + ] + } + } + }, "public.user_roles": { "name": "user_roles", "schema": "", @@ -1287,14 +1385,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1408,30 +1506,16 @@ "notNull": false, "default": "'system'" }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "''" - }, - "two_factor_enabled": { - "name": "two_factor_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1495,14 +1579,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1580,14 +1664,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1621,7 +1705,20 @@ } } }, - "enums": {}, + "enums": { + "public.external_id_type": { + "name": "external_id_type", + "schema": "public", + "values": [ + "game", + "category", + "mechanic", + "publisher", + "designer", + "artist" + ] + } + }, "schemas": {}, "_meta": { "columns": {}, diff --git a/src/db/migrations/meta/0002_snapshot.json b/src/db/migrations/meta/0002_snapshot.json index 51155f3..8f50271 100644 --- a/src/db/migrations/meta/0002_snapshot.json +++ b/src/db/migrations/meta/0002_snapshot.json @@ -1,6 +1,6 @@ { - "id": "43322acf-8c50-4c6d-9575-df44978be5a0", - "prevId": "c4b2e9ac-5e60-4de1-b860-eb11e4ca6bd6", + "id": "79adee85-e57c-4a9f-87df-835457b68129", + "prevId": "52e7c416-89cb-4c6a-9118-68a03cfc2920", "version": "7", "dialect": "postgresql", "tables": { @@ -35,14 +35,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -213,14 +213,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -298,14 +298,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -369,14 +369,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -569,14 +569,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -699,14 +699,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -863,7 +863,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -919,14 +926,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1091,14 +1098,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1148,14 +1155,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1249,6 +1256,97 @@ "compositePrimaryKeys": {}, "uniqueConstraints": {} }, + "public.two_factor": { + "name": "two_factor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "cuid": { + "name": "cuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "initiated_time": { + "name": "initiated_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "two_factor_user_id_users_id_fk": { + "name": "two_factor_user_id_users_id_fk", + "tableFrom": "two_factor", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "two_factor_cuid_unique": { + "name": "two_factor_cuid_unique", + "nullsNotDistinct": false, + "columns": [ + "cuid" + ] + }, + "two_factor_user_id_unique": { + "name": "two_factor_user_id_unique", + "nullsNotDistinct": false, + "columns": [ + "user_id" + ] + } + } + }, "public.user_roles": { "name": "user_roles", "schema": "", @@ -1287,14 +1385,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1408,30 +1506,16 @@ "notNull": false, "default": "'system'" }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "''" - }, - "two_factor_enabled": { - "name": "two_factor_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1495,14 +1579,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -1580,14 +1664,14 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" diff --git a/src/db/migrations/meta/0003_snapshot.json b/src/db/migrations/meta/0003_snapshot.json deleted file mode 100644 index 9a1fb4a..0000000 --- a/src/db/migrations/meta/0003_snapshot.json +++ /dev/null @@ -1,1650 +0,0 @@ -{ - "id": "a4a37fea-b4d3-4dd5-a650-63ef3c55a585", - "prevId": "43322acf-8c50-4c6d-9575-df44978be5a0", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "categories_cuid_unique": { - "name": "categories_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.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": {} - }, - "public.categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "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": {} - }, - "public.collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "collection_id": { - "name": "collection_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "primaryKey": false, - "notNull": true, - "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": { - "collection_items_cuid_unique": { - "name": "collection_items_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'My Collection'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "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": { - "collections_cuid_unique": { - "name": "collections_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "base_game_id": { - "name": "base_game_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "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_cuid_unique": { - "name": "expansions_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "external_id_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "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" - ] - } - } - }, - "public.games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "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": "text", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "search_index": { - "name": "search_index", - "columns": [ - { - "expression": "(\n\t\t\t\tsetweight(to_tsvector('english', \"name\"), 'A') ||\n setweight(to_tsvector('english', \"slug\"), 'B')\n )", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "games_cuid_unique": { - "name": "games_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.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": {} - }, - "public.mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "mechanics_cuid_unique": { - "name": "mechanics_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.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": {} - }, - "public.mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "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": {} - }, - "public.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", - "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": {} - }, - "public.publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "publishers_cuid_unique": { - "name": "publishers_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.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": {} - }, - "public.publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "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": {} - }, - "public.recovery_codes": { - "name": "recovery_codes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "code": { - "name": "code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "used": { - "name": "used", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "recovery_codes_user_id_users_id_fk": { - "name": "recovery_codes_user_id_users_id_fk", - "tableFrom": "recovery_codes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_cuid_unique": { - "name": "roles_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - }, - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "public.sessions": { - "name": "sessions", - "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 with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "two_factor_auth_enabled": { - "name": "two_factor_auth_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "is_two_factor_authenticated": { - "name": "is_two_factor_authenticated", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": 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": {} - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "primary": { - "name": "primary", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "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": { - "user_roles_cuid_unique": { - "name": "user_roles_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "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": "text", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "''" - }, - "two_factor_enabled": { - "name": "two_factor_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "initiated_time": { - "name": "initiated_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "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, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "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": { - "wishlist_items_cuid_unique": { - "name": "wishlist_items_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'My Wishlist'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "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": { - "wishlists_cuid_unique": { - "name": "wishlists_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - } - }, - "enums": { - "public.external_id_type": { - "name": "external_id_type", - "schema": "public", - "values": [ - "game", - "category", - "mechanic", - "publisher", - "designer", - "artist" - ] - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/src/db/migrations/meta/0004_snapshot.json b/src/db/migrations/meta/0004_snapshot.json deleted file mode 100644 index 06d5686..0000000 --- a/src/db/migrations/meta/0004_snapshot.json +++ /dev/null @@ -1,1721 +0,0 @@ -{ - "id": "70591483-9e82-41c2-a76d-a2a67174a191", - "prevId": "a4a37fea-b4d3-4dd5-a650-63ef3c55a585", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.categories": { - "name": "categories", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "categories_cuid_unique": { - "name": "categories_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.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": {} - }, - "public.categories_to_games": { - "name": "categories_to_games", - "schema": "", - "columns": { - "category_id": { - "name": "category_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "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": {} - }, - "public.collection_items": { - "name": "collection_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "collection_id": { - "name": "collection_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "primaryKey": false, - "notNull": true, - "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": { - "collection_items_cuid_unique": { - "name": "collection_items_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'My Collection'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "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": { - "collections_cuid_unique": { - "name": "collections_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.expansions": { - "name": "expansions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "base_game_id": { - "name": "base_game_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "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_cuid_unique": { - "name": "expansions_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.external_ids": { - "name": "external_ids", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "external_id_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "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" - ] - } - } - }, - "public.games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "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": "text", - "primaryKey": false, - "notNull": false - }, - "thumb_url": { - "name": "thumb_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_sync_at": { - "name": "last_sync_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "search_index": { - "name": "search_index", - "columns": [ - { - "expression": "(\n\t\t\t\tsetweight(to_tsvector('english', \"name\"), 'A') ||\n setweight(to_tsvector('english', \"slug\"), 'B')\n )", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "games_cuid_unique": { - "name": "games_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.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": {} - }, - "public.mechanics": { - "name": "mechanics", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "mechanics_cuid_unique": { - "name": "mechanics_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.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": {} - }, - "public.mechanics_to_games": { - "name": "mechanics_to_games", - "schema": "", - "columns": { - "mechanic_id": { - "name": "mechanic_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "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": {} - }, - "public.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", - "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": {} - }, - "public.publishers": { - "name": "publishers", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "publishers_cuid_unique": { - "name": "publishers_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.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": {} - }, - "public.publishers_to_games": { - "name": "publishers_to_games", - "schema": "", - "columns": { - "publisher_id": { - "name": "publisher_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "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": {} - }, - "public.recovery_codes": { - "name": "recovery_codes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "code": { - "name": "code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "used": { - "name": "used", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "recovery_codes_user_id_users_id_fk": { - "name": "recovery_codes_user_id_users_id_fk", - "tableFrom": "recovery_codes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_cuid_unique": { - "name": "roles_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - }, - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - } - }, - "public.sessions": { - "name": "sessions", - "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 with time zone", - "primaryKey": false, - "notNull": true - }, - "ip_country": { - "name": "ip_country", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ip_address": { - "name": "ip_address", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "two_factor_auth_enabled": { - "name": "two_factor_auth_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "is_two_factor_authenticated": { - "name": "is_two_factor_authenticated", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": 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": {} - }, - "public.two_factor": { - "name": "two_factor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "two_factor_enabled": { - "name": "two_factor_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "initiated_time": { - "name": "initiated_time", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "two_factor_user_id_users_id_fk": { - "name": "two_factor_user_id_users_id_fk", - "tableFrom": "two_factor", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "two_factor_cuid_unique": { - "name": "two_factor_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - }, - "two_factor_user_id_unique": { - "name": "two_factor_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - } - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "primary": { - "name": "primary", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "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": { - "user_roles_cuid_unique": { - "name": "user_roles_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "hashed_password": { - "name": "hashed_password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "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": "text", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "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, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.wishlist_items": { - "name": "wishlist_items", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "wishlist_id": { - "name": "wishlist_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "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": { - "wishlist_items_cuid_unique": { - "name": "wishlist_items_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - }, - "public.wishlists": { - "name": "wishlists", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "cuid": { - "name": "cuid", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'My Wishlist'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "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": { - "wishlists_cuid_unique": { - "name": "wishlists_cuid_unique", - "nullsNotDistinct": false, - "columns": [ - "cuid" - ] - } - } - } - }, - "enums": { - "public.external_id_type": { - "name": "external_id_type", - "schema": "public", - "values": [ - "game", - "category", - "mechanic", - "publisher", - "designer", - "artist" - ] - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/src/db/migrations/meta/_journal.json b/src/db/migrations/meta/_journal.json index 195db5d..18ded62 100644 --- a/src/db/migrations/meta/_journal.json +++ b/src/db/migrations/meta/_journal.json @@ -5,36 +5,22 @@ { "idx": 0, "version": "7", - "when": 1718402690897, - "tag": "0000_premium_pepper_potts", + "when": 1720625651245, + "tag": "0000_dazzling_stick", "breakpoints": true }, { "idx": 1, "version": "7", - "when": 1718404319259, - "tag": "0001_spicy_legion", + "when": 1720625948784, + "tag": "0001_noisy_sally_floyd", "breakpoints": true }, { "idx": 2, "version": "7", - "when": 1718405257084, - "tag": "0002_third_black_tom", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1720415770693, - "tag": "0003_premium_ravenous", - "breakpoints": true - }, - { - "idx": 4, - "version": "7", - "when": 1720454952583, - "tag": "0004_glossy_gideon", + "when": 1720626020902, + "tag": "0002_fancy_valkyrie", "breakpoints": true } ] diff --git a/src/db/schema/categories.ts b/src/db/schema/categories.ts index e0f88cc..5936858 100644 --- a/src/db/schema/categories.ts +++ b/src/db/schema/categories.ts @@ -1,8 +1,9 @@ -import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; +import { pgTable, text, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import categoriesToExternalIds from './categoriesToExternalIds'; import categories_to_games from './categoriesToGames'; +import { timestamps } from '../utils'; const categories = pgTable('categories', { id: uuid('id').primaryKey().defaultRandom(), @@ -11,8 +12,7 @@ const categories = pgTable('categories', { .$defaultFn(() => cuid2()), name: text('name'), slug: text('slug'), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export type Categories = InferSelectModel; diff --git a/src/db/schema/collectionItems.ts b/src/db/schema/collectionItems.ts index 7ab9859..cf1805c 100644 --- a/src/db/schema/collectionItems.ts +++ b/src/db/schema/collectionItems.ts @@ -1,8 +1,9 @@ -import { integer, pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; +import { integer, pgTable, text, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import collections from './collections'; import games from './games'; +import { timestamps } from '../utils'; const collection_items = pgTable('collection_items', { id: uuid('id').primaryKey().defaultRandom(), @@ -16,8 +17,7 @@ const collection_items = pgTable('collection_items', { .notNull() .references(() => games.id, { onDelete: 'cascade' }), times_played: integer('times_played').default(0), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export type CollectionItems = InferSelectModel; diff --git a/src/db/schema/collections.ts b/src/db/schema/collections.ts index 91949c0..6ff9916 100644 --- a/src/db/schema/collections.ts +++ b/src/db/schema/collections.ts @@ -2,6 +2,7 @@ import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import users from './users'; +import { timestamps } from '../utils'; const collections = pgTable('collections', { id: uuid('id').primaryKey().defaultRandom(), @@ -12,8 +13,7 @@ const collections = pgTable('collections', { .notNull() .references(() => users.id, { onDelete: 'cascade' }), name: text('name').notNull().default('My Collection'), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export const collection_relations = relations(collections, ({ one }) => ({ diff --git a/src/db/schema/expansions.ts b/src/db/schema/expansions.ts index c8162e3..bdbf2e3 100644 --- a/src/db/schema/expansions.ts +++ b/src/db/schema/expansions.ts @@ -2,6 +2,7 @@ import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import games from './games'; +import { timestamps } from '../utils'; export const expansions = pgTable('expansions', { id: uuid('id').primaryKey().defaultRandom(), @@ -14,8 +15,7 @@ export const expansions = pgTable('expansions', { game_id: uuid('game_id') .notNull() .references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export type Expansions = InferSelectModel; diff --git a/src/db/schema/games.ts b/src/db/schema/games.ts index 3feab97..91d5cfa 100644 --- a/src/db/schema/games.ts +++ b/src/db/schema/games.ts @@ -5,6 +5,7 @@ import categoriesToGames from './categoriesToGames'; import gamesToExternalIds from './gamesToExternalIds'; import mechanicsToGames from './mechanicsToGames'; import publishersToGames from './publishersToGames'; +import { timestamps } from '../utils'; const games = pgTable( 'games', @@ -27,8 +28,7 @@ const games = pgTable( thumb_url: text('thumb_url'), url: text('url'), last_sync_at: timestamp('last_sync_at'), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }, (table) => ({ searchIndex: index('search_index').using( diff --git a/src/db/schema/mechanics.ts b/src/db/schema/mechanics.ts index 1f2944e..3a80fb0 100644 --- a/src/db/schema/mechanics.ts +++ b/src/db/schema/mechanics.ts @@ -1,8 +1,9 @@ -import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; +import { pgTable, text, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import mechanicsToGames from './mechanicsToGames'; import mechanicsToExternalIds from './mechanicsToExternalIds'; +import { timestamps } from '../utils'; const mechanics = pgTable('mechanics', { id: uuid('id').primaryKey().defaultRandom(), @@ -11,8 +12,7 @@ const mechanics = pgTable('mechanics', { .$defaultFn(() => cuid2()), name: text('name'), slug: text('slug'), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export type Mechanics = InferSelectModel; diff --git a/src/db/schema/passwordResetTokens.ts b/src/db/schema/passwordResetTokens.ts index af7afeb..7d0a18d 100644 --- a/src/db/schema/passwordResetTokens.ts +++ b/src/db/schema/passwordResetTokens.ts @@ -2,6 +2,7 @@ import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import users from './users'; +import { timestamps } from '../utils'; const password_reset_tokens = pgTable('password_reset_tokens', { id: text('id') @@ -11,7 +12,7 @@ const password_reset_tokens = pgTable('password_reset_tokens', { .notNull() .references(() => users.id, { onDelete: 'cascade' }), expires_at: timestamp('expires_at'), - created_at: timestamp('created_at').notNull().defaultNow(), + ...timestamps, }); export type PasswordResetTokens = InferSelectModel; diff --git a/src/db/schema/publishers.ts b/src/db/schema/publishers.ts index 989bef8..b83a3ef 100644 --- a/src/db/schema/publishers.ts +++ b/src/db/schema/publishers.ts @@ -1,8 +1,9 @@ -import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; +import { pgTable, text, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import publishers_to_games from './publishersToGames'; import publishersToExternalIds from './publishersToExternalIds'; +import { timestamps } from '../utils'; const publishers = pgTable('publishers', { id: uuid('id').primaryKey().defaultRandom(), @@ -11,8 +12,7 @@ const publishers = pgTable('publishers', { .$defaultFn(() => cuid2()), name: text('name'), slug: text('slug'), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export type Publishers = InferSelectModel; diff --git a/src/db/schema/recoveryCodes.ts b/src/db/schema/recoveryCodes.ts index 904d8ea..c5433c0 100644 --- a/src/db/schema/recoveryCodes.ts +++ b/src/db/schema/recoveryCodes.ts @@ -1,6 +1,7 @@ -import { boolean, pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; +import { boolean, pgTable, text, uuid } from 'drizzle-orm/pg-core'; import type { InferSelectModel } from 'drizzle-orm'; import users from './users'; +import { timestamps } from '../utils'; const recovery_codes = pgTable('recovery_codes', { id: uuid('id').primaryKey().defaultRandom(), @@ -9,8 +10,7 @@ const recovery_codes = pgTable('recovery_codes', { .references(() => users.id), code: text('code').notNull(), used: boolean('used').default(false), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export type RecoveryCodes = InferSelectModel; diff --git a/src/db/schema/roles.ts b/src/db/schema/roles.ts index 65b1b05..43768b0 100644 --- a/src/db/schema/roles.ts +++ b/src/db/schema/roles.ts @@ -1,7 +1,8 @@ -import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; +import { pgTable, text, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import user_roles from './userRoles'; +import { timestamps } from '../utils'; const roles = pgTable('roles', { id: uuid('id').primaryKey().defaultRandom(), @@ -10,8 +11,7 @@ const roles = pgTable('roles', { .$defaultFn(() => cuid2()) .notNull(), name: text('name').unique().notNull(), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export type Roles = InferSelectModel; diff --git a/src/db/schema/two-factor.table.ts b/src/db/schema/two-factor.table.ts index e3bf254..a01262f 100644 --- a/src/db/schema/two-factor.table.ts +++ b/src/db/schema/two-factor.table.ts @@ -1,22 +1,21 @@ import { createId as cuid2 } from '@paralleldrive/cuid2'; -import { relations } from 'drizzle-orm'; +import { type InferSelectModel, relations } from 'drizzle-orm'; import { boolean, pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; import { timestamps } from '../utils'; import users from './users'; const twoFactorTable = pgTable('two_factor', { - id: uuid('id') - .primaryKey().defaultRandom(), + id: uuid('id').primaryKey().defaultRandom(), cuid: text('cuid') .unique() .$defaultFn(() => cuid2()), - two_factor_secret: text('two_factor_secret').notNull(), - two_factor_enabled: boolean('two_factor_enabled').notNull().default(false), - initiated_time: timestamp('initiated_time', { + secret: text('secret').notNull(), + enabled: boolean('enabled').notNull().default(false), + initiatedTime: timestamp('initiated_time', { mode: 'date', withTimezone: true, - }).notNull(), - userId: text('user_id') + }), + userId: uuid('user_id') .notNull() .references(() => users.id) .unique(), @@ -32,4 +31,4 @@ export const emailVerificationsRelations = relations(twoFactorTable, ({ one }) = export type TwoFactor = InferSelectModel; -export default twoFactorTable; \ No newline at end of file +export default twoFactorTable; diff --git a/src/db/schema/userRoles.ts b/src/db/schema/userRoles.ts index 735f78b..3a87ca9 100644 --- a/src/db/schema/userRoles.ts +++ b/src/db/schema/userRoles.ts @@ -1,8 +1,9 @@ -import { boolean, pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; +import { boolean, pgTable, text, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import users from './users'; import roles from './roles'; +import { timestamps } from '../utils'; const user_roles = pgTable('user_roles', { id: uuid('id').primaryKey().defaultRandom(), @@ -16,8 +17,7 @@ const user_roles = pgTable('user_roles', { .notNull() .references(() => roles.id, { onDelete: 'cascade' }), primary: boolean('primary').default(false), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export const user_role_relations = relations(user_roles, ({ one }) => ({ diff --git a/src/db/schema/wishlistItems.ts b/src/db/schema/wishlistItems.ts index 13be952..ac4bc61 100644 --- a/src/db/schema/wishlistItems.ts +++ b/src/db/schema/wishlistItems.ts @@ -1,8 +1,9 @@ -import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; +import { pgTable, text, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import wishlists from './wishlists'; import games from './games'; +import { timestamps } from '../utils'; const wishlist_items = pgTable('wishlist_items', { id: uuid('id').primaryKey().defaultRandom(), @@ -15,8 +16,7 @@ const wishlist_items = pgTable('wishlist_items', { game_id: uuid('game_id') .notNull() .references(() => games.id, { onDelete: 'cascade' }), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export type WishlistItems = InferSelectModel; diff --git a/src/db/schema/wishlists.ts b/src/db/schema/wishlists.ts index 74aeb2e..db0c327 100644 --- a/src/db/schema/wishlists.ts +++ b/src/db/schema/wishlists.ts @@ -1,7 +1,8 @@ -import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core'; +import { pgTable, text, uuid } from 'drizzle-orm/pg-core'; import { createId as cuid2 } from '@paralleldrive/cuid2'; import { type InferSelectModel, relations } from 'drizzle-orm'; import users from './users'; +import { timestamps } from '../utils'; const wishlists = pgTable('wishlists', { id: uuid('id').primaryKey().defaultRandom(), @@ -12,8 +13,7 @@ const wishlists = pgTable('wishlists', { .notNull() .references(() => users.id, { onDelete: 'cascade' }), name: text('name').notNull().default('My Wishlist'), - created_at: timestamp('created_at').notNull().defaultNow(), - updated_at: timestamp('updated_at').notNull().defaultNow(), + ...timestamps, }); export type Wishlists = InferSelectModel; diff --git a/src/env.ts b/src/env.ts index d50f4ab..40a31e9 100644 --- a/src/env.ts +++ b/src/env.ts @@ -17,6 +17,7 @@ const EnvSchema = z.object({ DATABASE_PORT: z.coerce.number(), DATABASE_DB: z.string(), DATABASE_URL: z.string(), + PUBLIC_SITE_NAME: z.string(), PUBLIC_SITE_URL: z.string(), PUBLIC_UMAMI_DO_NOT_TRACK: z.string(), PUBLIC_UMAMI_ID: z.string(), diff --git a/src/routes/(app)/(protected)/profile/+page.server.ts b/src/routes/(app)/(protected)/profile/+page.server.ts index 5d0ff87..18ea6ad 100644 --- a/src/routes/(app)/(protected)/profile/+page.server.ts +++ b/src/routes/(app)/(protected)/profile/+page.server.ts @@ -8,7 +8,7 @@ import { changeEmailSchema, profileSchema } from '$lib/validations/account'; import { notSignedInMessage } from '$lib/flashMessages'; import db from '../../../../db'; import type { PageServerLoad } from './$types'; -import { users } from '$db/schema'; +import { users, twoFactor } from '$db/schema'; import { userNotAuthenticated } from '$lib/server/auth-utils'; export const load: PageServerLoad = async (event) => { @@ -35,10 +35,14 @@ export const load: PageServerLoad = async (event) => { }, }); + const twoFactorDetails = await db.query.twoFactor.findFirst({ + where: eq(twoFactor.userId, dbUser!.id!), + }); + return { profileForm, emailForm, - hasSetupTwoFactor: !!dbUser?.two_factor_enabled, + hasSetupTwoFactor: !!twoFactorDetails?.enabled, }; }; diff --git a/src/routes/(app)/(protected)/profile/security/two-factor/+page.server.ts b/src/routes/(app)/(protected)/profile/security/two-factor/+page.server.ts index 93faaa0..38bca3d 100644 --- a/src/routes/(app)/(protected)/profile/security/two-factor/+page.server.ts +++ b/src/routes/(app)/(protected)/profile/security/two-factor/+page.server.ts @@ -1,9 +1,10 @@ -import { type Actions, fail } from '@sveltejs/kit'; +import { type Actions, fail, error } from '@sveltejs/kit'; import { eq } from 'drizzle-orm'; import { encodeHex, decodeHex } from 'oslo/encoding'; import { Argon2id } from 'oslo/password'; import { createTOTPKeyURI, TOTPController } from 'oslo/otp'; import { HMAC } from 'oslo/crypto'; +import kebabCase from 'just-kebab-case'; import QRCode from 'qrcode'; import { zod } from 'sveltekit-superforms/adapters'; import { setError, superValidate } from 'sveltekit-superforms/server'; @@ -12,8 +13,9 @@ import type { PageServerLoad } from '../../$types'; import { addTwoFactorSchema, removeTwoFactorSchema } from '$lib/validations/account'; import { notSignedInMessage } from '$lib/flashMessages'; import db from '../../../../../../db'; -import { recoveryCodes, users } from '$db/schema'; +import { recoveryCodes, twoFactor, users } from '$db/schema'; import { userNotAuthenticated } from '$lib/server/auth-utils'; +import env from '../../../../../../env'; export const load: PageServerLoad = async (event) => { const addTwoFactorForm = await superValidate(event, zod(addTwoFactorSchema)); @@ -29,7 +31,11 @@ export const load: PageServerLoad = async (event) => { where: eq(users.id, user!.id!), }); - if (dbUser?.two_factor_enabled) { + const twoFactorDetails = await db.query.twoFactor.findFirst({ + where: eq(twoFactor.userId, dbUser!.id!), + }); + + if (twoFactorDetails?.enabled) { return { addTwoFactorForm, removeTwoFactorForm, @@ -39,17 +45,31 @@ export const load: PageServerLoad = async (event) => { qrCode: '', }; } - const twoFactorSecret = await new HMAC('SHA-1').generateKey(); - await db - .update(users) - .set({ - two_factor_secret: encodeHex(twoFactorSecret), - two_factor_enabled: false, - }) - .where(eq(users.id, user!.id!)); - const issuer = 'bored-game'; - const accountName = user!.email! || user!.username!; + const twoFactorSecret = await new HMAC('SHA-1').generateKey(); + + try { + await db + .insert(twoFactor) + .values({ + secret: encodeHex(twoFactorSecret), + enabled: false, + userId: dbUser!.id!, + }) + .onConflictDoUpdate({ + target: twoFactor.userId, + set: { + secret: encodeHex(twoFactorSecret), + enabled: false, + }, + }); + } catch (e) { + console.error(e); + error(500); + } + + const issuer = kebabCase(env.PUBLIC_SITE_NAME); + const accountName = dbUser!.email! || dbUser!.username!; // pass the website's name and the user identifier (e.g. email, username) const totpUri = createTOTPKeyURI(issuer, accountName, twoFactorSecret); @@ -104,7 +124,20 @@ export const actions: Actions = { ); } - if (dbUser?.two_factor_secret === '' || dbUser?.two_factor_secret === null) { + const twoFactorDetails = await db.query.twoFactor.findFirst({ + where: eq(twoFactor.userId, dbUser?.id), + }); + + if (!twoFactorDetails) { + addTwoFactorForm.data.current_password = ''; + addTwoFactorForm.data.two_factor_code = ''; + return setError( + addTwoFactorForm, + 'Error occurred. Please try again or contact support if you need further help.', + ); + } + + if (twoFactorDetails.secret === '' || twoFactorDetails.secret === null) { addTwoFactorForm.data.current_password = ''; addTwoFactorForm.data.two_factor_code = ''; return setError( @@ -129,19 +162,20 @@ export const actions: Actions = { const twoFactorCode = addTwoFactorForm.data.two_factor_code; const validOTP = await new TOTPController().verify( twoFactorCode, - decodeHex(dbUser.two_factor_secret), + decodeHex(twoFactorDetails.secret), ); if (!validOTP) { return setError(addTwoFactorForm, 'two_factor_code', 'Invalid code'); } - await db.update(users).set({ two_factor_enabled: true }).where(eq(users.id, user!.id!)); + await db.update(twoFactor).set({ enabled: true }).where(eq(twoFactor.userId, user!.id!)); redirect(302, '/profile/security/two-factor/recovery-codes'); }, disableTwoFactor: async (event) => { - const { cookies } = event; + const { locals } = event; + const { user, session } = locals; const removeTwoFactorForm = await superValidate(event, zod(removeTwoFactorSchema)); if (!removeTwoFactorForm.valid) { @@ -150,16 +184,12 @@ export const actions: Actions = { }); } - if (!event.locals.user) { - redirect(302, '/login', notSignedInMessage, event); + if (!user || !session) { + return fail(401, { + removeTwoFactorForm, + }); } - if (!event.locals.session) { - return fail(401); - } - - const user = event.locals.user; - const dbUser = await db.query.users.findFirst({ where: eq(users.id, user.id), }); @@ -181,16 +211,28 @@ export const actions: Actions = { return setError(removeTwoFactorForm, 'current_password', 'Your password is incorrect'); } - await db - .update(users) - .set({ two_factor_enabled: false, two_factor_secret: null }) - .where(eq(users.id, user.id)); + const twoFactorDetails = await db.query.twoFactor.findFirst({ + where: eq(twoFactor.userId, dbUser.id), + }); + + if (!twoFactorDetails) { + return fail(500, { + removeTwoFactorForm, + }); + } + + await db.update(twoFactor).set({ enabled: false }).where(eq(twoFactor.userId, user.id)); await db.delete(recoveryCodes).where(eq(recoveryCodes.userId, user.id)); // setFlash({ type: 'success', message: 'Two-Factor Authentication has been disabled.' }, cookies); - redirect(302, '/profile/security/two-factor', { - type: 'success', - message: 'Two-Factor Authentication has been disabled.', - }, event); + redirect( + 302, + '/profile/security/two-factor', + { + type: 'success', + message: 'Two-Factor Authentication has been disabled.', + }, + event, + ); }, }; diff --git a/src/routes/(app)/(protected)/profile/security/two-factor/recovery-codes/+page.server.ts b/src/routes/(app)/(protected)/profile/security/two-factor/recovery-codes/+page.server.ts index 02096ad..74a2820 100644 --- a/src/routes/(app)/(protected)/profile/security/two-factor/recovery-codes/+page.server.ts +++ b/src/routes/(app)/(protected)/profile/security/two-factor/recovery-codes/+page.server.ts @@ -5,7 +5,7 @@ import { alphabet, generateRandomString } from 'oslo/crypto'; import { redirect } from 'sveltekit-flash-message/server'; import { notSignedInMessage } from '$lib/flashMessages'; import type { PageServerLoad } from '../../../$types'; -import { recoveryCodes, users } from '$db/schema'; +import {recoveryCodes, twoFactor, users} from '$db/schema'; import { userNotAuthenticated } from '$lib/server/auth-utils'; export const load: PageServerLoad = async (event) => { @@ -19,7 +19,11 @@ export const load: PageServerLoad = async (event) => { where: eq(users.id, user!.id), }); - if (dbUser?.two_factor_enabled) { + const twoFactorDetails = await db.query.twoFactor.findFirst({ + where: eq(twoFactor.userId, dbUser!.id), + }); + + if (twoFactorDetails?.enabled) { const dbRecoveryCodes = await db.query.recoveryCodes.findMany({ where: eq(recoveryCodes.userId, user!.id), }); @@ -46,6 +50,7 @@ export const load: PageServerLoad = async (event) => { recoveryCodes: [], }; } else { + console.error('2FA not enabled'); redirect( 302, '/profile', diff --git a/src/routes/(auth)/login/+page.server.ts b/src/routes/(auth)/login/+page.server.ts index e5ace19..9173289 100644 --- a/src/routes/(auth)/login/+page.server.ts +++ b/src/routes/(auth)/login/+page.server.ts @@ -1,5 +1,5 @@ import { fail, error, type Actions } from '@sveltejs/kit'; -import { and, eq } from 'drizzle-orm'; +import { eq } from 'drizzle-orm'; import { Argon2id } from 'oslo/password'; import { zod } from 'sveltekit-superforms/adapters'; import { setError, superValidate } from 'sveltekit-superforms/server'; @@ -8,7 +8,7 @@ import { RateLimiter } from 'sveltekit-rate-limiter/server'; import db from '../../../db'; import { lucia } from '$lib/server/auth'; import { signInSchema } from '$lib/validations/auth'; -import { users, type Users } from '$db/schema'; +import { twoFactor, users, type Users } from '$db/schema'; import type { PageServerLoad } from './$types'; import { userFullyAuthenticated, userNotFullyAuthenticated } from '$lib/server/auth-utils'; @@ -66,6 +66,8 @@ export const actions: Actions = { return setError(form, 'username', 'Your username or password is incorrect.'); } + let twoFactorDetails; + try { const password = form.data.password; console.log('user', JSON.stringify(user, null, 2)); @@ -85,21 +87,33 @@ export const actions: Actions = { console.log('ip', locals.ip); console.log('country', locals.country); - await db - .update(users) - .set({ - initiated_time: new Date(), - }); - session = await lucia.createSession(user.id, { - ip_country: locals.country, - ip_address: locals.ip, - twoFactorAuthEnabled: - user?.two_factor_enabled && - user?.two_factor_secret !== null && - user?.two_factor_secret !== '', - isTwoFactorAuthenticated: false, + twoFactorDetails = await db.query.twoFactor.findFirst({ + where: eq(twoFactor.userId, user?.id), }); + + if (twoFactorDetails?.secret && twoFactorDetails?.enabled) { + await db.update(twoFactor).set({ + initiated_time: new Date(), + }); + + session = await lucia.createSession(user.id, { + ip_country: locals.country, + ip_address: locals.ip, + twoFactorAuthEnabled: + twoFactorDetails?.enabled && + twoFactorDetails?.secret !== null && + twoFactorDetails?.secret !== '', + isTwoFactorAuthenticated: false, + }); + } else { + session = await lucia.createSession(user.id, { + ip_country: locals.country, + ip_address: locals.ip, + twoFactorAuthEnabled: false, + isTwoFactorAuthenticated: false, + }); + } console.log('logging in session', session); sessionCookie = lucia.createSessionCookie(session.id); console.log('logging in session cookie', sessionCookie); @@ -120,9 +134,9 @@ export const actions: Actions = { form.data.password = ''; if ( - user?.two_factor_enabled && - user?.two_factor_secret !== null && - user?.two_factor_secret !== '' + twoFactorDetails?.enabled && + twoFactorDetails?.secret !== null && + twoFactorDetails?.secret !== '' ) { console.log('redirecting to TOTP page'); const message = { type: 'success', message: 'Please enter your TOTP code.' } as const; diff --git a/src/routes/(auth)/login/+page.svelte b/src/routes/(auth)/login/+page.svelte index 0a7d981..a0a9232 100644 --- a/src/routes/(auth)/login/+page.svelte +++ b/src/routes/(auth)/login/+page.svelte @@ -28,8 +28,8 @@ }, syncFlashMessage: false, taintedMessage: null, - validators: zodClient(signInSchema), - validationMethod: 'oninput', + // validators: zodClient(signInSchema), + // validationMethod: 'oninput', delayMs: 0, }); diff --git a/src/routes/(auth)/totp/+page.server.ts b/src/routes/(auth)/totp/+page.server.ts index 71ad791..b141372 100644 --- a/src/routes/(auth)/totp/+page.server.ts +++ b/src/routes/(auth)/totp/+page.server.ts @@ -7,13 +7,13 @@ 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 { TWO_FACTOR_TIMEOUT } from '../env'; import db from '../../../db'; import { lucia } from '$lib/server/auth'; import { totpSchema } from '$lib/validations/auth'; -import { users, recoveryCodes } from '$db/schema'; +import { users, twoFactor, recoveryCodes } from '$db/schema'; import type { PageServerLoad } from './$types'; import { notSignedInMessage } from '$lib/flashMessages'; +import { TWO_FACTOR_TIMEOUT } from '../../../env'; export const load: PageServerLoad = async (event) => { const { user, session } = event.locals; @@ -27,8 +27,12 @@ export const load: PageServerLoad = async (event) => { where: eq(users.username, user.username), }); + const twoFactorDetails = await db.query.twoFactor.findFirst({ + where: eq(twoFactor.userId, dbUser!.id!), + }); + // Check if two factor started less than TWO_FACTOR_TIMEOUT - if (Date.now() - dbUser?.initiated_time > TWO_FACTOR_TIMEOUT) { + if (Date.now() - twoFactorDetails?.initiatedTime > TWO_FACTOR_TIMEOUT) { const message = { type: 'error', message: 'Two factor authentication has expired' } as const; redirect(302, '/login', message, event); } @@ -40,8 +44,8 @@ export const load: PageServerLoad = async (event) => { if ( isTwoFactorAuthenticated && - dbUser?.two_factor_enabled && - dbUser?.two_factor_secret !== '' + twoFactorDetails?.enabled && + twoFactorDetails?.secret !== '' ) { const message = { type: 'success', message: 'You are already signed in' } as const; throw redirect('/', message, event); @@ -83,11 +87,14 @@ export const actions: Actions = { } const isTwoFactorAuthenticated = session?.isTwoFactorAuthenticated; + const twoFactorDetails = await db.query.twoFactor.findFirst({ + where: eq(twoFactor.userId, dbUser!.id!), + }) if ( isTwoFactorAuthenticated && - dbUser?.two_factor_enabled && - dbUser?.two_factor_secret !== '' + twoFactorDetails?.enabled && + twoFactorDetails?.secret !== '' ) { const message = { type: 'success', message: 'You are already signed in' } as const; throw redirect('/', message, event); @@ -107,8 +114,8 @@ export const actions: Actions = { const totpToken = form?.data?.totpToken; const twoFactorSecretPopulated = - dbUser?.two_factor_secret !== '' && dbUser?.two_factor_secret !== null; - if (dbUser?.two_factor_enabled && !twoFactorSecretPopulated && !totpToken) { + twoFactorDetails?.secret !== '' && twoFactorDetails?.secret !== null; + if (twoFactorDetails.enabled && !twoFactorSecretPopulated && !totpToken) { return fail(400, { form, }); @@ -116,7 +123,7 @@ export const actions: Actions = { console.log('totpToken', totpToken); const validOTP = await new TOTPController().verify( totpToken, - decodeHex(dbUser.two_factor_secret ?? ''), + decodeHex(twoFactorDetails.secret ?? ''), ); console.log('validOTP', validOTP);