From 8ad09ab9c8c0b29e10b4a3623da38d0dd79d15d4 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Wed, 17 Dec 2025 11:41:32 +0100 Subject: [PATCH] Implement PostgreSQL support and update database configuration: Migrate from SQLite to PostgreSQL by updating the Prisma schema, Docker configuration, and environment variables. Add PostgreSQL dependencies and adjust the database connection logic in the application. Enhance .gitignore to exclude PostgreSQL-related files and directories. --- .gitignore | 6 + Dockerfile | 16 +- MIGRATION_POSTGRES.md | 82 +++ docker-compose.yml | 34 +- lib/prisma.ts | 9 +- package.json | 3 + pnpm-lock.yaml | 142 +++++ prisma/generated/prisma/commonInputTypes.ts | 172 +++--- prisma/generated/prisma/internal/class.ts | 8 +- .../prisma/internal/prismaNamespace.ts | 67 +++ .../prisma/internal/prismaNamespaceBrowser.ts | 11 + prisma/generated/prisma/models/Challenge.ts | 6 + prisma/generated/prisma/models/Event.ts | 2 + .../generated/prisma/models/EventFeedback.ts | 4 + .../prisma/models/EventRegistration.ts | 4 + .../prisma/models/SitePreferences.ts | 2 + prisma/generated/prisma/models/User.ts | 2 + .../prisma/models/UserPreferences.ts | 2 + .../20251209055617_init/migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration_lock.toml | 3 + .../migration.sql | 200 +++++++ prisma/migrations/migration_lock.toml | 2 +- prisma/schema.prisma | 2 +- prisma/seed.ts | 9 +- scripts/README-MIGRATION.md | 70 +++ scripts/migrate-sqlite-to-postgres.ts | 489 ++++++++++++++++++ 45 files changed, 1238 insertions(+), 109 deletions(-) create mode 100644 MIGRATION_POSTGRES.md rename prisma/{migrations => migrations.sqlite.backup}/20251209055617_init/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251209073256_add_site_preferences/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251209204709_add_event_registrations/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251209205650_add_bio_to_user/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251209210032_add_character_class/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251210042344_add_event_details_fields/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251210043000_change_event_date_to_datetime/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251210044500_remove_event_status_field/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251210045000_update_event_types/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251210054646_update_event_types/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251210060319_add_event_feedback/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251210120000_add_event_feedback/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251212093056_add_primary_color/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251215140148_add_challenges/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251215170000_remove_primary_color/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251215202319_add_challenges_background/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251216153031_add_event_registration_points/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251216153510_add_event_feedback_points/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251216153605_change_feedback_points_default_to_100/migration.sql (100%) rename prisma/{migrations => migrations.sqlite.backup}/20251216154133_add_feedback_is_read/migration.sql (100%) create mode 100644 prisma/migrations.sqlite.backup/migration_lock.toml create mode 100644 prisma/migrations/20251217101717_init_postgres/migration.sql create mode 100644 scripts/README-MIGRATION.md create mode 100644 scripts/migrate-sqlite-to-postgres.ts diff --git a/.gitignore b/.gitignore index cc21f11..e0c4486 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,9 @@ dev.db* # prisma /app/generated/prisma +prisma/generated/ + +# database data +data/postgres/ +data/*.db +data/*.db-journal diff --git a/Dockerfile b/Dockerfile index 1f23be2..0276fd7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN corepack enable && corepack prepare pnpm@latest --activate COPY --from=deps /app/node_modules ./node_modules COPY . . -ENV DATABASE_URL="file:/tmp/build.db" +ENV DATABASE_URL="postgresql://user:pass@localhost:5432/db" RUN pnpm prisma generate ENV NEXT_TELEMETRY_DISABLED=1 @@ -47,27 +47,24 @@ COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml COPY --from=builder /app/next.config.js ./next.config.js COPY --from=builder /app/prisma ./prisma COPY --from=builder /app/prisma.config.ts ./prisma.config.ts +COPY --from=builder /app/scripts ./scripts -ENV DATABASE_URL="file:/tmp/build.db" +ENV DATABASE_URL="postgresql://user:pass@localhost:5432/db" # Installer seulement les dépendances de production puis générer Prisma Client RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \ pnpm install --frozen-lockfile --prod && \ pnpm dlx prisma generate -ENV DATABASE_URL="file:/app/data/dev.db" - -# Create data directory for SQLite database and uploads directories -RUN mkdir -p /app/data /app/public/uploads /app/public/uploads/backgrounds && \ - chown -R nextjs:nodejs /app/data /app/public/uploads +# Create uploads directories +RUN mkdir -p /app/public/uploads /app/public/uploads/backgrounds && \ + chown -R nextjs:nodejs /app/public/uploads RUN echo '#!/bin/sh' > /app/entrypoint.sh && \ echo 'set -e' >> /app/entrypoint.sh && \ - echo 'mkdir -p /app/data' >> /app/entrypoint.sh && \ echo 'mkdir -p /app/public/uploads' >> /app/entrypoint.sh && \ echo 'mkdir -p /app/public/uploads/backgrounds' >> /app/entrypoint.sh && \ echo 'pnpm dlx prisma migrate deploy || true' >> /app/entrypoint.sh && \ - echo 'pnpm dlx prisma db push || true' >> /app/entrypoint.sh && \ echo 'exec pnpm start' >> /app/entrypoint.sh && \ chmod +x /app/entrypoint.sh && \ chown nextjs:nodejs /app/entrypoint.sh @@ -77,6 +74,5 @@ USER nextjs EXPOSE 3000 ENV PORT=3000 ENV HOSTNAME="0.0.0.0" -ENV DATABASE_URL="file:/app/data/dev.db" ENTRYPOINT ["./entrypoint.sh"] \ No newline at end of file diff --git a/MIGRATION_POSTGRES.md b/MIGRATION_POSTGRES.md new file mode 100644 index 0000000..c48dcdb --- /dev/null +++ b/MIGRATION_POSTGRES.md @@ -0,0 +1,82 @@ +# Migration vers PostgreSQL + +## Changements effectués + +✅ Schema Prisma modifié pour PostgreSQL +✅ Code retiré Better SQLite adapter +✅ Docker Compose configuré avec service PostgreSQL +✅ Dockerfile mis à jour +✅ Dépendances retirées (better-sqlite3) + +## Prochaines étapes + +### 1. Démarrer PostgreSQL en local (pour dev) + +```bash +# Option 1: Docker Compose +docker-compose up postgres -d + +# Option 2: PostgreSQL local +# Installer PostgreSQL puis créer la DB +createdb gotgaming +``` + +### 2. Configurer DATABASE_URL + +Créer un fichier `.env.local` avec : +``` +DATABASE_URL="postgresql://gotgaming:password@localhost:5432/gotgaming?schema=public" +``` + +### 3. Créer la migration initiale + +```bash +pnpm prisma migrate dev --name init_postgres +``` + +### 4. Migrer les données SQLite → PostgreSQL (si nécessaire) + +Si tu as des données existantes dans SQLite : + +```bash +# Exporter SQLite +sqlite3 data/dev.db .dump > sqlite_dump.sql + +# Adapter le dump pour PostgreSQL (changer les types, syntaxe) +# Puis importer dans PostgreSQL +psql gotgaming < adapted_dump.sql +``` + +Ou utiliser un outil comme `pgloader` : +```bash +pgloader sqlite://data/dev.db postgresql://gotgaming:password@localhost:5432/gotgaming +``` + +### 5. En production (Docker Compose) + +```bash +# Démarrer tous les services +docker-compose up -d + +# Les migrations seront appliquées automatiquement au démarrage via entrypoint.sh +``` + +## Variables d'environnement Docker + +Ajouter dans ton `.env` ou docker-compose.yml : + +```env +POSTGRES_USER=gotgaming +POSTGRES_PASSWORD=change-this-in-production +POSTGRES_DB=gotgaming +POSTGRES_DATA_PATH=./data/postgres +``` + +## Avantages de PostgreSQL + +- ✅ Pool de connexions natif (plus de timeout après inactivité) +- ✅ Concurrence réelle (pas de verrous de fichier) +- ✅ Meilleures performances en production +- ✅ Backups plus simples (`pg_dump`) +- ✅ Scaling horizontal possible + diff --git a/docker-compose.yml b/docker-compose.yml index 1277570..e6d6364 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,31 @@ version: "3.8" services: + got-postgres: + image: postgres:15-alpine + container_name: got-mc-postgres + environment: + POSTGRES_USER: ${POSTGRES_USER:-gotgaming} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change-this-in-production} + POSTGRES_DB: ${POSTGRES_DB:-gotgaming} + POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C" + volumes: + - ${POSTGRES_DATA_PATH:-./data/postgres}:/var/lib/postgresql/data + ports: + - "5433:5432" + restart: unless-stopped + command: postgres -c max_connections=100 -c shared_buffers=256MB -c effective_cache_size=1GB + healthcheck: + test: + [ + "CMD-SHELL", + "pg_isready -U ${POSTGRES_USER:-gotgaming} -d ${POSTGRES_DB:-gotgaming}", + ] + interval: 5s + timeout: 3s + retries: 10 + start_period: 10s + got-app: build: context: . @@ -10,15 +35,18 @@ services: - "3040:3000" environment: - NODE_ENV=production - - DATABASE_URL=file:/app/data/dev.db + - DATABASE_URL=postgresql://${POSTGRES_USER:-gotgaming}:${POSTGRES_PASSWORD:-change-this-in-production}@got-postgres:5432/${POSTGRES_DB:-gotgaming}?schema=public - NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3000} - NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-change-this-secret-in-production} volumes: - # Persist database (override DATA_PATH env var to change location) - - ${PRISMA_DATA_PATH:-/Volumes/EXTERNAL_USB/sites/got-gaming/data}:/app/data + # Persist SQLite database (pour migration) + - ${PRISMA_DATA_PATH:-./data}:/app/data # Persist uploaded images (avatars and backgrounds) - ${UPLOADS_PATH:-./public/uploads}:/app/public/uploads - ./prisma/migrations:/app/prisma/migrations + depends_on: + got-postgres: + condition: service_healthy restart: unless-stopped labels: - "com.centurylinklabs.watchtower.enable=false" diff --git a/lib/prisma.ts b/lib/prisma.ts index bf9a9e1..94bf7d8 100644 --- a/lib/prisma.ts +++ b/lib/prisma.ts @@ -1,10 +1,13 @@ import { PrismaClient } from "@/prisma/generated/prisma/client"; -import { PrismaBetterSqlite3 } from "@prisma/adapter-better-sqlite3"; +import { PrismaPg } from "@prisma/adapter-pg"; +import { Pool } from "pg"; -const adapter = new PrismaBetterSqlite3({ - url: process.env.DATABASE_URL || "file:./data/dev.db", +const pool = new Pool({ + connectionString: process.env.DATABASE_URL, }); +const adapter = new PrismaPg(pool); + const globalForPrisma = globalThis as unknown as { prisma: PrismaClient | undefined; }; diff --git a/package.json b/package.json index 3597a91..089f10b 100644 --- a/package.json +++ b/package.json @@ -22,12 +22,14 @@ ] }, "dependencies": { + "@prisma/adapter-pg": "^7.1.0", "@prisma/adapter-better-sqlite3": "^7.1.0", "@prisma/client": "^7.1.0", "bcryptjs": "^3.0.3", "better-sqlite3": "^12.5.0", "next": "15.5.9", "next-auth": "5.0.0-beta.30", + "pg": "^8.16.3", "react": "^19.0.0", "react-dom": "^19.0.0" }, @@ -36,6 +38,7 @@ "@types/bcryptjs": "^3.0.0", "@types/better-sqlite3": "^7.6.13", "@types/node": "^22.0.0", + "@types/pg": "^8.16.0", "@types/react": "^19.0.0", "@types/react-dom": "^19.0.0", "@typescript-eslint/eslint-plugin": "^8.49.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0002754..2ff7a97 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: '@prisma/adapter-better-sqlite3': specifier: ^7.1.0 version: 7.1.0 + '@prisma/adapter-pg': + specifier: ^7.1.0 + version: 7.1.0 '@prisma/client': specifier: ^7.1.0 version: 7.1.0(prisma@7.1.0(@types/react@19.2.7)(better-sqlite3@12.5.0)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)(typescript@5.9.3))(typescript@5.9.3) @@ -26,6 +29,9 @@ importers: next-auth: specifier: 5.0.0-beta.30 version: 5.0.0-beta.30(next@15.5.9(@babel/core@7.28.5)(react-dom@19.2.1(react@19.2.1))(react@19.2.1))(react@19.2.1) + pg: + specifier: ^8.16.3 + version: 8.16.3 react: specifier: ^19.0.0 version: 19.2.1 @@ -45,6 +51,9 @@ importers: '@types/node': specifier: ^22.0.0 version: 22.19.1 + '@types/pg': + specifier: ^8.16.0 + version: 8.16.0 '@types/react': specifier: ^19.0.0 version: 19.2.7 @@ -671,6 +680,9 @@ packages: '@prisma/adapter-better-sqlite3@7.1.0': resolution: {integrity: sha512-Ex4CimAONWMoUrhU27lpGXb4MdX/59qj+4PBTIuPVJLXZfTxSWuU8KowlRtq1w5iE91WiwMgU1KgeBOKJ81nEA==} + '@prisma/adapter-pg@7.1.0': + resolution: {integrity: sha512-DSAnUwkKfX4bUzhkrjGN4IBQzwg0nvFw2W17H0Oa532I5w9nLtTJ9mAEGDs1nUBEGRAsa0c7qsf8CSgfJ4DsBQ==} + '@prisma/client-runtime-utils@7.1.0': resolution: {integrity: sha512-39xmeBrNTN40FzF34aJMjfX1PowVCqoT3UKUWBBSP3aXV05NRqGBC3x2wCDs96ti6ZgdiVzqnRDHtbzU8X+lPQ==} @@ -757,6 +769,9 @@ packages: '@types/node@22.19.1': resolution: {integrity: sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==} + '@types/pg@8.16.0': + resolution: {integrity: sha512-RmhMd/wD+CF8Dfo+cVIy3RR5cl8CyfXQ0tGgW6XBL8L4LM/UTEbNXYRbLwU6w+CgrKBNbrQWt4FUtTfaU5jSYQ==} + '@types/react-dom@19.2.3': resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==} peerDependencies: @@ -2072,6 +2087,40 @@ packages: perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + pg-cloudflare@1.2.7: + resolution: {integrity: sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==} + + pg-connection-string@2.9.1: + resolution: {integrity: sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==} + + pg-int8@1.0.1: + resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} + engines: {node: '>=4.0.0'} + + pg-pool@3.10.1: + resolution: {integrity: sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==} + peerDependencies: + pg: '>=8.0' + + pg-protocol@1.10.3: + resolution: {integrity: sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==} + + pg-types@2.2.0: + resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} + engines: {node: '>=4'} + + pg@8.16.3: + resolution: {integrity: sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==} + engines: {node: '>= 16.0.0'} + peerDependencies: + pg-native: '>=3.0.1' + peerDependenciesMeta: + pg-native: + optional: true + + pgpass@1.0.5: + resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} + picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -2149,6 +2198,26 @@ packages: resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} + postgres-array@2.0.0: + resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} + engines: {node: '>=4'} + + postgres-array@3.0.4: + resolution: {integrity: sha512-nAUSGfSDGOaOAEGwqsRY27GPOea7CNipJPOA7lPbdEpx5Kg3qzdP0AaWC5MlhTWV9s4hFX39nomVZ+C4tnGOJQ==} + engines: {node: '>=12'} + + postgres-bytea@1.0.1: + resolution: {integrity: sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==} + engines: {node: '>=0.10.0'} + + postgres-date@1.0.7: + resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} + engines: {node: '>=0.10.0'} + + postgres-interval@1.2.0: + resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} + engines: {node: '>=0.10.0'} + postgres@3.4.7: resolution: {integrity: sha512-Jtc2612XINuBjIl/QTWsV5UvE8UHuNblcO3vVADSrKsrc6RqGX6lOW1cEo3CM2v0XG4Nat8nI+YM7/f26VxXLw==} engines: {node: '>=12'} @@ -2372,6 +2441,10 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + sqlstring@2.3.3: resolution: {integrity: sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==} engines: {node: '>= 0.6'} @@ -2598,6 +2671,10 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + xtend@4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} @@ -3088,6 +3165,14 @@ snapshots: '@prisma/driver-adapter-utils': 7.1.0 better-sqlite3: 12.5.0 + '@prisma/adapter-pg@7.1.0': + dependencies: + '@prisma/driver-adapter-utils': 7.1.0 + pg: 8.16.3 + postgres-array: 3.0.4 + transitivePeerDependencies: + - pg-native + '@prisma/client-runtime-utils@7.1.0': {} '@prisma/client@7.1.0(prisma@7.1.0(@types/react@19.2.7)(better-sqlite3@12.5.0)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)(typescript@5.9.3))(typescript@5.9.3)': @@ -3198,6 +3283,12 @@ snapshots: dependencies: undici-types: 6.21.0 + '@types/pg@8.16.0': + dependencies: + '@types/node': 22.19.1 + pg-protocol: 1.10.3 + pg-types: 2.2.0 + '@types/react-dom@19.2.3(@types/react@19.2.7)': dependencies: '@types/react': 19.2.7 @@ -4680,6 +4771,41 @@ snapshots: perfect-debounce@1.0.0: {} + pg-cloudflare@1.2.7: + optional: true + + pg-connection-string@2.9.1: {} + + pg-int8@1.0.1: {} + + pg-pool@3.10.1(pg@8.16.3): + dependencies: + pg: 8.16.3 + + pg-protocol@1.10.3: {} + + pg-types@2.2.0: + dependencies: + pg-int8: 1.0.1 + postgres-array: 2.0.0 + postgres-bytea: 1.0.1 + postgres-date: 1.0.7 + postgres-interval: 1.2.0 + + pg@8.16.3: + dependencies: + pg-connection-string: 2.9.1 + pg-pool: 3.10.1(pg@8.16.3) + pg-protocol: 1.10.3 + pg-types: 2.2.0 + pgpass: 1.0.5 + optionalDependencies: + pg-cloudflare: 1.2.7 + + pgpass@1.0.5: + dependencies: + split2: 4.2.0 + picocolors@1.1.1: {} picomatch@2.3.1: {} @@ -4742,6 +4868,18 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + postgres-array@2.0.0: {} + + postgres-array@3.0.4: {} + + postgres-bytea@1.0.1: {} + + postgres-date@1.0.7: {} + + postgres-interval@1.2.0: + dependencies: + xtend: 4.0.2 + postgres@3.4.7: {} preact-render-to-string@6.5.11(preact@10.24.3): @@ -5029,6 +5167,8 @@ snapshots: source-map-js@1.2.1: {} + split2@4.2.0: {} + sqlstring@2.3.3: {} stable-hash@0.0.5: {} @@ -5361,6 +5501,8 @@ snapshots: wrappy@1.0.2: {} + xtend@4.0.2: {} + yallist@3.1.1: {} yocto-queue@0.1.0: {} diff --git a/prisma/generated/prisma/commonInputTypes.ts b/prisma/generated/prisma/commonInputTypes.ts index d4b3755..91367bf 100644 --- a/prisma/generated/prisma/commonInputTypes.ts +++ b/prisma/generated/prisma/commonInputTypes.ts @@ -16,8 +16,8 @@ import type * as Prisma from "./internal/prismaNamespace" export type StringFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> lt?: string | Prisma.StringFieldRefInput<$PrismaModel> lte?: string | Prisma.StringFieldRefInput<$PrismaModel> gt?: string | Prisma.StringFieldRefInput<$PrismaModel> @@ -25,20 +25,21 @@ export type StringFilter<$PrismaModel = never> = { contains?: string | Prisma.StringFieldRefInput<$PrismaModel> startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode not?: Prisma.NestedStringFilter<$PrismaModel> | string } export type EnumRoleFilter<$PrismaModel = never> = { equals?: $Enums.Role | Prisma.EnumRoleFieldRefInput<$PrismaModel> - in?: $Enums.Role[] - notIn?: $Enums.Role[] + in?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumRoleFilter<$PrismaModel> | $Enums.Role } export type IntFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: number | Prisma.IntFieldRefInput<$PrismaModel> @@ -48,8 +49,8 @@ export type IntFilter<$PrismaModel = never> = { export type StringNullableFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null lt?: string | Prisma.StringFieldRefInput<$PrismaModel> lte?: string | Prisma.StringFieldRefInput<$PrismaModel> gt?: string | Prisma.StringFieldRefInput<$PrismaModel> @@ -57,13 +58,14 @@ export type StringNullableFilter<$PrismaModel = never> = { contains?: string | Prisma.StringFieldRefInput<$PrismaModel> startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null } export type DateTimeFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] - notIn?: Date[] | string[] + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> @@ -73,8 +75,8 @@ export type DateTimeFilter<$PrismaModel = never> = { export type EnumCharacterClassNullableFilter<$PrismaModel = never> = { equals?: $Enums.CharacterClass | Prisma.EnumCharacterClassFieldRefInput<$PrismaModel> | null - in?: $Enums.CharacterClass[] | null - notIn?: $Enums.CharacterClass[] | null + in?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null + notIn?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null not?: Prisma.NestedEnumCharacterClassNullableFilter<$PrismaModel> | $Enums.CharacterClass | null } @@ -85,8 +87,8 @@ export type SortOrderInput = { export type StringWithAggregatesFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> lt?: string | Prisma.StringFieldRefInput<$PrismaModel> lte?: string | Prisma.StringFieldRefInput<$PrismaModel> gt?: string | Prisma.StringFieldRefInput<$PrismaModel> @@ -94,6 +96,7 @@ export type StringWithAggregatesFilter<$PrismaModel = never> = { contains?: string | Prisma.StringFieldRefInput<$PrismaModel> startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string _count?: Prisma.NestedIntFilter<$PrismaModel> _min?: Prisma.NestedStringFilter<$PrismaModel> @@ -102,8 +105,8 @@ export type StringWithAggregatesFilter<$PrismaModel = never> = { export type EnumRoleWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.Role | Prisma.EnumRoleFieldRefInput<$PrismaModel> - in?: $Enums.Role[] - notIn?: $Enums.Role[] + in?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumRoleWithAggregatesFilter<$PrismaModel> | $Enums.Role _count?: Prisma.NestedIntFilter<$PrismaModel> _min?: Prisma.NestedEnumRoleFilter<$PrismaModel> @@ -112,8 +115,8 @@ export type EnumRoleWithAggregatesFilter<$PrismaModel = never> = { export type IntWithAggregatesFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: number | Prisma.IntFieldRefInput<$PrismaModel> @@ -128,8 +131,8 @@ export type IntWithAggregatesFilter<$PrismaModel = never> = { export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null lt?: string | Prisma.StringFieldRefInput<$PrismaModel> lte?: string | Prisma.StringFieldRefInput<$PrismaModel> gt?: string | Prisma.StringFieldRefInput<$PrismaModel> @@ -137,6 +140,7 @@ export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { contains?: string | Prisma.StringFieldRefInput<$PrismaModel> startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null _count?: Prisma.NestedIntNullableFilter<$PrismaModel> _min?: Prisma.NestedStringNullableFilter<$PrismaModel> @@ -145,8 +149,8 @@ export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] - notIn?: Date[] | string[] + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> @@ -159,8 +163,8 @@ export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { export type EnumCharacterClassNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.CharacterClass | Prisma.EnumCharacterClassFieldRefInput<$PrismaModel> | null - in?: $Enums.CharacterClass[] | null - notIn?: $Enums.CharacterClass[] | null + in?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null + notIn?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null not?: Prisma.NestedEnumCharacterClassNullableWithAggregatesFilter<$PrismaModel> | $Enums.CharacterClass | null _count?: Prisma.NestedIntNullableFilter<$PrismaModel> _min?: Prisma.NestedEnumCharacterClassNullableFilter<$PrismaModel> @@ -169,15 +173,15 @@ export type EnumCharacterClassNullableWithAggregatesFilter<$PrismaModel = never> export type EnumEventTypeFilter<$PrismaModel = never> = { equals?: $Enums.EventType | Prisma.EnumEventTypeFieldRefInput<$PrismaModel> - in?: $Enums.EventType[] - notIn?: $Enums.EventType[] + in?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel> + notIn?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumEventTypeFilter<$PrismaModel> | $Enums.EventType } export type IntNullableFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: number | Prisma.IntFieldRefInput<$PrismaModel> @@ -187,8 +191,8 @@ export type IntNullableFilter<$PrismaModel = never> = { export type EnumEventTypeWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.EventType | Prisma.EnumEventTypeFieldRefInput<$PrismaModel> - in?: $Enums.EventType[] - notIn?: $Enums.EventType[] + in?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel> + notIn?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumEventTypeWithAggregatesFilter<$PrismaModel> | $Enums.EventType _count?: Prisma.NestedIntFilter<$PrismaModel> _min?: Prisma.NestedEnumEventTypeFilter<$PrismaModel> @@ -197,8 +201,8 @@ export type EnumEventTypeWithAggregatesFilter<$PrismaModel = never> = { export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: number | Prisma.IntFieldRefInput<$PrismaModel> @@ -226,15 +230,15 @@ export type BoolWithAggregatesFilter<$PrismaModel = never> = { export type EnumChallengeStatusFilter<$PrismaModel = never> = { equals?: $Enums.ChallengeStatus | Prisma.EnumChallengeStatusFieldRefInput<$PrismaModel> - in?: $Enums.ChallengeStatus[] - notIn?: $Enums.ChallengeStatus[] + in?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumChallengeStatusFilter<$PrismaModel> | $Enums.ChallengeStatus } export type DateTimeNullableFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> @@ -244,8 +248,8 @@ export type DateTimeNullableFilter<$PrismaModel = never> = { export type EnumChallengeStatusWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.ChallengeStatus | Prisma.EnumChallengeStatusFieldRefInput<$PrismaModel> - in?: $Enums.ChallengeStatus[] - notIn?: $Enums.ChallengeStatus[] + in?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumChallengeStatusWithAggregatesFilter<$PrismaModel> | $Enums.ChallengeStatus _count?: Prisma.NestedIntFilter<$PrismaModel> _min?: Prisma.NestedEnumChallengeStatusFilter<$PrismaModel> @@ -254,8 +258,8 @@ export type EnumChallengeStatusWithAggregatesFilter<$PrismaModel = never> = { export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> @@ -268,8 +272,8 @@ export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { export type NestedStringFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> lt?: string | Prisma.StringFieldRefInput<$PrismaModel> lte?: string | Prisma.StringFieldRefInput<$PrismaModel> gt?: string | Prisma.StringFieldRefInput<$PrismaModel> @@ -282,15 +286,15 @@ export type NestedStringFilter<$PrismaModel = never> = { export type NestedEnumRoleFilter<$PrismaModel = never> = { equals?: $Enums.Role | Prisma.EnumRoleFieldRefInput<$PrismaModel> - in?: $Enums.Role[] - notIn?: $Enums.Role[] + in?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumRoleFilter<$PrismaModel> | $Enums.Role } export type NestedIntFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: number | Prisma.IntFieldRefInput<$PrismaModel> @@ -300,8 +304,8 @@ export type NestedIntFilter<$PrismaModel = never> = { export type NestedStringNullableFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null lt?: string | Prisma.StringFieldRefInput<$PrismaModel> lte?: string | Prisma.StringFieldRefInput<$PrismaModel> gt?: string | Prisma.StringFieldRefInput<$PrismaModel> @@ -314,8 +318,8 @@ export type NestedStringNullableFilter<$PrismaModel = never> = { export type NestedDateTimeFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] - notIn?: Date[] | string[] + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> @@ -325,15 +329,15 @@ export type NestedDateTimeFilter<$PrismaModel = never> = { export type NestedEnumCharacterClassNullableFilter<$PrismaModel = never> = { equals?: $Enums.CharacterClass | Prisma.EnumCharacterClassFieldRefInput<$PrismaModel> | null - in?: $Enums.CharacterClass[] | null - notIn?: $Enums.CharacterClass[] | null + in?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null + notIn?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null not?: Prisma.NestedEnumCharacterClassNullableFilter<$PrismaModel> | $Enums.CharacterClass | null } export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> lt?: string | Prisma.StringFieldRefInput<$PrismaModel> lte?: string | Prisma.StringFieldRefInput<$PrismaModel> gt?: string | Prisma.StringFieldRefInput<$PrismaModel> @@ -349,8 +353,8 @@ export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { export type NestedEnumRoleWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.Role | Prisma.EnumRoleFieldRefInput<$PrismaModel> - in?: $Enums.Role[] - notIn?: $Enums.Role[] + in?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumRoleWithAggregatesFilter<$PrismaModel> | $Enums.Role _count?: Prisma.NestedIntFilter<$PrismaModel> _min?: Prisma.NestedEnumRoleFilter<$PrismaModel> @@ -359,8 +363,8 @@ export type NestedEnumRoleWithAggregatesFilter<$PrismaModel = never> = { export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: number | Prisma.IntFieldRefInput<$PrismaModel> @@ -375,8 +379,8 @@ export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { export type NestedFloatFilter<$PrismaModel = never> = { equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] + in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> @@ -386,8 +390,8 @@ export type NestedFloatFilter<$PrismaModel = never> = { export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null lt?: string | Prisma.StringFieldRefInput<$PrismaModel> lte?: string | Prisma.StringFieldRefInput<$PrismaModel> gt?: string | Prisma.StringFieldRefInput<$PrismaModel> @@ -403,8 +407,8 @@ export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { export type NestedIntNullableFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: number | Prisma.IntFieldRefInput<$PrismaModel> @@ -414,8 +418,8 @@ export type NestedIntNullableFilter<$PrismaModel = never> = { export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] - notIn?: Date[] | string[] + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> @@ -428,8 +432,8 @@ export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { export type NestedEnumCharacterClassNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.CharacterClass | Prisma.EnumCharacterClassFieldRefInput<$PrismaModel> | null - in?: $Enums.CharacterClass[] | null - notIn?: $Enums.CharacterClass[] | null + in?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null + notIn?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null not?: Prisma.NestedEnumCharacterClassNullableWithAggregatesFilter<$PrismaModel> | $Enums.CharacterClass | null _count?: Prisma.NestedIntNullableFilter<$PrismaModel> _min?: Prisma.NestedEnumCharacterClassNullableFilter<$PrismaModel> @@ -438,15 +442,15 @@ export type NestedEnumCharacterClassNullableWithAggregatesFilter<$PrismaModel = export type NestedEnumEventTypeFilter<$PrismaModel = never> = { equals?: $Enums.EventType | Prisma.EnumEventTypeFieldRefInput<$PrismaModel> - in?: $Enums.EventType[] - notIn?: $Enums.EventType[] + in?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel> + notIn?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumEventTypeFilter<$PrismaModel> | $Enums.EventType } export type NestedEnumEventTypeWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.EventType | Prisma.EnumEventTypeFieldRefInput<$PrismaModel> - in?: $Enums.EventType[] - notIn?: $Enums.EventType[] + in?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel> + notIn?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumEventTypeWithAggregatesFilter<$PrismaModel> | $Enums.EventType _count?: Prisma.NestedIntFilter<$PrismaModel> _min?: Prisma.NestedEnumEventTypeFilter<$PrismaModel> @@ -455,8 +459,8 @@ export type NestedEnumEventTypeWithAggregatesFilter<$PrismaModel = never> = { export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: number | Prisma.IntFieldRefInput<$PrismaModel> @@ -471,8 +475,8 @@ export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { export type NestedFloatNullableFilter<$PrismaModel = never> = { equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null + in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> @@ -495,15 +499,15 @@ export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { export type NestedEnumChallengeStatusFilter<$PrismaModel = never> = { equals?: $Enums.ChallengeStatus | Prisma.EnumChallengeStatusFieldRefInput<$PrismaModel> - in?: $Enums.ChallengeStatus[] - notIn?: $Enums.ChallengeStatus[] + in?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumChallengeStatusFilter<$PrismaModel> | $Enums.ChallengeStatus } export type NestedDateTimeNullableFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> @@ -513,8 +517,8 @@ export type NestedDateTimeNullableFilter<$PrismaModel = never> = { export type NestedEnumChallengeStatusWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.ChallengeStatus | Prisma.EnumChallengeStatusFieldRefInput<$PrismaModel> - in?: $Enums.ChallengeStatus[] - notIn?: $Enums.ChallengeStatus[] + in?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel> not?: Prisma.NestedEnumChallengeStatusWithAggregatesFilter<$PrismaModel> | $Enums.ChallengeStatus _count?: Prisma.NestedIntFilter<$PrismaModel> _min?: Prisma.NestedEnumChallengeStatusFilter<$PrismaModel> @@ -523,8 +527,8 @@ export type NestedEnumChallengeStatusWithAggregatesFilter<$PrismaModel = never> export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> diff --git a/prisma/generated/prisma/internal/class.ts b/prisma/generated/prisma/internal/class.ts index 32e8ae6..724ed7a 100644 --- a/prisma/generated/prisma/internal/class.ts +++ b/prisma/generated/prisma/internal/class.ts @@ -19,8 +19,8 @@ const config: runtime.GetPrismaClientConfig = { "previewFeatures": [], "clientVersion": "7.1.0", "engineVersion": "ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba", - "activeProvider": "sqlite", - "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"./generated/prisma\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nmodel User {\n id String @id @default(cuid())\n email String @unique\n password String\n username String @unique\n role Role @default(USER)\n score Int @default(0)\n level Int @default(1)\n hp Int @default(1000)\n maxHp Int @default(1000)\n xp Int @default(0)\n maxXp Int @default(5000)\n avatar String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n bio String?\n characterClass CharacterClass?\n eventFeedbacks EventFeedback[]\n eventRegistrations EventRegistration[]\n preferences UserPreferences?\n challengesAsChallenger Challenge[] @relation(\"Challenger\")\n challengesAsChallenged Challenge[] @relation(\"Challenged\")\n challengesAsAdmin Challenge[] @relation(\"AdminValidator\")\n challengesAsWinner Challenge[] @relation(\"ChallengeWinner\")\n\n @@index([score])\n @@index([email])\n}\n\nmodel UserPreferences {\n id String @id @default(cuid())\n userId String @unique\n homeBackground String?\n eventsBackground String?\n leaderboardBackground String?\n theme String? @default(\"default\")\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n}\n\nmodel Event {\n id String @id @default(cuid())\n date DateTime\n name String\n description String\n type EventType\n room String?\n time String?\n maxPlaces Int?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n feedbacks EventFeedback[]\n registrations EventRegistration[]\n\n @@index([date])\n}\n\nmodel EventRegistration {\n id String @id @default(cuid())\n userId String\n eventId String\n createdAt DateTime @default(now())\n event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@unique([userId, eventId])\n @@index([userId])\n @@index([eventId])\n}\n\nmodel EventFeedback {\n id String @id @default(cuid())\n userId String\n eventId String\n rating Int\n comment String?\n isRead Boolean @default(false)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@unique([userId, eventId])\n @@index([userId])\n @@index([eventId])\n @@index([isRead])\n}\n\nmodel SitePreferences {\n id String @id @default(\"global\")\n homeBackground String?\n eventsBackground String?\n leaderboardBackground String?\n challengesBackground String?\n eventRegistrationPoints Int @default(100)\n eventFeedbackPoints Int @default(100)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n}\n\nenum Role {\n USER\n ADMIN\n}\n\nenum EventType {\n ATELIER\n KATA\n PRESENTATION\n LEARNING_HOUR\n}\n\nenum CharacterClass {\n WARRIOR\n MAGE\n ROGUE\n RANGER\n PALADIN\n ENGINEER\n MERCHANT\n SCHOLAR\n BERSERKER\n NECROMANCER\n}\n\nenum ChallengeStatus {\n PENDING\n ACCEPTED\n COMPLETED\n REJECTED\n CANCELLED\n}\n\nmodel Challenge {\n id String @id @default(cuid())\n challengerId String // Joueur qui lance le défi\n challengedId String // Joueur qui reçoit le défi\n challenger User @relation(\"Challenger\", fields: [challengerId], references: [id], onDelete: Cascade)\n challenged User @relation(\"Challenged\", fields: [challengedId], references: [id], onDelete: Cascade)\n title String // Titre du défi\n description String // Description détaillée du défi\n pointsReward Int @default(100) // Points à gagner pour le gagnant\n status ChallengeStatus @default(PENDING)\n adminId String? // Admin qui valide le défi\n admin User? @relation(\"AdminValidator\", fields: [adminId], references: [id], onDelete: SetNull)\n adminComment String? // Commentaire de l'admin lors de la validation/rejet\n winnerId String? // ID du gagnant (challengerId ou challengedId)\n winner User? @relation(\"ChallengeWinner\", fields: [winnerId], references: [id], onDelete: SetNull)\n createdAt DateTime @default(now())\n acceptedAt DateTime? // Date d'acceptation du défi\n completedAt DateTime? // Date de validation par l'admin\n updatedAt DateTime @updatedAt\n\n @@index([challengerId])\n @@index([challengedId])\n @@index([status])\n @@index([adminId])\n}\n", + "activeProvider": "postgresql", + "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"./generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel User {\n id String @id @default(cuid())\n email String @unique\n password String\n username String @unique\n role Role @default(USER)\n score Int @default(0)\n level Int @default(1)\n hp Int @default(1000)\n maxHp Int @default(1000)\n xp Int @default(0)\n maxXp Int @default(5000)\n avatar String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n bio String?\n characterClass CharacterClass?\n eventFeedbacks EventFeedback[]\n eventRegistrations EventRegistration[]\n preferences UserPreferences?\n challengesAsChallenger Challenge[] @relation(\"Challenger\")\n challengesAsChallenged Challenge[] @relation(\"Challenged\")\n challengesAsAdmin Challenge[] @relation(\"AdminValidator\")\n challengesAsWinner Challenge[] @relation(\"ChallengeWinner\")\n\n @@index([score])\n @@index([email])\n}\n\nmodel UserPreferences {\n id String @id @default(cuid())\n userId String @unique\n homeBackground String?\n eventsBackground String?\n leaderboardBackground String?\n theme String? @default(\"default\")\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n}\n\nmodel Event {\n id String @id @default(cuid())\n date DateTime\n name String\n description String\n type EventType\n room String?\n time String?\n maxPlaces Int?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n feedbacks EventFeedback[]\n registrations EventRegistration[]\n\n @@index([date])\n}\n\nmodel EventRegistration {\n id String @id @default(cuid())\n userId String\n eventId String\n createdAt DateTime @default(now())\n event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@unique([userId, eventId])\n @@index([userId])\n @@index([eventId])\n}\n\nmodel EventFeedback {\n id String @id @default(cuid())\n userId String\n eventId String\n rating Int\n comment String?\n isRead Boolean @default(false)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@unique([userId, eventId])\n @@index([userId])\n @@index([eventId])\n @@index([isRead])\n}\n\nmodel SitePreferences {\n id String @id @default(\"global\")\n homeBackground String?\n eventsBackground String?\n leaderboardBackground String?\n challengesBackground String?\n eventRegistrationPoints Int @default(100)\n eventFeedbackPoints Int @default(100)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n}\n\nenum Role {\n USER\n ADMIN\n}\n\nenum EventType {\n ATELIER\n KATA\n PRESENTATION\n LEARNING_HOUR\n}\n\nenum CharacterClass {\n WARRIOR\n MAGE\n ROGUE\n RANGER\n PALADIN\n ENGINEER\n MERCHANT\n SCHOLAR\n BERSERKER\n NECROMANCER\n}\n\nenum ChallengeStatus {\n PENDING\n ACCEPTED\n COMPLETED\n REJECTED\n CANCELLED\n}\n\nmodel Challenge {\n id String @id @default(cuid())\n challengerId String // Joueur qui lance le défi\n challengedId String // Joueur qui reçoit le défi\n challenger User @relation(\"Challenger\", fields: [challengerId], references: [id], onDelete: Cascade)\n challenged User @relation(\"Challenged\", fields: [challengedId], references: [id], onDelete: Cascade)\n title String // Titre du défi\n description String // Description détaillée du défi\n pointsReward Int @default(100) // Points à gagner pour le gagnant\n status ChallengeStatus @default(PENDING)\n adminId String? // Admin qui valide le défi\n admin User? @relation(\"AdminValidator\", fields: [adminId], references: [id], onDelete: SetNull)\n adminComment String? // Commentaire de l'admin lors de la validation/rejet\n winnerId String? // ID du gagnant (challengerId ou challengedId)\n winner User? @relation(\"ChallengeWinner\", fields: [winnerId], references: [id], onDelete: SetNull)\n createdAt DateTime @default(now())\n acceptedAt DateTime? // Date d'acceptation du défi\n completedAt DateTime? // Date de validation par l'admin\n updatedAt DateTime @updatedAt\n\n @@index([challengerId])\n @@index([challengedId])\n @@index([status])\n @@index([adminId])\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -37,10 +37,10 @@ async function decodeBase64AsWasm(wasmBase64: string): Promise await import("@prisma/client/runtime/query_compiler_bg.sqlite.mjs"), + getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.postgresql.mjs"), getQueryCompilerWasmModule: async () => { - const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.sqlite.wasm-base64.mjs") + const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.postgresql.wasm-base64.mjs") return await decodeBase64AsWasm(wasm) } } diff --git a/prisma/generated/prisma/internal/prismaNamespace.ts b/prisma/generated/prisma/internal/prismaNamespace.ts index 2507494..567642c 100644 --- a/prisma/generated/prisma/internal/prismaNamespace.ts +++ b/prisma/generated/prisma/internal/prismaNamespace.ts @@ -958,6 +958,9 @@ export type TypeMap = FieldRefInputType<$PrismaModel, +/** + * Reference to a field of type 'String[]' + */ +export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> + + + /** * Reference to a field of type 'Role' */ @@ -1111,6 +1129,13 @@ export type EnumRoleFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel +/** + * Reference to a field of type 'Role[]' + */ +export type ListEnumRoleFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Role[]'> + + + /** * Reference to a field of type 'Int' */ @@ -1118,6 +1143,13 @@ export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'In +/** + * Reference to a field of type 'Int[]' + */ +export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> + + + /** * Reference to a field of type 'DateTime' */ @@ -1125,6 +1157,13 @@ export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel +/** + * Reference to a field of type 'DateTime[]' + */ +export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime[]'> + + + /** * Reference to a field of type 'CharacterClass' */ @@ -1132,6 +1171,13 @@ export type EnumCharacterClassFieldRefInput<$PrismaModel> = FieldRefInputType<$P +/** + * Reference to a field of type 'CharacterClass[]' + */ +export type ListEnumCharacterClassFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CharacterClass[]'> + + + /** * Reference to a field of type 'EventType' */ @@ -1139,6 +1185,13 @@ export type EnumEventTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$Prisma +/** + * Reference to a field of type 'EventType[]' + */ +export type ListEnumEventTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'EventType[]'> + + + /** * Reference to a field of type 'Boolean' */ @@ -1153,12 +1206,26 @@ export type EnumChallengeStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$ +/** + * Reference to a field of type 'ChallengeStatus[]' + */ +export type ListEnumChallengeStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'ChallengeStatus[]'> + + + /** * Reference to a field of type 'Float' */ export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> + +/** + * Reference to a field of type 'Float[]' + */ +export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> + + /** * Batch Payload for updateMany & deleteMany & createMany */ diff --git a/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts b/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts index 501d99e..b6ecbd0 100644 --- a/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -67,6 +67,9 @@ export type ModelName = (typeof ModelName)[keyof typeof ModelName] */ export const TransactionIsolationLevel = { + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', Serializable: 'Serializable' } as const @@ -192,6 +195,14 @@ export const SortOrder = { export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + export const NullsOrder = { first: 'first', last: 'last' diff --git a/prisma/generated/prisma/models/Challenge.ts b/prisma/generated/prisma/models/Challenge.ts index 3baeb20..33e556d 100644 --- a/prisma/generated/prisma/models/Challenge.ts +++ b/prisma/generated/prisma/models/Challenge.ts @@ -780,6 +780,7 @@ export type ChallengeCreateOrConnectWithoutChallengerInput = { export type ChallengeCreateManyChallengerInputEnvelope = { data: Prisma.ChallengeCreateManyChallengerInput | Prisma.ChallengeCreateManyChallengerInput[] + skipDuplicates?: boolean } export type ChallengeCreateWithoutChallengedInput = { @@ -821,6 +822,7 @@ export type ChallengeCreateOrConnectWithoutChallengedInput = { export type ChallengeCreateManyChallengedInputEnvelope = { data: Prisma.ChallengeCreateManyChallengedInput | Prisma.ChallengeCreateManyChallengedInput[] + skipDuplicates?: boolean } export type ChallengeCreateWithoutAdminInput = { @@ -862,6 +864,7 @@ export type ChallengeCreateOrConnectWithoutAdminInput = { export type ChallengeCreateManyAdminInputEnvelope = { data: Prisma.ChallengeCreateManyAdminInput | Prisma.ChallengeCreateManyAdminInput[] + skipDuplicates?: boolean } export type ChallengeCreateWithoutWinnerInput = { @@ -903,6 +906,7 @@ export type ChallengeCreateOrConnectWithoutWinnerInput = { export type ChallengeCreateManyWinnerInputEnvelope = { data: Prisma.ChallengeCreateManyWinnerInput | Prisma.ChallengeCreateManyWinnerInput[] + skipDuplicates?: boolean } export type ChallengeUpsertWithWhereUniqueWithoutChallengerInput = { @@ -2040,6 +2044,7 @@ export type ChallengeCreateManyArgs 0) { + console.log( + "\n⚠️ Certaines erreurs sont survenues. Vérifiez les logs ci-dessus." + ); + process.exit(1); + } else { + console.log("\n✅ Migration terminée avec succès!"); + } + } catch (error) { + console.error("\n❌ Erreur fatale:", error); + process.exit(1); + } finally { + if (prismaPG) { + await prismaPG.$disconnect(); + } + if (sqliteDb) { + sqliteDb.close(); + } + if (pgPool) { + await pgPool.end(); + } + } +} + +main();