From 76f533f30729ca9686fb5e9d3b2dbf28767570b7 Mon Sep 17 00:00:00 2001 From: Arthur Dodin Date: Thu, 27 Aug 2026 00:09:15 +0200 Subject: [PATCH 01/19] WIP: Maker Battle Frontend (Admin & User faces) --- frontend/src/App.tsx | 9 ++ .../adminMakerBattleDownload.tsx | 81 +++++++++++++++++ .../adminMakerBattleTeamGeneration.tsx | 89 +++++++++++++++++++ frontend/src/components/Admin/adminEvent.tsx | 12 ++- frontend/src/components/home/infosSection.tsx | 6 ++ .../components/home/makerBattleSection.tsx | 79 ++++++++++++++++ frontend/src/components/home/teamSection.tsx | 30 +++---- frontend/src/components/navbar.tsx | 1 + .../src/interfaces/maker_battle.interface.ts | 12 +++ frontend/src/pages/admin/adminMakerBattle.tsx | 26 ++++++ .../src/services/requests/event.service.ts | 33 +++++-- .../services/requests/maker_battle.service.ts | 21 +++++ 12 files changed, 371 insertions(+), 28 deletions(-) create mode 100644 frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx create mode 100644 frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleTeamGeneration.tsx create mode 100644 frontend/src/components/home/makerBattleSection.tsx create mode 100644 frontend/src/interfaces/maker_battle.interface.ts create mode 100644 frontend/src/pages/admin/adminMakerBattle.tsx create mode 100644 frontend/src/services/requests/maker_battle.service.ts diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 46b0562..04f5bb6 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -7,6 +7,7 @@ import ProtectedRoute from './components/utils/protectedroute'; import { OnboardingProvider } from './contexts/onboarding'; import { PermanencesProvider } from './contexts/permanences'; import { UserProvider } from './contexts/user'; +import AdminPageMakerBattle from './pages/admin/adminMakerBattle'; const AdminPageBanned = lazy(() => import('./pages/admin/adminBanned')); const AdminPageBus = lazy(() => import('./pages/admin/adminBus')); @@ -327,6 +328,14 @@ const App: React.FC = () => { } /> + + + + } + /> {/* Fallback */} } /> diff --git a/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx new file mode 100644 index 0000000..23e72ea --- /dev/null +++ b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx @@ -0,0 +1,81 @@ +import { useState } from 'react'; +import Select from 'react-select'; +import Swal from 'sweetalert2'; + +import type { MakerBattleGroupTypeOption } from '../../../interfaces/maker_battle.interface'; +import { exportGroups } from '../../../services/requests/maker_battle.service'; +import { Button } from '../../ui/button'; +import { Card, CardContent, CardHeader, CardTitle } from '../../ui/card'; + +type Props = { + groupTypeOptions: MakerBattleGroupTypeOption[]; +}; + +export const AdminMakerBattleTeamDownload = ({ groupTypeOptions }: Props) => { + const [selectedGroupType, setSelectedGroupType] = useState(null); + + const handleDownloadGroup = async () => { + if (!selectedGroupType) { + Swal.fire({ + icon: 'error', + title: 'Erreur', + text: 'Veuillez sélectionner un groupe.', + }); + return; + } + + const newTab = window.open('', '_blank'); + + try { + const { filename } = await exportGroups(selectedGroupType); + + const url = `${import.meta.env.VITE_API_URL}/exports/makerbattlegroups${filename}`; + + if (newTab) { + newTab.location.href = url; + } + } catch (error) { + newTab?.close(); + console.error('Erreur lors du téléchargement des groupes:', error); + Swal.fire({ + icon: 'error', + title: 'Erreur', + text: 'Une erreur est survenue lors du téléchargement des groupes.', + }); + } + }; + + return ( + + + Téléchargement + + + +
+ + + + inputId="maker-battle-group-types" + options={groupTypeOptions} + value={selectedGroupType} + onChange={setSelectedGroupType} + placeholder="Sélectionner un type" + isClearable + /> +
+
+ +
+
+
+ ); +}; diff --git a/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleTeamGeneration.tsx b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleTeamGeneration.tsx new file mode 100644 index 0000000..f3b0175 --- /dev/null +++ b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleTeamGeneration.tsx @@ -0,0 +1,89 @@ +import { useState } from 'react'; +import Select, { type MultiValue } from 'react-select'; +import Swal from 'sweetalert2'; + +import type { MakerBattleGroupTypeOption } from '../../../interfaces/maker_battle.interface'; +import { allocateGroups } from '../../../services/requests/maker_battle.service'; +import { Button } from '../../ui/button'; +import { Card, CardContent, CardHeader, CardTitle } from '../../ui/card'; + +type Props = { + groupTypeOptions: MakerBattleGroupTypeOption[]; +}; + +export const AdminMakerBattleTeamGeneration = ({ groupTypeOptions }: Props) => { + const [selectedGroupTypes, setSelectedGroupTypes] = useState([]); + + const handleGenerateGroups = async () => { + if (selectedGroupTypes.length === 0) { + Swal.fire({ + icon: 'error', + title: 'Erreur', + text: 'Veuillez sélectionner au moins un type de groupe.', + }); + return; + } + + try { + await allocateGroups(selectedGroupTypes); + } catch (error) { + console.error('Erreur lors de la répartition des groupes:', error); + Swal.fire({ + icon: 'error', + title: 'Erreur', + text: 'Une erreur est survenue lors de la répartition des groupes.', + }); + } + }; + + return ( + + + + Répartition des nouveaux +
+ Batailles de conception +
+
+ +
+ + +
+
+ {/* Export Bus → CSV */} + + {/* Export Team Members → CSV */}
{error &&

{error}

} + {message && !error && (

✅ {message}

)} - - {showBusExport && ( - - -

📄 Télécharger le csv des bus

- - ⬇️ Télécharger le csv - -
-
- )} - - {showTeamMembersExport && ( - - -

📄 Télécharger le csv des équipes

- - ⬇️ Télécharger le csv - -
-
- )} ); @@ -111,6 +108,7 @@ export const AdminImportFoodMenu = () => { Importer le menu + @@ -127,13 +125,14 @@ export const AdminImportPlannings = () => { Importer les plannings + - + @@ -148,6 +147,7 @@ export const AdminImportNotebooks = () => { Importer les cahiers de vacances + @@ -162,6 +162,7 @@ export const AdminImportOther = () => { Autres imports + diff --git a/frontend/src/utils/utils.ts b/frontend/src/utils/utils.ts index 26e8e4d..3a61909 100644 --- a/frontend/src/utils/utils.ts +++ b/frontend/src/utils/utils.ts @@ -38,3 +38,53 @@ export const checkUploadAvailability = async (url: string, callback?: () => void return false; } }; + +type CsvRow = Record; + +const escapeCsvValue = (value: unknown): string => { + if (value === null || value === undefined) { + return ''; + } + + const stringValue = typeof value === 'object' ? JSON.stringify(value) : String(value); + + // CSV : on entoure de guillemets si nécessaire + if (/[",\n\r]/.test(stringValue)) { + return `"${stringValue.replace(/"/g, '""')}"`; + } + + return stringValue; +}; + +export const downloadJsonAsCsv = (data: CsvRow[], filename = 'export.csv'): void => { + if (!data.length) { + console.warn('Aucune donnée à exporter.'); + return; + } + + const headers = Array.from(new Set(data.flatMap((row) => Object.keys(row)))); + + const csvRows = [ + headers.map(escapeCsvValue).join(','), + ...data.map((row) => headers.map((header) => escapeCsvValue(row[header])).join(',')), + ]; + + // BOM UTF-8 pour une bonne gestion des accents avec Excel (c'est copilot qui veut) + const csv = `\uFEFF${csvRows.join('\r\n')}`; + + const blob = new Blob([csv], { + type: 'text/csv;charset=utf-8;', + }); + + const url = URL.createObjectURL(blob); + const link = document.createElement('a'); + + link.href = url; + link.download = filename; + + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + + URL.revokeObjectURL(url); +}; From a7143c3366a4359b7b440247da810f9cd4b0c1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Poncin?= Date: Sat, 29 Aug 2026 19:55:32 +0200 Subject: [PATCH 10/19] fix: db --- .../migrations/0028_aberrant_mysterio.sql | 6 - ...ther_askani.sql => 0028_tan_slapstick.sql} | 3 +- .../database/migrations/0029_famous_thing.sql | 5 - .../migrations/0030_yielding_thunderbolts.sql | 2 - .../migrations/0031_volatile_slapstick.sql | 1 - .../database/migrations/0033_lazy_salo.sql | 1 - .../0034_fantastic_silver_centurion.sql | 1 - .../migrations/0035_true_ultragirl.sql | 8 - .../migrations/0036_tiresome_madame_hydra.sql | 1 - .../migrations/0037_sleepy_avengers.sql | 1 - .../migrations/0038_white_nightshade.sql | 1 - .../migrations/meta/0028_snapshot.json | 34 +- .../migrations/meta/0029_snapshot.json | 1554 ---------------- .../migrations/meta/0030_snapshot.json | 1560 ---------------- .../migrations/meta/0031_snapshot.json | 1509 ---------------- .../migrations/meta/0032_snapshot.json | 1560 ---------------- .../migrations/meta/0033_snapshot.json | 1560 ---------------- .../migrations/meta/0034_snapshot.json | 1509 ---------------- .../migrations/meta/0035_snapshot.json | 1560 ---------------- .../migrations/meta/0036_snapshot.json | 1560 ---------------- .../migrations/meta/0037_snapshot.json | 1560 ---------------- .../migrations/meta/0038_snapshot.json | 1566 ----------------- .../database/migrations/meta/_journal.json | 74 +- 23 files changed, 30 insertions(+), 15606 deletions(-) delete mode 100644 backend/src/database/migrations/0028_aberrant_mysterio.sql rename backend/src/database/migrations/{0032_groovy_mother_askani.sql => 0028_tan_slapstick.sql} (88%) delete mode 100644 backend/src/database/migrations/0029_famous_thing.sql delete mode 100644 backend/src/database/migrations/0030_yielding_thunderbolts.sql delete mode 100644 backend/src/database/migrations/0031_volatile_slapstick.sql delete mode 100644 backend/src/database/migrations/0033_lazy_salo.sql delete mode 100644 backend/src/database/migrations/0034_fantastic_silver_centurion.sql delete mode 100644 backend/src/database/migrations/0035_true_ultragirl.sql delete mode 100644 backend/src/database/migrations/0036_tiresome_madame_hydra.sql delete mode 100644 backend/src/database/migrations/0037_sleepy_avengers.sql delete mode 100644 backend/src/database/migrations/0038_white_nightshade.sql delete mode 100644 backend/src/database/migrations/meta/0029_snapshot.json delete mode 100644 backend/src/database/migrations/meta/0030_snapshot.json delete mode 100644 backend/src/database/migrations/meta/0031_snapshot.json delete mode 100644 backend/src/database/migrations/meta/0032_snapshot.json delete mode 100644 backend/src/database/migrations/meta/0033_snapshot.json delete mode 100644 backend/src/database/migrations/meta/0034_snapshot.json delete mode 100644 backend/src/database/migrations/meta/0035_snapshot.json delete mode 100644 backend/src/database/migrations/meta/0036_snapshot.json delete mode 100644 backend/src/database/migrations/meta/0037_snapshot.json delete mode 100644 backend/src/database/migrations/meta/0038_snapshot.json diff --git a/backend/src/database/migrations/0028_aberrant_mysterio.sql b/backend/src/database/migrations/0028_aberrant_mysterio.sql deleted file mode 100644 index 7dc6d6b..0000000 --- a/backend/src/database/migrations/0028_aberrant_mysterio.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE "defi_tc_attribution" ( - "user_id" integer PRIMARY KEY NOT NULL, - "team" integer NOT NULL -); ---> statement-breakpoint -ALTER TABLE "defi_tc_attribution" ADD CONSTRAINT "defi_tc_attribution_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action; \ No newline at end of file diff --git a/backend/src/database/migrations/0032_groovy_mother_askani.sql b/backend/src/database/migrations/0028_tan_slapstick.sql similarity index 88% rename from backend/src/database/migrations/0032_groovy_mother_askani.sql rename to backend/src/database/migrations/0028_tan_slapstick.sql index 093f6a8..e907d3f 100644 --- a/backend/src/database/migrations/0032_groovy_mother_askani.sql +++ b/backend/src/database/migrations/0028_tan_slapstick.sql @@ -1,7 +1,8 @@ CREATE TABLE "maker_battle_attribution" ( "user_id" integer PRIMARY KEY NOT NULL, "maker_team_id" integer NOT NULL, - "table" text NOT NULL, + "faction_id" integer NOT NULL, + "table" integer, "group" text NOT NULL ); --> statement-breakpoint diff --git a/backend/src/database/migrations/0029_famous_thing.sql b/backend/src/database/migrations/0029_famous_thing.sql deleted file mode 100644 index c4ee369..0000000 --- a/backend/src/database/migrations/0029_famous_thing.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE "defi_tc_attribution" RENAME TO "maker_battle_attribution";--> statement-breakpoint -ALTER TABLE "maker_battle_attribution" DROP CONSTRAINT "defi_tc_attribution_user_id_users_id_fk"; ---> statement-breakpoint -ALTER TABLE "maker_battle_attribution" ADD COLUMN "table" text NOT NULL;--> statement-breakpoint -ALTER TABLE "maker_battle_attribution" ADD CONSTRAINT "maker_battle_attribution_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action; \ No newline at end of file diff --git a/backend/src/database/migrations/0030_yielding_thunderbolts.sql b/backend/src/database/migrations/0030_yielding_thunderbolts.sql deleted file mode 100644 index 4b21aaa..0000000 --- a/backend/src/database/migrations/0030_yielding_thunderbolts.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "maker_battle_attribution" RENAME COLUMN "team" TO "maker_team_id";--> statement-breakpoint -ALTER TABLE "maker_battle_attribution" ADD COLUMN "group" text NOT NULL; \ No newline at end of file diff --git a/backend/src/database/migrations/0031_volatile_slapstick.sql b/backend/src/database/migrations/0031_volatile_slapstick.sql deleted file mode 100644 index 2d65e80..0000000 --- a/backend/src/database/migrations/0031_volatile_slapstick.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE "maker_battle_attribution" CASCADE; \ No newline at end of file diff --git a/backend/src/database/migrations/0033_lazy_salo.sql b/backend/src/database/migrations/0033_lazy_salo.sql deleted file mode 100644 index 3977012..0000000 --- a/backend/src/database/migrations/0033_lazy_salo.sql +++ /dev/null @@ -1 +0,0 @@ --- Custom SQL migration file, put your code below! -- \ No newline at end of file diff --git a/backend/src/database/migrations/0034_fantastic_silver_centurion.sql b/backend/src/database/migrations/0034_fantastic_silver_centurion.sql deleted file mode 100644 index 58acc26..0000000 --- a/backend/src/database/migrations/0034_fantastic_silver_centurion.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS "maker_battle_attribution" CASCADE; diff --git a/backend/src/database/migrations/0035_true_ultragirl.sql b/backend/src/database/migrations/0035_true_ultragirl.sql deleted file mode 100644 index 093f6a8..0000000 --- a/backend/src/database/migrations/0035_true_ultragirl.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE "maker_battle_attribution" ( - "user_id" integer PRIMARY KEY NOT NULL, - "maker_team_id" integer NOT NULL, - "table" text NOT NULL, - "group" text NOT NULL -); ---> statement-breakpoint -ALTER TABLE "maker_battle_attribution" ADD CONSTRAINT "maker_battle_attribution_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action; \ No newline at end of file diff --git a/backend/src/database/migrations/0036_tiresome_madame_hydra.sql b/backend/src/database/migrations/0036_tiresome_madame_hydra.sql deleted file mode 100644 index 112bdbf..0000000 --- a/backend/src/database/migrations/0036_tiresome_madame_hydra.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "maker_battle_attribution" ALTER COLUMN "table" SET DATA TYPE integer; \ No newline at end of file diff --git a/backend/src/database/migrations/0037_sleepy_avengers.sql b/backend/src/database/migrations/0037_sleepy_avengers.sql deleted file mode 100644 index 42d9723..0000000 --- a/backend/src/database/migrations/0037_sleepy_avengers.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "maker_battle_attribution" ALTER COLUMN "table" DROP NOT NULL; \ No newline at end of file diff --git a/backend/src/database/migrations/0038_white_nightshade.sql b/backend/src/database/migrations/0038_white_nightshade.sql deleted file mode 100644 index b9f2504..0000000 --- a/backend/src/database/migrations/0038_white_nightshade.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "maker_battle_attribution" ADD COLUMN "faction_id" integer NOT NULL; \ No newline at end of file diff --git a/backend/src/database/migrations/meta/0028_snapshot.json b/backend/src/database/migrations/meta/0028_snapshot.json index 40f8b69..8d77e1b 100644 --- a/backend/src/database/migrations/meta/0028_snapshot.json +++ b/backend/src/database/migrations/meta/0028_snapshot.json @@ -1,5 +1,5 @@ { - "id": "5651e446-a477-449c-b53b-93f202470fb2", + "id": "affda32f-de8a-46ec-ab02-7425eb922c0b", "prevId": "6179fb88-23bd-4656-9980-faa52a9d9b24", "version": "7", "dialect": "postgresql", @@ -767,8 +767,8 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "public.defi_tc_attribution": { - "name": "defi_tc_attribution", + "public.maker_battle_attribution": { + "name": "maker_battle_attribution", "schema": "", "columns": { "user_id": { @@ -777,18 +777,36 @@ "primaryKey": true, "notNull": true }, - "team": { - "name": "team", + "maker_team_id": { + "name": "maker_team_id", "type": "integer", "primaryKey": false, "notNull": true + }, + "faction_id": { + "name": "faction_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "table": { + "name": "table", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "group": { + "name": "group", + "type": "text", + "primaryKey": false, + "notNull": true } }, "indexes": {}, "foreignKeys": { - "defi_tc_attribution_user_id_users_id_fk": { - "name": "defi_tc_attribution_user_id_users_id_fk", - "tableFrom": "defi_tc_attribution", + "maker_battle_attribution_user_id_users_id_fk": { + "name": "maker_battle_attribution_user_id_users_id_fk", + "tableFrom": "maker_battle_attribution", "tableTo": "users", "columnsFrom": [ "user_id" diff --git a/backend/src/database/migrations/meta/0029_snapshot.json b/backend/src/database/migrations/meta/0029_snapshot.json deleted file mode 100644 index 9975f12..0000000 --- a/backend/src/database/migrations/meta/0029_snapshot.json +++ /dev/null @@ -1,1554 +0,0 @@ -{ - "id": "6c6ba6fa-9ff5-49be-a8af-46c1453c090a", - "prevId": "5651e446-a477-449c-b53b-93f202470fb2", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.banned_addresses": { - "name": "banned_addresses", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "banned_addresses_email_unique": { - "name": "banned_addresses_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenges": { - "name": "challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "challenges_created_by_users_id_fk": { - "name": "challenges_created_by_users_id_fk", - "tableFrom": "challenges", - "tableTo": "users", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "pre_registration_open": { - "name": "pre_registration_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "shotgun_open": { - "name": "shotgun_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "sdi_open": { - "name": "sdi_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "wei_open": { - "name": "wei_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "food_open": { - "name": "food_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "chall_open": { - "name": "chall_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.factions": { - "name": "factions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "factions_name_unique": { - "name": "factions_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.news": { - "name": "news", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "target": { - "name": "target", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permanences": { - "name": "permanences", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "start_at": { - "name": "start_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_open": { - "name": "is_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "difficulty": { - "name": "difficulty", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "socialLink": { - "name": "socialLink", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "riCompatible": { - "name": "riCompatible", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_unique": { - "name": "teams_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "majeur": { - "name": "majeur", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "male": { - "name": "male", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "branch": { - "name": "branch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contact": { - "name": "contact", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'Nouveau'" - }, - "discord_id": { - "name": "discord_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "vss_form": { - "name": "vss_form", - "type": "vss_form", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'pending'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmquestion": { - "name": "vssqcmquestion", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "question": { - "name": "question", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "question_en": { - "name": "question_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.bus_attribution": { - "name": "bus_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bus": { - "name": "bus", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "departure_time": { - "name": "departure_time", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "bus_attribution_user_id_users_id_fk": { - "name": "bus_attribution_user_id_users_id_fk", - "tableFrom": "bus_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenge_validation": { - "name": "challenge_validation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "challenge_id": { - "name": "challenge_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_by_admin_id": { - "name": "validated_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_at": { - "name": "validated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "target_user_id": { - "name": "target_user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_team_id": { - "name": "target_team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_faction_id": { - "name": "target_faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "added_by_admin_id": { - "name": "added_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "challenge_validation_challenge_id_challenges_id_fk": { - "name": "challenge_validation_challenge_id_challenges_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "challenges", - "columnsFrom": [ - "challenge_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_validated_by_admin_id_users_id_fk": { - "name": "challenge_validation_validated_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "validated_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_user_id_users_id_fk": { - "name": "challenge_validation_target_user_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "target_user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_team_id_teams_id_fk": { - "name": "challenge_validation_target_team_id_teams_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "teams", - "columnsFrom": [ - "target_team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_faction_id_factions_id_fk": { - "name": "challenge_validation_target_faction_id_factions_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "factions", - "columnsFrom": [ - "target_faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_added_by_admin_id_users_id_fk": { - "name": "challenge_validation_added_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "added_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.maker_battle_attribution": { - "name": "maker_battle_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "team": { - "name": "team", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "table": { - "name": "table", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "maker_battle_attribution_user_id_users_id_fk": { - "name": "maker_battle_attribution_user_id_users_id_fk", - "tableFrom": "maker_battle_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.registration_tokens": { - "name": "registration_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_tokens_user_id_users_id_fk": { - "name": "registration_tokens_user_id_users_id_fk", - "tableFrom": "registration_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "registration_tokens_token_unique": { - "name": "registration_tokens_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.role_points": { - "name": "role_points", - "schema": "", - "columns": { - "role_points": { - "name": "role_points", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "role_points_role_points_roles_id_fk": { - "name": "role_points_role_points_roles_id_fk", - "tableFrom": "role_points", - "tableTo": "roles", - "columnsFrom": [ - "role_points" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "role_points_role_points_pk": { - "name": "role_points_role_points_pk", - "columns": [ - "role_points" - ] - } - }, - "uniqueConstraints": { - "role_points_role_points_unique": { - "name": "role_points_role_points_unique", - "nullsNotDistinct": false, - "columns": [ - "role_points" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_faction": { - "name": "team_faction", - "schema": "", - "columns": { - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "team_faction_faction_id_factions_id_fk": { - "name": "team_faction_faction_id_factions_id_fk", - "tableFrom": "team_faction", - "tableTo": "factions", - "columnsFrom": [ - "faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_faction_team_id_teams_id_fk": { - "name": "team_faction_team_id_teams_id_fk", - "tableFrom": "team_faction", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_faction_faction_id_team_id_pk": { - "name": "team_faction_faction_id_team_id_pk", - "columns": [ - "faction_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_shotgun": { - "name": "team_shotgun", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_shotgun_team_id_teams_id_fk": { - "name": "team_shotgun_team_id_teams_id_fk", - "tableFrom": "team_shotgun", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_informations": { - "name": "user_informations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "emergency_contact_name": { - "name": "emergency_contact_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "emergency_contact_phone": { - "name": "emergency_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_informations_user_id_users_id_fk": { - "name": "user_informations_user_id_users_id_fk", - "tableFrom": "user_informations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.respo_permanences": { - "name": "respo_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "respo_permanences_user_id_users_id_fk": { - "name": "respo_permanences_user_id_users_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "respo_permanences_permanence_id_permanences_id_fk": { - "name": "respo_permanences_permanence_id_permanences_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "respo_permanences_user_id_permanence_id_pk": { - "name": "respo_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_permanences": { - "name": "user_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "registered_at": { - "name": "registered_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "claimed": { - "name": "claimed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_permanences_user_id_users_id_fk": { - "name": "user_permanences_user_id_users_id_fk", - "tableFrom": "user_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_permanences_permanence_id_permanences_id_fk": { - "name": "user_permanences_permanence_id_permanences_id_fk", - "tableFrom": "user_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_permanences_user_id_permanence_id_pk": { - "name": "user_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_preferences": { - "name": "user_preferences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_preferences_role_id_roles_id_fk": { - "name": "user_preferences_role_id_roles_id_fk", - "tableFrom": "user_preferences", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_preferences_user_id_role_id_pk": { - "name": "user_preferences_user_id_role_id_pk", - "columns": [ - "user_id", - "role_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "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": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_teams": { - "name": "user_teams", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_teams_user_id_users_id_fk": { - "name": "user_teams_user_id_users_id_fk", - "tableFrom": "user_teams", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_teams_team_id_teams_id_fk": { - "name": "user_teams_team_id_teams_id_fk", - "tableFrom": "user_teams", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_teams_user_id_team_id_pk": { - "name": "user_teams_user_id_team_id_pk", - "columns": [ - "user_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_tent": { - "name": "user_tent", - "schema": "", - "columns": { - "user_id_1": { - "name": "user_id_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_id_2": { - "name": "user_id_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "confirmed": { - "name": "confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_tent_user_id_1_users_id_fk": { - "name": "user_tent_user_id_1_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_tent_user_id_2_users_id_fk": { - "name": "user_tent_user_id_2_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_tent_user_id_1_user_id_2_pk": { - "name": "user_tent_user_id_1_user_id_2_pk", - "columns": [ - "user_id_1", - "user_id_2" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmanswer": { - "name": "vssqcmanswer", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "questionid": { - "name": "questionid", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "answer_en": { - "name": "answer_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_correct": { - "name": "is_correct", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "vssqcmanswer_questionid_vssqcmquestion_id_fk": { - "name": "vssqcmanswer_questionid_vssqcmquestion_id_fk", - "tableFrom": "vssqcmanswer", - "tableTo": "vssqcmquestion", - "columnsFrom": [ - "questionid" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.vss_form": { - "name": "vss_form", - "schema": "public", - "values": [ - "pending", - "toretry", - "validated", - "rejected" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "single_choice", - "multiple_choice" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/backend/src/database/migrations/meta/0030_snapshot.json b/backend/src/database/migrations/meta/0030_snapshot.json deleted file mode 100644 index 0267c93..0000000 --- a/backend/src/database/migrations/meta/0030_snapshot.json +++ /dev/null @@ -1,1560 +0,0 @@ -{ - "id": "ba894680-8ace-44ca-8956-de5d379a5ce6", - "prevId": "6c6ba6fa-9ff5-49be-a8af-46c1453c090a", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.banned_addresses": { - "name": "banned_addresses", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "banned_addresses_email_unique": { - "name": "banned_addresses_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenges": { - "name": "challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "challenges_created_by_users_id_fk": { - "name": "challenges_created_by_users_id_fk", - "tableFrom": "challenges", - "tableTo": "users", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "pre_registration_open": { - "name": "pre_registration_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "shotgun_open": { - "name": "shotgun_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "sdi_open": { - "name": "sdi_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "wei_open": { - "name": "wei_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "food_open": { - "name": "food_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "chall_open": { - "name": "chall_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.factions": { - "name": "factions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "factions_name_unique": { - "name": "factions_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.news": { - "name": "news", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "target": { - "name": "target", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permanences": { - "name": "permanences", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "start_at": { - "name": "start_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_open": { - "name": "is_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "difficulty": { - "name": "difficulty", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "socialLink": { - "name": "socialLink", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "riCompatible": { - "name": "riCompatible", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_unique": { - "name": "teams_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "majeur": { - "name": "majeur", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "male": { - "name": "male", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "branch": { - "name": "branch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contact": { - "name": "contact", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'Nouveau'" - }, - "discord_id": { - "name": "discord_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "vss_form": { - "name": "vss_form", - "type": "vss_form", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'pending'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmquestion": { - "name": "vssqcmquestion", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "question": { - "name": "question", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "question_en": { - "name": "question_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.bus_attribution": { - "name": "bus_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bus": { - "name": "bus", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "departure_time": { - "name": "departure_time", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "bus_attribution_user_id_users_id_fk": { - "name": "bus_attribution_user_id_users_id_fk", - "tableFrom": "bus_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenge_validation": { - "name": "challenge_validation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "challenge_id": { - "name": "challenge_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_by_admin_id": { - "name": "validated_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_at": { - "name": "validated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "target_user_id": { - "name": "target_user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_team_id": { - "name": "target_team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_faction_id": { - "name": "target_faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "added_by_admin_id": { - "name": "added_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "challenge_validation_challenge_id_challenges_id_fk": { - "name": "challenge_validation_challenge_id_challenges_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "challenges", - "columnsFrom": [ - "challenge_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_validated_by_admin_id_users_id_fk": { - "name": "challenge_validation_validated_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "validated_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_user_id_users_id_fk": { - "name": "challenge_validation_target_user_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "target_user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_team_id_teams_id_fk": { - "name": "challenge_validation_target_team_id_teams_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "teams", - "columnsFrom": [ - "target_team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_faction_id_factions_id_fk": { - "name": "challenge_validation_target_faction_id_factions_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "factions", - "columnsFrom": [ - "target_faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_added_by_admin_id_users_id_fk": { - "name": "challenge_validation_added_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "added_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.maker_battle_attribution": { - "name": "maker_battle_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "maker_team_id": { - "name": "maker_team_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "table": { - "name": "table", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group": { - "name": "group", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "maker_battle_attribution_user_id_users_id_fk": { - "name": "maker_battle_attribution_user_id_users_id_fk", - "tableFrom": "maker_battle_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.registration_tokens": { - "name": "registration_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_tokens_user_id_users_id_fk": { - "name": "registration_tokens_user_id_users_id_fk", - "tableFrom": "registration_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "registration_tokens_token_unique": { - "name": "registration_tokens_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.role_points": { - "name": "role_points", - "schema": "", - "columns": { - "role_points": { - "name": "role_points", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "role_points_role_points_roles_id_fk": { - "name": "role_points_role_points_roles_id_fk", - "tableFrom": "role_points", - "tableTo": "roles", - "columnsFrom": [ - "role_points" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "role_points_role_points_pk": { - "name": "role_points_role_points_pk", - "columns": [ - "role_points" - ] - } - }, - "uniqueConstraints": { - "role_points_role_points_unique": { - "name": "role_points_role_points_unique", - "nullsNotDistinct": false, - "columns": [ - "role_points" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_faction": { - "name": "team_faction", - "schema": "", - "columns": { - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "team_faction_faction_id_factions_id_fk": { - "name": "team_faction_faction_id_factions_id_fk", - "tableFrom": "team_faction", - "tableTo": "factions", - "columnsFrom": [ - "faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_faction_team_id_teams_id_fk": { - "name": "team_faction_team_id_teams_id_fk", - "tableFrom": "team_faction", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_faction_faction_id_team_id_pk": { - "name": "team_faction_faction_id_team_id_pk", - "columns": [ - "faction_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_shotgun": { - "name": "team_shotgun", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_shotgun_team_id_teams_id_fk": { - "name": "team_shotgun_team_id_teams_id_fk", - "tableFrom": "team_shotgun", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_informations": { - "name": "user_informations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "emergency_contact_name": { - "name": "emergency_contact_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "emergency_contact_phone": { - "name": "emergency_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_informations_user_id_users_id_fk": { - "name": "user_informations_user_id_users_id_fk", - "tableFrom": "user_informations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.respo_permanences": { - "name": "respo_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "respo_permanences_user_id_users_id_fk": { - "name": "respo_permanences_user_id_users_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "respo_permanences_permanence_id_permanences_id_fk": { - "name": "respo_permanences_permanence_id_permanences_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "respo_permanences_user_id_permanence_id_pk": { - "name": "respo_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_permanences": { - "name": "user_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "registered_at": { - "name": "registered_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "claimed": { - "name": "claimed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_permanences_user_id_users_id_fk": { - "name": "user_permanences_user_id_users_id_fk", - "tableFrom": "user_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_permanences_permanence_id_permanences_id_fk": { - "name": "user_permanences_permanence_id_permanences_id_fk", - "tableFrom": "user_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_permanences_user_id_permanence_id_pk": { - "name": "user_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_preferences": { - "name": "user_preferences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_preferences_role_id_roles_id_fk": { - "name": "user_preferences_role_id_roles_id_fk", - "tableFrom": "user_preferences", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_preferences_user_id_role_id_pk": { - "name": "user_preferences_user_id_role_id_pk", - "columns": [ - "user_id", - "role_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "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": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_teams": { - "name": "user_teams", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_teams_user_id_users_id_fk": { - "name": "user_teams_user_id_users_id_fk", - "tableFrom": "user_teams", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_teams_team_id_teams_id_fk": { - "name": "user_teams_team_id_teams_id_fk", - "tableFrom": "user_teams", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_teams_user_id_team_id_pk": { - "name": "user_teams_user_id_team_id_pk", - "columns": [ - "user_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_tent": { - "name": "user_tent", - "schema": "", - "columns": { - "user_id_1": { - "name": "user_id_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_id_2": { - "name": "user_id_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "confirmed": { - "name": "confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_tent_user_id_1_users_id_fk": { - "name": "user_tent_user_id_1_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_tent_user_id_2_users_id_fk": { - "name": "user_tent_user_id_2_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_tent_user_id_1_user_id_2_pk": { - "name": "user_tent_user_id_1_user_id_2_pk", - "columns": [ - "user_id_1", - "user_id_2" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmanswer": { - "name": "vssqcmanswer", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "questionid": { - "name": "questionid", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "answer_en": { - "name": "answer_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_correct": { - "name": "is_correct", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "vssqcmanswer_questionid_vssqcmquestion_id_fk": { - "name": "vssqcmanswer_questionid_vssqcmquestion_id_fk", - "tableFrom": "vssqcmanswer", - "tableTo": "vssqcmquestion", - "columnsFrom": [ - "questionid" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.vss_form": { - "name": "vss_form", - "schema": "public", - "values": [ - "pending", - "toretry", - "validated", - "rejected" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "single_choice", - "multiple_choice" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/backend/src/database/migrations/meta/0031_snapshot.json b/backend/src/database/migrations/meta/0031_snapshot.json deleted file mode 100644 index f355d90..0000000 --- a/backend/src/database/migrations/meta/0031_snapshot.json +++ /dev/null @@ -1,1509 +0,0 @@ -{ - "id": "65d88638-51fe-4d92-ba76-92a0099eae79", - "prevId": "ba894680-8ace-44ca-8956-de5d379a5ce6", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.banned_addresses": { - "name": "banned_addresses", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "banned_addresses_email_unique": { - "name": "banned_addresses_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenges": { - "name": "challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "challenges_created_by_users_id_fk": { - "name": "challenges_created_by_users_id_fk", - "tableFrom": "challenges", - "tableTo": "users", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "pre_registration_open": { - "name": "pre_registration_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "shotgun_open": { - "name": "shotgun_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "sdi_open": { - "name": "sdi_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "wei_open": { - "name": "wei_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "food_open": { - "name": "food_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "chall_open": { - "name": "chall_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.factions": { - "name": "factions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "factions_name_unique": { - "name": "factions_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.news": { - "name": "news", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "target": { - "name": "target", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permanences": { - "name": "permanences", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "start_at": { - "name": "start_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_open": { - "name": "is_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "difficulty": { - "name": "difficulty", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "socialLink": { - "name": "socialLink", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "riCompatible": { - "name": "riCompatible", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_unique": { - "name": "teams_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "majeur": { - "name": "majeur", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "male": { - "name": "male", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "branch": { - "name": "branch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contact": { - "name": "contact", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'Nouveau'" - }, - "discord_id": { - "name": "discord_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "vss_form": { - "name": "vss_form", - "type": "vss_form", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'pending'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmquestion": { - "name": "vssqcmquestion", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "question": { - "name": "question", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "question_en": { - "name": "question_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.bus_attribution": { - "name": "bus_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bus": { - "name": "bus", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "departure_time": { - "name": "departure_time", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "bus_attribution_user_id_users_id_fk": { - "name": "bus_attribution_user_id_users_id_fk", - "tableFrom": "bus_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenge_validation": { - "name": "challenge_validation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "challenge_id": { - "name": "challenge_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_by_admin_id": { - "name": "validated_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_at": { - "name": "validated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "target_user_id": { - "name": "target_user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_team_id": { - "name": "target_team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_faction_id": { - "name": "target_faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "added_by_admin_id": { - "name": "added_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "challenge_validation_challenge_id_challenges_id_fk": { - "name": "challenge_validation_challenge_id_challenges_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "challenges", - "columnsFrom": [ - "challenge_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_validated_by_admin_id_users_id_fk": { - "name": "challenge_validation_validated_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "validated_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_user_id_users_id_fk": { - "name": "challenge_validation_target_user_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "target_user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_team_id_teams_id_fk": { - "name": "challenge_validation_target_team_id_teams_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "teams", - "columnsFrom": [ - "target_team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_faction_id_factions_id_fk": { - "name": "challenge_validation_target_faction_id_factions_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "factions", - "columnsFrom": [ - "target_faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_added_by_admin_id_users_id_fk": { - "name": "challenge_validation_added_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "added_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.registration_tokens": { - "name": "registration_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_tokens_user_id_users_id_fk": { - "name": "registration_tokens_user_id_users_id_fk", - "tableFrom": "registration_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "registration_tokens_token_unique": { - "name": "registration_tokens_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.role_points": { - "name": "role_points", - "schema": "", - "columns": { - "role_points": { - "name": "role_points", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "role_points_role_points_roles_id_fk": { - "name": "role_points_role_points_roles_id_fk", - "tableFrom": "role_points", - "tableTo": "roles", - "columnsFrom": [ - "role_points" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "role_points_role_points_pk": { - "name": "role_points_role_points_pk", - "columns": [ - "role_points" - ] - } - }, - "uniqueConstraints": { - "role_points_role_points_unique": { - "name": "role_points_role_points_unique", - "nullsNotDistinct": false, - "columns": [ - "role_points" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_faction": { - "name": "team_faction", - "schema": "", - "columns": { - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "team_faction_faction_id_factions_id_fk": { - "name": "team_faction_faction_id_factions_id_fk", - "tableFrom": "team_faction", - "tableTo": "factions", - "columnsFrom": [ - "faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_faction_team_id_teams_id_fk": { - "name": "team_faction_team_id_teams_id_fk", - "tableFrom": "team_faction", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_faction_faction_id_team_id_pk": { - "name": "team_faction_faction_id_team_id_pk", - "columns": [ - "faction_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_shotgun": { - "name": "team_shotgun", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_shotgun_team_id_teams_id_fk": { - "name": "team_shotgun_team_id_teams_id_fk", - "tableFrom": "team_shotgun", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_informations": { - "name": "user_informations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "emergency_contact_name": { - "name": "emergency_contact_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "emergency_contact_phone": { - "name": "emergency_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_informations_user_id_users_id_fk": { - "name": "user_informations_user_id_users_id_fk", - "tableFrom": "user_informations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.respo_permanences": { - "name": "respo_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "respo_permanences_user_id_users_id_fk": { - "name": "respo_permanences_user_id_users_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "respo_permanences_permanence_id_permanences_id_fk": { - "name": "respo_permanences_permanence_id_permanences_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "respo_permanences_user_id_permanence_id_pk": { - "name": "respo_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_permanences": { - "name": "user_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "registered_at": { - "name": "registered_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "claimed": { - "name": "claimed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_permanences_user_id_users_id_fk": { - "name": "user_permanences_user_id_users_id_fk", - "tableFrom": "user_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_permanences_permanence_id_permanences_id_fk": { - "name": "user_permanences_permanence_id_permanences_id_fk", - "tableFrom": "user_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_permanences_user_id_permanence_id_pk": { - "name": "user_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_preferences": { - "name": "user_preferences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_preferences_role_id_roles_id_fk": { - "name": "user_preferences_role_id_roles_id_fk", - "tableFrom": "user_preferences", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_preferences_user_id_role_id_pk": { - "name": "user_preferences_user_id_role_id_pk", - "columns": [ - "user_id", - "role_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "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": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_teams": { - "name": "user_teams", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_teams_user_id_users_id_fk": { - "name": "user_teams_user_id_users_id_fk", - "tableFrom": "user_teams", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_teams_team_id_teams_id_fk": { - "name": "user_teams_team_id_teams_id_fk", - "tableFrom": "user_teams", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_teams_user_id_team_id_pk": { - "name": "user_teams_user_id_team_id_pk", - "columns": [ - "user_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_tent": { - "name": "user_tent", - "schema": "", - "columns": { - "user_id_1": { - "name": "user_id_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_id_2": { - "name": "user_id_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "confirmed": { - "name": "confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_tent_user_id_1_users_id_fk": { - "name": "user_tent_user_id_1_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_tent_user_id_2_users_id_fk": { - "name": "user_tent_user_id_2_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_tent_user_id_1_user_id_2_pk": { - "name": "user_tent_user_id_1_user_id_2_pk", - "columns": [ - "user_id_1", - "user_id_2" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmanswer": { - "name": "vssqcmanswer", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "questionid": { - "name": "questionid", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "answer_en": { - "name": "answer_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_correct": { - "name": "is_correct", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "vssqcmanswer_questionid_vssqcmquestion_id_fk": { - "name": "vssqcmanswer_questionid_vssqcmquestion_id_fk", - "tableFrom": "vssqcmanswer", - "tableTo": "vssqcmquestion", - "columnsFrom": [ - "questionid" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.vss_form": { - "name": "vss_form", - "schema": "public", - "values": [ - "pending", - "toretry", - "validated", - "rejected" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "single_choice", - "multiple_choice" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/backend/src/database/migrations/meta/0032_snapshot.json b/backend/src/database/migrations/meta/0032_snapshot.json deleted file mode 100644 index 6064a4c..0000000 --- a/backend/src/database/migrations/meta/0032_snapshot.json +++ /dev/null @@ -1,1560 +0,0 @@ -{ - "id": "8ac40a2e-069e-4f44-bea2-7693bea3d045", - "prevId": "65d88638-51fe-4d92-ba76-92a0099eae79", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.banned_addresses": { - "name": "banned_addresses", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "banned_addresses_email_unique": { - "name": "banned_addresses_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenges": { - "name": "challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "challenges_created_by_users_id_fk": { - "name": "challenges_created_by_users_id_fk", - "tableFrom": "challenges", - "tableTo": "users", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "pre_registration_open": { - "name": "pre_registration_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "shotgun_open": { - "name": "shotgun_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "sdi_open": { - "name": "sdi_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "wei_open": { - "name": "wei_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "food_open": { - "name": "food_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "chall_open": { - "name": "chall_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.factions": { - "name": "factions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "factions_name_unique": { - "name": "factions_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.news": { - "name": "news", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "target": { - "name": "target", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permanences": { - "name": "permanences", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "start_at": { - "name": "start_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_open": { - "name": "is_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "difficulty": { - "name": "difficulty", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "socialLink": { - "name": "socialLink", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "riCompatible": { - "name": "riCompatible", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_unique": { - "name": "teams_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "majeur": { - "name": "majeur", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "male": { - "name": "male", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "branch": { - "name": "branch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contact": { - "name": "contact", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'Nouveau'" - }, - "discord_id": { - "name": "discord_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "vss_form": { - "name": "vss_form", - "type": "vss_form", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'pending'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmquestion": { - "name": "vssqcmquestion", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "question": { - "name": "question", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "question_en": { - "name": "question_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.bus_attribution": { - "name": "bus_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bus": { - "name": "bus", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "departure_time": { - "name": "departure_time", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "bus_attribution_user_id_users_id_fk": { - "name": "bus_attribution_user_id_users_id_fk", - "tableFrom": "bus_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenge_validation": { - "name": "challenge_validation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "challenge_id": { - "name": "challenge_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_by_admin_id": { - "name": "validated_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_at": { - "name": "validated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "target_user_id": { - "name": "target_user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_team_id": { - "name": "target_team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_faction_id": { - "name": "target_faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "added_by_admin_id": { - "name": "added_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "challenge_validation_challenge_id_challenges_id_fk": { - "name": "challenge_validation_challenge_id_challenges_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "challenges", - "columnsFrom": [ - "challenge_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_validated_by_admin_id_users_id_fk": { - "name": "challenge_validation_validated_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "validated_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_user_id_users_id_fk": { - "name": "challenge_validation_target_user_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "target_user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_team_id_teams_id_fk": { - "name": "challenge_validation_target_team_id_teams_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "teams", - "columnsFrom": [ - "target_team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_faction_id_factions_id_fk": { - "name": "challenge_validation_target_faction_id_factions_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "factions", - "columnsFrom": [ - "target_faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_added_by_admin_id_users_id_fk": { - "name": "challenge_validation_added_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "added_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.maker_battle_attribution": { - "name": "maker_battle_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "maker_team_id": { - "name": "maker_team_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "table": { - "name": "table", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group": { - "name": "group", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "maker_battle_attribution_user_id_users_id_fk": { - "name": "maker_battle_attribution_user_id_users_id_fk", - "tableFrom": "maker_battle_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.registration_tokens": { - "name": "registration_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_tokens_user_id_users_id_fk": { - "name": "registration_tokens_user_id_users_id_fk", - "tableFrom": "registration_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "registration_tokens_token_unique": { - "name": "registration_tokens_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.role_points": { - "name": "role_points", - "schema": "", - "columns": { - "role_points": { - "name": "role_points", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "role_points_role_points_roles_id_fk": { - "name": "role_points_role_points_roles_id_fk", - "tableFrom": "role_points", - "tableTo": "roles", - "columnsFrom": [ - "role_points" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "role_points_role_points_pk": { - "name": "role_points_role_points_pk", - "columns": [ - "role_points" - ] - } - }, - "uniqueConstraints": { - "role_points_role_points_unique": { - "name": "role_points_role_points_unique", - "nullsNotDistinct": false, - "columns": [ - "role_points" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_faction": { - "name": "team_faction", - "schema": "", - "columns": { - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "team_faction_faction_id_factions_id_fk": { - "name": "team_faction_faction_id_factions_id_fk", - "tableFrom": "team_faction", - "tableTo": "factions", - "columnsFrom": [ - "faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_faction_team_id_teams_id_fk": { - "name": "team_faction_team_id_teams_id_fk", - "tableFrom": "team_faction", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_faction_faction_id_team_id_pk": { - "name": "team_faction_faction_id_team_id_pk", - "columns": [ - "faction_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_shotgun": { - "name": "team_shotgun", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_shotgun_team_id_teams_id_fk": { - "name": "team_shotgun_team_id_teams_id_fk", - "tableFrom": "team_shotgun", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_informations": { - "name": "user_informations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "emergency_contact_name": { - "name": "emergency_contact_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "emergency_contact_phone": { - "name": "emergency_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_informations_user_id_users_id_fk": { - "name": "user_informations_user_id_users_id_fk", - "tableFrom": "user_informations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.respo_permanences": { - "name": "respo_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "respo_permanences_user_id_users_id_fk": { - "name": "respo_permanences_user_id_users_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "respo_permanences_permanence_id_permanences_id_fk": { - "name": "respo_permanences_permanence_id_permanences_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "respo_permanences_user_id_permanence_id_pk": { - "name": "respo_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_permanences": { - "name": "user_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "registered_at": { - "name": "registered_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "claimed": { - "name": "claimed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_permanences_user_id_users_id_fk": { - "name": "user_permanences_user_id_users_id_fk", - "tableFrom": "user_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_permanences_permanence_id_permanences_id_fk": { - "name": "user_permanences_permanence_id_permanences_id_fk", - "tableFrom": "user_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_permanences_user_id_permanence_id_pk": { - "name": "user_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_preferences": { - "name": "user_preferences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_preferences_role_id_roles_id_fk": { - "name": "user_preferences_role_id_roles_id_fk", - "tableFrom": "user_preferences", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_preferences_user_id_role_id_pk": { - "name": "user_preferences_user_id_role_id_pk", - "columns": [ - "user_id", - "role_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "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": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_teams": { - "name": "user_teams", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_teams_user_id_users_id_fk": { - "name": "user_teams_user_id_users_id_fk", - "tableFrom": "user_teams", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_teams_team_id_teams_id_fk": { - "name": "user_teams_team_id_teams_id_fk", - "tableFrom": "user_teams", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_teams_user_id_team_id_pk": { - "name": "user_teams_user_id_team_id_pk", - "columns": [ - "user_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_tent": { - "name": "user_tent", - "schema": "", - "columns": { - "user_id_1": { - "name": "user_id_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_id_2": { - "name": "user_id_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "confirmed": { - "name": "confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_tent_user_id_1_users_id_fk": { - "name": "user_tent_user_id_1_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_tent_user_id_2_users_id_fk": { - "name": "user_tent_user_id_2_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_tent_user_id_1_user_id_2_pk": { - "name": "user_tent_user_id_1_user_id_2_pk", - "columns": [ - "user_id_1", - "user_id_2" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmanswer": { - "name": "vssqcmanswer", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "questionid": { - "name": "questionid", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "answer_en": { - "name": "answer_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_correct": { - "name": "is_correct", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "vssqcmanswer_questionid_vssqcmquestion_id_fk": { - "name": "vssqcmanswer_questionid_vssqcmquestion_id_fk", - "tableFrom": "vssqcmanswer", - "tableTo": "vssqcmquestion", - "columnsFrom": [ - "questionid" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.vss_form": { - "name": "vss_form", - "schema": "public", - "values": [ - "pending", - "toretry", - "validated", - "rejected" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "single_choice", - "multiple_choice" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/backend/src/database/migrations/meta/0033_snapshot.json b/backend/src/database/migrations/meta/0033_snapshot.json deleted file mode 100644 index 19ee071..0000000 --- a/backend/src/database/migrations/meta/0033_snapshot.json +++ /dev/null @@ -1,1560 +0,0 @@ -{ - "id": "2d4ec509-7053-40cb-925b-ddada5fdf0e5", - "prevId": "8ac40a2e-069e-4f44-bea2-7693bea3d045", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.banned_addresses": { - "name": "banned_addresses", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "banned_addresses_email_unique": { - "name": "banned_addresses_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenges": { - "name": "challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "challenges_created_by_users_id_fk": { - "name": "challenges_created_by_users_id_fk", - "tableFrom": "challenges", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "pre_registration_open": { - "name": "pre_registration_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "shotgun_open": { - "name": "shotgun_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "sdi_open": { - "name": "sdi_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "wei_open": { - "name": "wei_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "food_open": { - "name": "food_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "chall_open": { - "name": "chall_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.factions": { - "name": "factions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "factions_name_unique": { - "name": "factions_name_unique", - "columns": [ - "name" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.news": { - "name": "news", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "target": { - "name": "target", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permanences": { - "name": "permanences", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "start_at": { - "name": "start_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_open": { - "name": "is_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "difficulty": { - "name": "difficulty", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "columns": [ - "name" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "socialLink": { - "name": "socialLink", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "riCompatible": { - "name": "riCompatible", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_unique": { - "name": "teams_name_unique", - "columns": [ - "name" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "majeur": { - "name": "majeur", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "male": { - "name": "male", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "branch": { - "name": "branch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contact": { - "name": "contact", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'Nouveau'" - }, - "discord_id": { - "name": "discord_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "vss_form": { - "name": "vss_form", - "type": "vss_form", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'pending'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmquestion": { - "name": "vssqcmquestion", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "question": { - "name": "question", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "question_en": { - "name": "question_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.bus_attribution": { - "name": "bus_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bus": { - "name": "bus", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "departure_time": { - "name": "departure_time", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "bus_attribution_user_id_users_id_fk": { - "name": "bus_attribution_user_id_users_id_fk", - "tableFrom": "bus_attribution", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenge_validation": { - "name": "challenge_validation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "challenge_id": { - "name": "challenge_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_by_admin_id": { - "name": "validated_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_at": { - "name": "validated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "target_user_id": { - "name": "target_user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_team_id": { - "name": "target_team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_faction_id": { - "name": "target_faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "added_by_admin_id": { - "name": "added_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "challenge_validation_challenge_id_challenges_id_fk": { - "name": "challenge_validation_challenge_id_challenges_id_fk", - "tableFrom": "challenge_validation", - "columnsFrom": [ - "challenge_id" - ], - "tableTo": "challenges", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "challenge_validation_validated_by_admin_id_users_id_fk": { - "name": "challenge_validation_validated_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "columnsFrom": [ - "validated_by_admin_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "challenge_validation_target_user_id_users_id_fk": { - "name": "challenge_validation_target_user_id_users_id_fk", - "tableFrom": "challenge_validation", - "columnsFrom": [ - "target_user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "challenge_validation_target_team_id_teams_id_fk": { - "name": "challenge_validation_target_team_id_teams_id_fk", - "tableFrom": "challenge_validation", - "columnsFrom": [ - "target_team_id" - ], - "tableTo": "teams", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "challenge_validation_target_faction_id_factions_id_fk": { - "name": "challenge_validation_target_faction_id_factions_id_fk", - "tableFrom": "challenge_validation", - "columnsFrom": [ - "target_faction_id" - ], - "tableTo": "factions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "challenge_validation_added_by_admin_id_users_id_fk": { - "name": "challenge_validation_added_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "columnsFrom": [ - "added_by_admin_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.maker_battle_attribution": { - "name": "maker_battle_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "maker_team_id": { - "name": "maker_team_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "table": { - "name": "table", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group": { - "name": "group", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "maker_battle_attribution_user_id_users_id_fk": { - "name": "maker_battle_attribution_user_id_users_id_fk", - "tableFrom": "maker_battle_attribution", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.registration_tokens": { - "name": "registration_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_tokens_user_id_users_id_fk": { - "name": "registration_tokens_user_id_users_id_fk", - "tableFrom": "registration_tokens", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "registration_tokens_token_unique": { - "name": "registration_tokens_token_unique", - "columns": [ - "token" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.role_points": { - "name": "role_points", - "schema": "", - "columns": { - "role_points": { - "name": "role_points", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "role_points_role_points_roles_id_fk": { - "name": "role_points_role_points_roles_id_fk", - "tableFrom": "role_points", - "columnsFrom": [ - "role_points" - ], - "tableTo": "roles", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "role_points_role_points_pk": { - "name": "role_points_role_points_pk", - "columns": [ - "role_points" - ] - } - }, - "uniqueConstraints": { - "role_points_role_points_unique": { - "name": "role_points_role_points_unique", - "columns": [ - "role_points" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_faction": { - "name": "team_faction", - "schema": "", - "columns": { - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "team_faction_faction_id_factions_id_fk": { - "name": "team_faction_faction_id_factions_id_fk", - "tableFrom": "team_faction", - "columnsFrom": [ - "faction_id" - ], - "tableTo": "factions", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "team_faction_team_id_teams_id_fk": { - "name": "team_faction_team_id_teams_id_fk", - "tableFrom": "team_faction", - "columnsFrom": [ - "team_id" - ], - "tableTo": "teams", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "team_faction_faction_id_team_id_pk": { - "name": "team_faction_faction_id_team_id_pk", - "columns": [ - "faction_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_shotgun": { - "name": "team_shotgun", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_shotgun_team_id_teams_id_fk": { - "name": "team_shotgun_team_id_teams_id_fk", - "tableFrom": "team_shotgun", - "columnsFrom": [ - "team_id" - ], - "tableTo": "teams", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_informations": { - "name": "user_informations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "emergency_contact_name": { - "name": "emergency_contact_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "emergency_contact_phone": { - "name": "emergency_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_informations_user_id_users_id_fk": { - "name": "user_informations_user_id_users_id_fk", - "tableFrom": "user_informations", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.respo_permanences": { - "name": "respo_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "respo_permanences_user_id_users_id_fk": { - "name": "respo_permanences_user_id_users_id_fk", - "tableFrom": "respo_permanences", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "respo_permanences_permanence_id_permanences_id_fk": { - "name": "respo_permanences_permanence_id_permanences_id_fk", - "tableFrom": "respo_permanences", - "columnsFrom": [ - "permanence_id" - ], - "tableTo": "permanences", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "respo_permanences_user_id_permanence_id_pk": { - "name": "respo_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_permanences": { - "name": "user_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "registered_at": { - "name": "registered_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "claimed": { - "name": "claimed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_permanences_user_id_users_id_fk": { - "name": "user_permanences_user_id_users_id_fk", - "tableFrom": "user_permanences", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "user_permanences_permanence_id_permanences_id_fk": { - "name": "user_permanences_permanence_id_permanences_id_fk", - "tableFrom": "user_permanences", - "columnsFrom": [ - "permanence_id" - ], - "tableTo": "permanences", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "user_permanences_user_id_permanence_id_pk": { - "name": "user_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_preferences": { - "name": "user_preferences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "user_preferences_role_id_roles_id_fk": { - "name": "user_preferences_role_id_roles_id_fk", - "tableFrom": "user_preferences", - "columnsFrom": [ - "role_id" - ], - "tableTo": "roles", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "user_preferences_user_id_role_id_pk": { - "name": "user_preferences_user_id_role_id_pk", - "columns": [ - "user_id", - "role_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_roles_user_id_users_id_fk": { - "name": "user_roles_user_id_users_id_fk", - "tableFrom": "user_roles", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "user_roles_role_id_roles_id_fk": { - "name": "user_roles_role_id_roles_id_fk", - "tableFrom": "user_roles", - "columnsFrom": [ - "role_id" - ], - "tableTo": "roles", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_teams": { - "name": "user_teams", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_teams_user_id_users_id_fk": { - "name": "user_teams_user_id_users_id_fk", - "tableFrom": "user_teams", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "user_teams_team_id_teams_id_fk": { - "name": "user_teams_team_id_teams_id_fk", - "tableFrom": "user_teams", - "columnsFrom": [ - "team_id" - ], - "tableTo": "teams", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "user_teams_user_id_team_id_pk": { - "name": "user_teams_user_id_team_id_pk", - "columns": [ - "user_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_tent": { - "name": "user_tent", - "schema": "", - "columns": { - "user_id_1": { - "name": "user_id_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_id_2": { - "name": "user_id_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "confirmed": { - "name": "confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_tent_user_id_1_users_id_fk": { - "name": "user_tent_user_id_1_users_id_fk", - "tableFrom": "user_tent", - "columnsFrom": [ - "user_id_1" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "user_tent_user_id_2_users_id_fk": { - "name": "user_tent_user_id_2_users_id_fk", - "tableFrom": "user_tent", - "columnsFrom": [ - "user_id_2" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "user_tent_user_id_1_user_id_2_pk": { - "name": "user_tent_user_id_1_user_id_2_pk", - "columns": [ - "user_id_1", - "user_id_2" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmanswer": { - "name": "vssqcmanswer", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "questionid": { - "name": "questionid", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "answer_en": { - "name": "answer_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_correct": { - "name": "is_correct", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "vssqcmanswer_questionid_vssqcmquestion_id_fk": { - "name": "vssqcmanswer_questionid_vssqcmquestion_id_fk", - "tableFrom": "vssqcmanswer", - "columnsFrom": [ - "questionid" - ], - "tableTo": "vssqcmquestion", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.vss_form": { - "name": "vss_form", - "schema": "public", - "values": [ - "pending", - "toretry", - "validated", - "rejected" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "single_choice", - "multiple_choice" - ] - } - }, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/backend/src/database/migrations/meta/0034_snapshot.json b/backend/src/database/migrations/meta/0034_snapshot.json deleted file mode 100644 index cd432ec..0000000 --- a/backend/src/database/migrations/meta/0034_snapshot.json +++ /dev/null @@ -1,1509 +0,0 @@ -{ - "id": "b3eadc8d-72e4-4ed0-b6cb-433b7168abb3", - "prevId": "2d4ec509-7053-40cb-925b-ddada5fdf0e5", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.banned_addresses": { - "name": "banned_addresses", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "banned_addresses_email_unique": { - "name": "banned_addresses_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenges": { - "name": "challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "challenges_created_by_users_id_fk": { - "name": "challenges_created_by_users_id_fk", - "tableFrom": "challenges", - "tableTo": "users", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "pre_registration_open": { - "name": "pre_registration_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "shotgun_open": { - "name": "shotgun_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "sdi_open": { - "name": "sdi_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "wei_open": { - "name": "wei_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "food_open": { - "name": "food_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "chall_open": { - "name": "chall_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.factions": { - "name": "factions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "factions_name_unique": { - "name": "factions_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.news": { - "name": "news", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "target": { - "name": "target", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permanences": { - "name": "permanences", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "start_at": { - "name": "start_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_open": { - "name": "is_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "difficulty": { - "name": "difficulty", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "socialLink": { - "name": "socialLink", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "riCompatible": { - "name": "riCompatible", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_unique": { - "name": "teams_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "majeur": { - "name": "majeur", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "male": { - "name": "male", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "branch": { - "name": "branch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contact": { - "name": "contact", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'Nouveau'" - }, - "discord_id": { - "name": "discord_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "vss_form": { - "name": "vss_form", - "type": "vss_form", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'pending'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmquestion": { - "name": "vssqcmquestion", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "question": { - "name": "question", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "question_en": { - "name": "question_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.bus_attribution": { - "name": "bus_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bus": { - "name": "bus", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "departure_time": { - "name": "departure_time", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "bus_attribution_user_id_users_id_fk": { - "name": "bus_attribution_user_id_users_id_fk", - "tableFrom": "bus_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenge_validation": { - "name": "challenge_validation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "challenge_id": { - "name": "challenge_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_by_admin_id": { - "name": "validated_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_at": { - "name": "validated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "target_user_id": { - "name": "target_user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_team_id": { - "name": "target_team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_faction_id": { - "name": "target_faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "added_by_admin_id": { - "name": "added_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "challenge_validation_challenge_id_challenges_id_fk": { - "name": "challenge_validation_challenge_id_challenges_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "challenges", - "columnsFrom": [ - "challenge_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_validated_by_admin_id_users_id_fk": { - "name": "challenge_validation_validated_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "validated_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_user_id_users_id_fk": { - "name": "challenge_validation_target_user_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "target_user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_team_id_teams_id_fk": { - "name": "challenge_validation_target_team_id_teams_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "teams", - "columnsFrom": [ - "target_team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_faction_id_factions_id_fk": { - "name": "challenge_validation_target_faction_id_factions_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "factions", - "columnsFrom": [ - "target_faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_added_by_admin_id_users_id_fk": { - "name": "challenge_validation_added_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "added_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.registration_tokens": { - "name": "registration_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_tokens_user_id_users_id_fk": { - "name": "registration_tokens_user_id_users_id_fk", - "tableFrom": "registration_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "registration_tokens_token_unique": { - "name": "registration_tokens_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.role_points": { - "name": "role_points", - "schema": "", - "columns": { - "role_points": { - "name": "role_points", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "role_points_role_points_roles_id_fk": { - "name": "role_points_role_points_roles_id_fk", - "tableFrom": "role_points", - "tableTo": "roles", - "columnsFrom": [ - "role_points" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "role_points_role_points_pk": { - "name": "role_points_role_points_pk", - "columns": [ - "role_points" - ] - } - }, - "uniqueConstraints": { - "role_points_role_points_unique": { - "name": "role_points_role_points_unique", - "nullsNotDistinct": false, - "columns": [ - "role_points" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_faction": { - "name": "team_faction", - "schema": "", - "columns": { - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "team_faction_faction_id_factions_id_fk": { - "name": "team_faction_faction_id_factions_id_fk", - "tableFrom": "team_faction", - "tableTo": "factions", - "columnsFrom": [ - "faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_faction_team_id_teams_id_fk": { - "name": "team_faction_team_id_teams_id_fk", - "tableFrom": "team_faction", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_faction_faction_id_team_id_pk": { - "name": "team_faction_faction_id_team_id_pk", - "columns": [ - "faction_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_shotgun": { - "name": "team_shotgun", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_shotgun_team_id_teams_id_fk": { - "name": "team_shotgun_team_id_teams_id_fk", - "tableFrom": "team_shotgun", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_informations": { - "name": "user_informations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "emergency_contact_name": { - "name": "emergency_contact_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "emergency_contact_phone": { - "name": "emergency_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_informations_user_id_users_id_fk": { - "name": "user_informations_user_id_users_id_fk", - "tableFrom": "user_informations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.respo_permanences": { - "name": "respo_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "respo_permanences_user_id_users_id_fk": { - "name": "respo_permanences_user_id_users_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "respo_permanences_permanence_id_permanences_id_fk": { - "name": "respo_permanences_permanence_id_permanences_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "respo_permanences_user_id_permanence_id_pk": { - "name": "respo_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_permanences": { - "name": "user_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "registered_at": { - "name": "registered_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "claimed": { - "name": "claimed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_permanences_user_id_users_id_fk": { - "name": "user_permanences_user_id_users_id_fk", - "tableFrom": "user_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_permanences_permanence_id_permanences_id_fk": { - "name": "user_permanences_permanence_id_permanences_id_fk", - "tableFrom": "user_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_permanences_user_id_permanence_id_pk": { - "name": "user_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_preferences": { - "name": "user_preferences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_preferences_role_id_roles_id_fk": { - "name": "user_preferences_role_id_roles_id_fk", - "tableFrom": "user_preferences", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_preferences_user_id_role_id_pk": { - "name": "user_preferences_user_id_role_id_pk", - "columns": [ - "user_id", - "role_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "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": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_teams": { - "name": "user_teams", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_teams_user_id_users_id_fk": { - "name": "user_teams_user_id_users_id_fk", - "tableFrom": "user_teams", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_teams_team_id_teams_id_fk": { - "name": "user_teams_team_id_teams_id_fk", - "tableFrom": "user_teams", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_teams_user_id_team_id_pk": { - "name": "user_teams_user_id_team_id_pk", - "columns": [ - "user_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_tent": { - "name": "user_tent", - "schema": "", - "columns": { - "user_id_1": { - "name": "user_id_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_id_2": { - "name": "user_id_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "confirmed": { - "name": "confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_tent_user_id_1_users_id_fk": { - "name": "user_tent_user_id_1_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_tent_user_id_2_users_id_fk": { - "name": "user_tent_user_id_2_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_tent_user_id_1_user_id_2_pk": { - "name": "user_tent_user_id_1_user_id_2_pk", - "columns": [ - "user_id_1", - "user_id_2" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmanswer": { - "name": "vssqcmanswer", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "questionid": { - "name": "questionid", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "answer_en": { - "name": "answer_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_correct": { - "name": "is_correct", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "vssqcmanswer_questionid_vssqcmquestion_id_fk": { - "name": "vssqcmanswer_questionid_vssqcmquestion_id_fk", - "tableFrom": "vssqcmanswer", - "tableTo": "vssqcmquestion", - "columnsFrom": [ - "questionid" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.vss_form": { - "name": "vss_form", - "schema": "public", - "values": [ - "pending", - "toretry", - "validated", - "rejected" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "single_choice", - "multiple_choice" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/backend/src/database/migrations/meta/0035_snapshot.json b/backend/src/database/migrations/meta/0035_snapshot.json deleted file mode 100644 index 5e5734f..0000000 --- a/backend/src/database/migrations/meta/0035_snapshot.json +++ /dev/null @@ -1,1560 +0,0 @@ -{ - "id": "0b81a110-c9ff-40ed-b059-b1c38118f33c", - "prevId": "b3eadc8d-72e4-4ed0-b6cb-433b7168abb3", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.banned_addresses": { - "name": "banned_addresses", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "banned_addresses_email_unique": { - "name": "banned_addresses_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenges": { - "name": "challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "challenges_created_by_users_id_fk": { - "name": "challenges_created_by_users_id_fk", - "tableFrom": "challenges", - "tableTo": "users", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "pre_registration_open": { - "name": "pre_registration_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "shotgun_open": { - "name": "shotgun_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "sdi_open": { - "name": "sdi_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "wei_open": { - "name": "wei_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "food_open": { - "name": "food_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "chall_open": { - "name": "chall_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.factions": { - "name": "factions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "factions_name_unique": { - "name": "factions_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.news": { - "name": "news", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "target": { - "name": "target", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permanences": { - "name": "permanences", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "start_at": { - "name": "start_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_open": { - "name": "is_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "difficulty": { - "name": "difficulty", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "socialLink": { - "name": "socialLink", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "riCompatible": { - "name": "riCompatible", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_unique": { - "name": "teams_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "majeur": { - "name": "majeur", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "male": { - "name": "male", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "branch": { - "name": "branch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contact": { - "name": "contact", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'Nouveau'" - }, - "discord_id": { - "name": "discord_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "vss_form": { - "name": "vss_form", - "type": "vss_form", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'pending'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmquestion": { - "name": "vssqcmquestion", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "question": { - "name": "question", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "question_en": { - "name": "question_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.bus_attribution": { - "name": "bus_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bus": { - "name": "bus", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "departure_time": { - "name": "departure_time", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "bus_attribution_user_id_users_id_fk": { - "name": "bus_attribution_user_id_users_id_fk", - "tableFrom": "bus_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenge_validation": { - "name": "challenge_validation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "challenge_id": { - "name": "challenge_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_by_admin_id": { - "name": "validated_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_at": { - "name": "validated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "target_user_id": { - "name": "target_user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_team_id": { - "name": "target_team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_faction_id": { - "name": "target_faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "added_by_admin_id": { - "name": "added_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "challenge_validation_challenge_id_challenges_id_fk": { - "name": "challenge_validation_challenge_id_challenges_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "challenges", - "columnsFrom": [ - "challenge_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_validated_by_admin_id_users_id_fk": { - "name": "challenge_validation_validated_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "validated_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_user_id_users_id_fk": { - "name": "challenge_validation_target_user_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "target_user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_team_id_teams_id_fk": { - "name": "challenge_validation_target_team_id_teams_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "teams", - "columnsFrom": [ - "target_team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_faction_id_factions_id_fk": { - "name": "challenge_validation_target_faction_id_factions_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "factions", - "columnsFrom": [ - "target_faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_added_by_admin_id_users_id_fk": { - "name": "challenge_validation_added_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "added_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.maker_battle_attribution": { - "name": "maker_battle_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "maker_team_id": { - "name": "maker_team_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "table": { - "name": "table", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group": { - "name": "group", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "maker_battle_attribution_user_id_users_id_fk": { - "name": "maker_battle_attribution_user_id_users_id_fk", - "tableFrom": "maker_battle_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.registration_tokens": { - "name": "registration_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_tokens_user_id_users_id_fk": { - "name": "registration_tokens_user_id_users_id_fk", - "tableFrom": "registration_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "registration_tokens_token_unique": { - "name": "registration_tokens_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.role_points": { - "name": "role_points", - "schema": "", - "columns": { - "role_points": { - "name": "role_points", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "role_points_role_points_roles_id_fk": { - "name": "role_points_role_points_roles_id_fk", - "tableFrom": "role_points", - "tableTo": "roles", - "columnsFrom": [ - "role_points" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "role_points_role_points_pk": { - "name": "role_points_role_points_pk", - "columns": [ - "role_points" - ] - } - }, - "uniqueConstraints": { - "role_points_role_points_unique": { - "name": "role_points_role_points_unique", - "nullsNotDistinct": false, - "columns": [ - "role_points" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_faction": { - "name": "team_faction", - "schema": "", - "columns": { - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "team_faction_faction_id_factions_id_fk": { - "name": "team_faction_faction_id_factions_id_fk", - "tableFrom": "team_faction", - "tableTo": "factions", - "columnsFrom": [ - "faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_faction_team_id_teams_id_fk": { - "name": "team_faction_team_id_teams_id_fk", - "tableFrom": "team_faction", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_faction_faction_id_team_id_pk": { - "name": "team_faction_faction_id_team_id_pk", - "columns": [ - "faction_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_shotgun": { - "name": "team_shotgun", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_shotgun_team_id_teams_id_fk": { - "name": "team_shotgun_team_id_teams_id_fk", - "tableFrom": "team_shotgun", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_informations": { - "name": "user_informations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "emergency_contact_name": { - "name": "emergency_contact_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "emergency_contact_phone": { - "name": "emergency_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_informations_user_id_users_id_fk": { - "name": "user_informations_user_id_users_id_fk", - "tableFrom": "user_informations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.respo_permanences": { - "name": "respo_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "respo_permanences_user_id_users_id_fk": { - "name": "respo_permanences_user_id_users_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "respo_permanences_permanence_id_permanences_id_fk": { - "name": "respo_permanences_permanence_id_permanences_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "respo_permanences_user_id_permanence_id_pk": { - "name": "respo_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_permanences": { - "name": "user_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "registered_at": { - "name": "registered_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "claimed": { - "name": "claimed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_permanences_user_id_users_id_fk": { - "name": "user_permanences_user_id_users_id_fk", - "tableFrom": "user_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_permanences_permanence_id_permanences_id_fk": { - "name": "user_permanences_permanence_id_permanences_id_fk", - "tableFrom": "user_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_permanences_user_id_permanence_id_pk": { - "name": "user_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_preferences": { - "name": "user_preferences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_preferences_role_id_roles_id_fk": { - "name": "user_preferences_role_id_roles_id_fk", - "tableFrom": "user_preferences", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_preferences_user_id_role_id_pk": { - "name": "user_preferences_user_id_role_id_pk", - "columns": [ - "user_id", - "role_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "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": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_teams": { - "name": "user_teams", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_teams_user_id_users_id_fk": { - "name": "user_teams_user_id_users_id_fk", - "tableFrom": "user_teams", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_teams_team_id_teams_id_fk": { - "name": "user_teams_team_id_teams_id_fk", - "tableFrom": "user_teams", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_teams_user_id_team_id_pk": { - "name": "user_teams_user_id_team_id_pk", - "columns": [ - "user_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_tent": { - "name": "user_tent", - "schema": "", - "columns": { - "user_id_1": { - "name": "user_id_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_id_2": { - "name": "user_id_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "confirmed": { - "name": "confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_tent_user_id_1_users_id_fk": { - "name": "user_tent_user_id_1_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_tent_user_id_2_users_id_fk": { - "name": "user_tent_user_id_2_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_tent_user_id_1_user_id_2_pk": { - "name": "user_tent_user_id_1_user_id_2_pk", - "columns": [ - "user_id_1", - "user_id_2" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmanswer": { - "name": "vssqcmanswer", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "questionid": { - "name": "questionid", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "answer_en": { - "name": "answer_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_correct": { - "name": "is_correct", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "vssqcmanswer_questionid_vssqcmquestion_id_fk": { - "name": "vssqcmanswer_questionid_vssqcmquestion_id_fk", - "tableFrom": "vssqcmanswer", - "tableTo": "vssqcmquestion", - "columnsFrom": [ - "questionid" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.vss_form": { - "name": "vss_form", - "schema": "public", - "values": [ - "pending", - "toretry", - "validated", - "rejected" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "single_choice", - "multiple_choice" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/backend/src/database/migrations/meta/0036_snapshot.json b/backend/src/database/migrations/meta/0036_snapshot.json deleted file mode 100644 index 4ce976d..0000000 --- a/backend/src/database/migrations/meta/0036_snapshot.json +++ /dev/null @@ -1,1560 +0,0 @@ -{ - "id": "1f1bb8b2-c15f-4e38-8e8a-0cf2277c5cea", - "prevId": "0b81a110-c9ff-40ed-b059-b1c38118f33c", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.banned_addresses": { - "name": "banned_addresses", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "banned_addresses_email_unique": { - "name": "banned_addresses_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenges": { - "name": "challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "challenges_created_by_users_id_fk": { - "name": "challenges_created_by_users_id_fk", - "tableFrom": "challenges", - "tableTo": "users", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "pre_registration_open": { - "name": "pre_registration_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "shotgun_open": { - "name": "shotgun_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "sdi_open": { - "name": "sdi_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "wei_open": { - "name": "wei_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "food_open": { - "name": "food_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "chall_open": { - "name": "chall_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.factions": { - "name": "factions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "factions_name_unique": { - "name": "factions_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.news": { - "name": "news", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "target": { - "name": "target", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permanences": { - "name": "permanences", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "start_at": { - "name": "start_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_open": { - "name": "is_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "difficulty": { - "name": "difficulty", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "socialLink": { - "name": "socialLink", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "riCompatible": { - "name": "riCompatible", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_unique": { - "name": "teams_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "majeur": { - "name": "majeur", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "male": { - "name": "male", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "branch": { - "name": "branch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contact": { - "name": "contact", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'Nouveau'" - }, - "discord_id": { - "name": "discord_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "vss_form": { - "name": "vss_form", - "type": "vss_form", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'pending'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmquestion": { - "name": "vssqcmquestion", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "question": { - "name": "question", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "question_en": { - "name": "question_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.bus_attribution": { - "name": "bus_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bus": { - "name": "bus", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "departure_time": { - "name": "departure_time", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "bus_attribution_user_id_users_id_fk": { - "name": "bus_attribution_user_id_users_id_fk", - "tableFrom": "bus_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenge_validation": { - "name": "challenge_validation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "challenge_id": { - "name": "challenge_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_by_admin_id": { - "name": "validated_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_at": { - "name": "validated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "target_user_id": { - "name": "target_user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_team_id": { - "name": "target_team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_faction_id": { - "name": "target_faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "added_by_admin_id": { - "name": "added_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "challenge_validation_challenge_id_challenges_id_fk": { - "name": "challenge_validation_challenge_id_challenges_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "challenges", - "columnsFrom": [ - "challenge_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_validated_by_admin_id_users_id_fk": { - "name": "challenge_validation_validated_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "validated_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_user_id_users_id_fk": { - "name": "challenge_validation_target_user_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "target_user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_team_id_teams_id_fk": { - "name": "challenge_validation_target_team_id_teams_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "teams", - "columnsFrom": [ - "target_team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_faction_id_factions_id_fk": { - "name": "challenge_validation_target_faction_id_factions_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "factions", - "columnsFrom": [ - "target_faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_added_by_admin_id_users_id_fk": { - "name": "challenge_validation_added_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "added_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.maker_battle_attribution": { - "name": "maker_battle_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "maker_team_id": { - "name": "maker_team_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "table": { - "name": "table", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "group": { - "name": "group", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "maker_battle_attribution_user_id_users_id_fk": { - "name": "maker_battle_attribution_user_id_users_id_fk", - "tableFrom": "maker_battle_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.registration_tokens": { - "name": "registration_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_tokens_user_id_users_id_fk": { - "name": "registration_tokens_user_id_users_id_fk", - "tableFrom": "registration_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "registration_tokens_token_unique": { - "name": "registration_tokens_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.role_points": { - "name": "role_points", - "schema": "", - "columns": { - "role_points": { - "name": "role_points", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "role_points_role_points_roles_id_fk": { - "name": "role_points_role_points_roles_id_fk", - "tableFrom": "role_points", - "tableTo": "roles", - "columnsFrom": [ - "role_points" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "role_points_role_points_pk": { - "name": "role_points_role_points_pk", - "columns": [ - "role_points" - ] - } - }, - "uniqueConstraints": { - "role_points_role_points_unique": { - "name": "role_points_role_points_unique", - "nullsNotDistinct": false, - "columns": [ - "role_points" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_faction": { - "name": "team_faction", - "schema": "", - "columns": { - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "team_faction_faction_id_factions_id_fk": { - "name": "team_faction_faction_id_factions_id_fk", - "tableFrom": "team_faction", - "tableTo": "factions", - "columnsFrom": [ - "faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_faction_team_id_teams_id_fk": { - "name": "team_faction_team_id_teams_id_fk", - "tableFrom": "team_faction", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_faction_faction_id_team_id_pk": { - "name": "team_faction_faction_id_team_id_pk", - "columns": [ - "faction_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_shotgun": { - "name": "team_shotgun", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_shotgun_team_id_teams_id_fk": { - "name": "team_shotgun_team_id_teams_id_fk", - "tableFrom": "team_shotgun", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_informations": { - "name": "user_informations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "emergency_contact_name": { - "name": "emergency_contact_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "emergency_contact_phone": { - "name": "emergency_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_informations_user_id_users_id_fk": { - "name": "user_informations_user_id_users_id_fk", - "tableFrom": "user_informations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.respo_permanences": { - "name": "respo_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "respo_permanences_user_id_users_id_fk": { - "name": "respo_permanences_user_id_users_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "respo_permanences_permanence_id_permanences_id_fk": { - "name": "respo_permanences_permanence_id_permanences_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "respo_permanences_user_id_permanence_id_pk": { - "name": "respo_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_permanences": { - "name": "user_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "registered_at": { - "name": "registered_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "claimed": { - "name": "claimed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_permanences_user_id_users_id_fk": { - "name": "user_permanences_user_id_users_id_fk", - "tableFrom": "user_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_permanences_permanence_id_permanences_id_fk": { - "name": "user_permanences_permanence_id_permanences_id_fk", - "tableFrom": "user_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_permanences_user_id_permanence_id_pk": { - "name": "user_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_preferences": { - "name": "user_preferences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_preferences_role_id_roles_id_fk": { - "name": "user_preferences_role_id_roles_id_fk", - "tableFrom": "user_preferences", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_preferences_user_id_role_id_pk": { - "name": "user_preferences_user_id_role_id_pk", - "columns": [ - "user_id", - "role_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "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": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_teams": { - "name": "user_teams", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_teams_user_id_users_id_fk": { - "name": "user_teams_user_id_users_id_fk", - "tableFrom": "user_teams", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_teams_team_id_teams_id_fk": { - "name": "user_teams_team_id_teams_id_fk", - "tableFrom": "user_teams", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_teams_user_id_team_id_pk": { - "name": "user_teams_user_id_team_id_pk", - "columns": [ - "user_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_tent": { - "name": "user_tent", - "schema": "", - "columns": { - "user_id_1": { - "name": "user_id_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_id_2": { - "name": "user_id_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "confirmed": { - "name": "confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_tent_user_id_1_users_id_fk": { - "name": "user_tent_user_id_1_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_tent_user_id_2_users_id_fk": { - "name": "user_tent_user_id_2_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_tent_user_id_1_user_id_2_pk": { - "name": "user_tent_user_id_1_user_id_2_pk", - "columns": [ - "user_id_1", - "user_id_2" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmanswer": { - "name": "vssqcmanswer", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "questionid": { - "name": "questionid", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "answer_en": { - "name": "answer_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_correct": { - "name": "is_correct", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "vssqcmanswer_questionid_vssqcmquestion_id_fk": { - "name": "vssqcmanswer_questionid_vssqcmquestion_id_fk", - "tableFrom": "vssqcmanswer", - "tableTo": "vssqcmquestion", - "columnsFrom": [ - "questionid" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.vss_form": { - "name": "vss_form", - "schema": "public", - "values": [ - "pending", - "toretry", - "validated", - "rejected" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "single_choice", - "multiple_choice" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/backend/src/database/migrations/meta/0037_snapshot.json b/backend/src/database/migrations/meta/0037_snapshot.json deleted file mode 100644 index a68cfb5..0000000 --- a/backend/src/database/migrations/meta/0037_snapshot.json +++ /dev/null @@ -1,1560 +0,0 @@ -{ - "id": "004b7708-9b6c-4bce-8cfd-5a0c34bd5db1", - "prevId": "1f1bb8b2-c15f-4e38-8e8a-0cf2277c5cea", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.banned_addresses": { - "name": "banned_addresses", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "banned_addresses_email_unique": { - "name": "banned_addresses_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenges": { - "name": "challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "challenges_created_by_users_id_fk": { - "name": "challenges_created_by_users_id_fk", - "tableFrom": "challenges", - "tableTo": "users", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "pre_registration_open": { - "name": "pre_registration_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "shotgun_open": { - "name": "shotgun_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "sdi_open": { - "name": "sdi_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "wei_open": { - "name": "wei_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "food_open": { - "name": "food_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "chall_open": { - "name": "chall_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.factions": { - "name": "factions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "factions_name_unique": { - "name": "factions_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.news": { - "name": "news", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "target": { - "name": "target", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permanences": { - "name": "permanences", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "start_at": { - "name": "start_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_open": { - "name": "is_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "difficulty": { - "name": "difficulty", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "socialLink": { - "name": "socialLink", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "riCompatible": { - "name": "riCompatible", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_unique": { - "name": "teams_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "majeur": { - "name": "majeur", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "male": { - "name": "male", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "branch": { - "name": "branch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contact": { - "name": "contact", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'Nouveau'" - }, - "discord_id": { - "name": "discord_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "vss_form": { - "name": "vss_form", - "type": "vss_form", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'pending'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmquestion": { - "name": "vssqcmquestion", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "question": { - "name": "question", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "question_en": { - "name": "question_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.bus_attribution": { - "name": "bus_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bus": { - "name": "bus", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "departure_time": { - "name": "departure_time", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "bus_attribution_user_id_users_id_fk": { - "name": "bus_attribution_user_id_users_id_fk", - "tableFrom": "bus_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenge_validation": { - "name": "challenge_validation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "challenge_id": { - "name": "challenge_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_by_admin_id": { - "name": "validated_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_at": { - "name": "validated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "target_user_id": { - "name": "target_user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_team_id": { - "name": "target_team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_faction_id": { - "name": "target_faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "added_by_admin_id": { - "name": "added_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "challenge_validation_challenge_id_challenges_id_fk": { - "name": "challenge_validation_challenge_id_challenges_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "challenges", - "columnsFrom": [ - "challenge_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_validated_by_admin_id_users_id_fk": { - "name": "challenge_validation_validated_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "validated_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_user_id_users_id_fk": { - "name": "challenge_validation_target_user_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "target_user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_team_id_teams_id_fk": { - "name": "challenge_validation_target_team_id_teams_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "teams", - "columnsFrom": [ - "target_team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_faction_id_factions_id_fk": { - "name": "challenge_validation_target_faction_id_factions_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "factions", - "columnsFrom": [ - "target_faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_added_by_admin_id_users_id_fk": { - "name": "challenge_validation_added_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "added_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.maker_battle_attribution": { - "name": "maker_battle_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "maker_team_id": { - "name": "maker_team_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "table": { - "name": "table", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "group": { - "name": "group", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "maker_battle_attribution_user_id_users_id_fk": { - "name": "maker_battle_attribution_user_id_users_id_fk", - "tableFrom": "maker_battle_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.registration_tokens": { - "name": "registration_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_tokens_user_id_users_id_fk": { - "name": "registration_tokens_user_id_users_id_fk", - "tableFrom": "registration_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "registration_tokens_token_unique": { - "name": "registration_tokens_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.role_points": { - "name": "role_points", - "schema": "", - "columns": { - "role_points": { - "name": "role_points", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "role_points_role_points_roles_id_fk": { - "name": "role_points_role_points_roles_id_fk", - "tableFrom": "role_points", - "tableTo": "roles", - "columnsFrom": [ - "role_points" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "role_points_role_points_pk": { - "name": "role_points_role_points_pk", - "columns": [ - "role_points" - ] - } - }, - "uniqueConstraints": { - "role_points_role_points_unique": { - "name": "role_points_role_points_unique", - "nullsNotDistinct": false, - "columns": [ - "role_points" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_faction": { - "name": "team_faction", - "schema": "", - "columns": { - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "team_faction_faction_id_factions_id_fk": { - "name": "team_faction_faction_id_factions_id_fk", - "tableFrom": "team_faction", - "tableTo": "factions", - "columnsFrom": [ - "faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_faction_team_id_teams_id_fk": { - "name": "team_faction_team_id_teams_id_fk", - "tableFrom": "team_faction", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_faction_faction_id_team_id_pk": { - "name": "team_faction_faction_id_team_id_pk", - "columns": [ - "faction_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_shotgun": { - "name": "team_shotgun", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_shotgun_team_id_teams_id_fk": { - "name": "team_shotgun_team_id_teams_id_fk", - "tableFrom": "team_shotgun", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_informations": { - "name": "user_informations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "emergency_contact_name": { - "name": "emergency_contact_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "emergency_contact_phone": { - "name": "emergency_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_informations_user_id_users_id_fk": { - "name": "user_informations_user_id_users_id_fk", - "tableFrom": "user_informations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.respo_permanences": { - "name": "respo_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "respo_permanences_user_id_users_id_fk": { - "name": "respo_permanences_user_id_users_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "respo_permanences_permanence_id_permanences_id_fk": { - "name": "respo_permanences_permanence_id_permanences_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "respo_permanences_user_id_permanence_id_pk": { - "name": "respo_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_permanences": { - "name": "user_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "registered_at": { - "name": "registered_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "claimed": { - "name": "claimed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_permanences_user_id_users_id_fk": { - "name": "user_permanences_user_id_users_id_fk", - "tableFrom": "user_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_permanences_permanence_id_permanences_id_fk": { - "name": "user_permanences_permanence_id_permanences_id_fk", - "tableFrom": "user_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_permanences_user_id_permanence_id_pk": { - "name": "user_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_preferences": { - "name": "user_preferences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_preferences_role_id_roles_id_fk": { - "name": "user_preferences_role_id_roles_id_fk", - "tableFrom": "user_preferences", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_preferences_user_id_role_id_pk": { - "name": "user_preferences_user_id_role_id_pk", - "columns": [ - "user_id", - "role_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "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": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_teams": { - "name": "user_teams", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_teams_user_id_users_id_fk": { - "name": "user_teams_user_id_users_id_fk", - "tableFrom": "user_teams", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_teams_team_id_teams_id_fk": { - "name": "user_teams_team_id_teams_id_fk", - "tableFrom": "user_teams", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_teams_user_id_team_id_pk": { - "name": "user_teams_user_id_team_id_pk", - "columns": [ - "user_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_tent": { - "name": "user_tent", - "schema": "", - "columns": { - "user_id_1": { - "name": "user_id_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_id_2": { - "name": "user_id_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "confirmed": { - "name": "confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_tent_user_id_1_users_id_fk": { - "name": "user_tent_user_id_1_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_tent_user_id_2_users_id_fk": { - "name": "user_tent_user_id_2_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_tent_user_id_1_user_id_2_pk": { - "name": "user_tent_user_id_1_user_id_2_pk", - "columns": [ - "user_id_1", - "user_id_2" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmanswer": { - "name": "vssqcmanswer", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "questionid": { - "name": "questionid", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "answer_en": { - "name": "answer_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_correct": { - "name": "is_correct", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "vssqcmanswer_questionid_vssqcmquestion_id_fk": { - "name": "vssqcmanswer_questionid_vssqcmquestion_id_fk", - "tableFrom": "vssqcmanswer", - "tableTo": "vssqcmquestion", - "columnsFrom": [ - "questionid" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.vss_form": { - "name": "vss_form", - "schema": "public", - "values": [ - "pending", - "toretry", - "validated", - "rejected" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "single_choice", - "multiple_choice" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/backend/src/database/migrations/meta/0038_snapshot.json b/backend/src/database/migrations/meta/0038_snapshot.json deleted file mode 100644 index bbd12e9..0000000 --- a/backend/src/database/migrations/meta/0038_snapshot.json +++ /dev/null @@ -1,1566 +0,0 @@ -{ - "id": "1fbaa6e2-f8f6-44c8-bdc1-1fc3c86990bf", - "prevId": "004b7708-9b6c-4bce-8cfd-5a0c34bd5db1", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.banned_addresses": { - "name": "banned_addresses", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "banned_addresses_email_unique": { - "name": "banned_addresses_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenges": { - "name": "challenges", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "challenges_created_by_users_id_fk": { - "name": "challenges_created_by_users_id_fk", - "tableFrom": "challenges", - "tableTo": "users", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "pre_registration_open": { - "name": "pre_registration_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "shotgun_open": { - "name": "shotgun_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "sdi_open": { - "name": "sdi_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "wei_open": { - "name": "wei_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "food_open": { - "name": "food_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "chall_open": { - "name": "chall_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.factions": { - "name": "factions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "factions_name_unique": { - "name": "factions_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.news": { - "name": "news", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "published": { - "name": "published", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "target": { - "name": "target", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permanences": { - "name": "permanences", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "start_at": { - "name": "start_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_open": { - "name": "is_open", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "difficulty": { - "name": "difficulty", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.roles": { - "name": "roles", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "roles_name_unique": { - "name": "roles_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "socialLink": { - "name": "socialLink", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "riCompatible": { - "name": "riCompatible", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_unique": { - "name": "teams_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "majeur": { - "name": "majeur", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "male": { - "name": "male", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "branch": { - "name": "branch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "contact": { - "name": "contact", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'Nouveau'" - }, - "discord_id": { - "name": "discord_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "vss_form": { - "name": "vss_form", - "type": "vss_form", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'pending'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmquestion": { - "name": "vssqcmquestion", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "question": { - "name": "question", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "question_en": { - "name": "question_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.bus_attribution": { - "name": "bus_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bus": { - "name": "bus", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "departure_time": { - "name": "departure_time", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "bus_attribution_user_id_users_id_fk": { - "name": "bus_attribution_user_id_users_id_fk", - "tableFrom": "bus_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.challenge_validation": { - "name": "challenge_validation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "challenge_id": { - "name": "challenge_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_by_admin_id": { - "name": "validated_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "validated_at": { - "name": "validated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "target_user_id": { - "name": "target_user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_team_id": { - "name": "target_team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "target_faction_id": { - "name": "target_faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "added_by_admin_id": { - "name": "added_by_admin_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "challenge_validation_challenge_id_challenges_id_fk": { - "name": "challenge_validation_challenge_id_challenges_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "challenges", - "columnsFrom": [ - "challenge_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_validated_by_admin_id_users_id_fk": { - "name": "challenge_validation_validated_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "validated_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_user_id_users_id_fk": { - "name": "challenge_validation_target_user_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "target_user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_team_id_teams_id_fk": { - "name": "challenge_validation_target_team_id_teams_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "teams", - "columnsFrom": [ - "target_team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_target_faction_id_factions_id_fk": { - "name": "challenge_validation_target_faction_id_factions_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "factions", - "columnsFrom": [ - "target_faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "challenge_validation_added_by_admin_id_users_id_fk": { - "name": "challenge_validation_added_by_admin_id_users_id_fk", - "tableFrom": "challenge_validation", - "tableTo": "users", - "columnsFrom": [ - "added_by_admin_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.maker_battle_attribution": { - "name": "maker_battle_attribution", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "maker_team_id": { - "name": "maker_team_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "table": { - "name": "table", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "group": { - "name": "group", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "maker_battle_attribution_user_id_users_id_fk": { - "name": "maker_battle_attribution_user_id_users_id_fk", - "tableFrom": "maker_battle_attribution", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.registration_tokens": { - "name": "registration_tokens", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_tokens_user_id_users_id_fk": { - "name": "registration_tokens_user_id_users_id_fk", - "tableFrom": "registration_tokens", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "registration_tokens_token_unique": { - "name": "registration_tokens_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.role_points": { - "name": "role_points", - "schema": "", - "columns": { - "role_points": { - "name": "role_points", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "role_points_role_points_roles_id_fk": { - "name": "role_points_role_points_roles_id_fk", - "tableFrom": "role_points", - "tableTo": "roles", - "columnsFrom": [ - "role_points" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "role_points_role_points_pk": { - "name": "role_points_role_points_pk", - "columns": [ - "role_points" - ] - } - }, - "uniqueConstraints": { - "role_points_role_points_unique": { - "name": "role_points_role_points_unique", - "nullsNotDistinct": false, - "columns": [ - "role_points" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_faction": { - "name": "team_faction", - "schema": "", - "columns": { - "faction_id": { - "name": "faction_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "team_faction_faction_id_factions_id_fk": { - "name": "team_faction_faction_id_factions_id_fk", - "tableFrom": "team_faction", - "tableTo": "factions", - "columnsFrom": [ - "faction_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_faction_team_id_teams_id_fk": { - "name": "team_faction_team_id_teams_id_fk", - "tableFrom": "team_faction", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_faction_faction_id_team_id_pk": { - "name": "team_faction_faction_id_team_id_pk", - "columns": [ - "faction_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.team_shotgun": { - "name": "team_shotgun", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "team_shotgun_team_id_teams_id_fk": { - "name": "team_shotgun_team_id_teams_id_fk", - "tableFrom": "team_shotgun", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_informations": { - "name": "user_informations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "emergency_contact_name": { - "name": "emergency_contact_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "emergency_contact_phone": { - "name": "emergency_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_informations_user_id_users_id_fk": { - "name": "user_informations_user_id_users_id_fk", - "tableFrom": "user_informations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.respo_permanences": { - "name": "respo_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "respo_permanences_user_id_users_id_fk": { - "name": "respo_permanences_user_id_users_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "respo_permanences_permanence_id_permanences_id_fk": { - "name": "respo_permanences_permanence_id_permanences_id_fk", - "tableFrom": "respo_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "respo_permanences_user_id_permanence_id_pk": { - "name": "respo_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_permanences": { - "name": "user_permanences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "permanence_id": { - "name": "permanence_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "registered_at": { - "name": "registered_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "claimed": { - "name": "claimed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_permanences_user_id_users_id_fk": { - "name": "user_permanences_user_id_users_id_fk", - "tableFrom": "user_permanences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_permanences_permanence_id_permanences_id_fk": { - "name": "user_permanences_permanence_id_permanences_id_fk", - "tableFrom": "user_permanences", - "tableTo": "permanences", - "columnsFrom": [ - "permanence_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_permanences_user_id_permanence_id_pk": { - "name": "user_permanences_user_id_permanence_id_pk", - "columns": [ - "user_id", - "permanence_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_preferences": { - "name": "user_preferences", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_preferences_role_id_roles_id_fk": { - "name": "user_preferences_role_id_roles_id_fk", - "tableFrom": "user_preferences", - "tableTo": "roles", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_preferences_user_id_role_id_pk": { - "name": "user_preferences_user_id_role_id_pk", - "columns": [ - "user_id", - "role_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_roles": { - "name": "user_roles", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "role_id": { - "name": "role_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "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": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_teams": { - "name": "user_teams", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "team_id": { - "name": "team_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_teams_user_id_users_id_fk": { - "name": "user_teams_user_id_users_id_fk", - "tableFrom": "user_teams", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_teams_team_id_teams_id_fk": { - "name": "user_teams_team_id_teams_id_fk", - "tableFrom": "user_teams", - "tableTo": "teams", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_teams_user_id_team_id_pk": { - "name": "user_teams_user_id_team_id_pk", - "columns": [ - "user_id", - "team_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_tent": { - "name": "user_tent", - "schema": "", - "columns": { - "user_id_1": { - "name": "user_id_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_id_2": { - "name": "user_id_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "confirmed": { - "name": "confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_tent_user_id_1_users_id_fk": { - "name": "user_tent_user_id_1_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "user_tent_user_id_2_users_id_fk": { - "name": "user_tent_user_id_2_users_id_fk", - "tableFrom": "user_tent", - "tableTo": "users", - "columnsFrom": [ - "user_id_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_tent_user_id_1_user_id_2_pk": { - "name": "user_tent_user_id_1_user_id_2_pk", - "columns": [ - "user_id_1", - "user_id_2" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.vssqcmanswer": { - "name": "vssqcmanswer", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "questionid": { - "name": "questionid", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "answer_en": { - "name": "answer_en", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_correct": { - "name": "is_correct", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "vssqcmanswer_questionid_vssqcmquestion_id_fk": { - "name": "vssqcmanswer_questionid_vssqcmquestion_id_fk", - "tableFrom": "vssqcmanswer", - "tableTo": "vssqcmquestion", - "columnsFrom": [ - "questionid" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.vss_form": { - "name": "vss_form", - "schema": "public", - "values": [ - "pending", - "toretry", - "validated", - "rejected" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "single_choice", - "multiple_choice" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/backend/src/database/migrations/meta/_journal.json b/backend/src/database/migrations/meta/_journal.json index aac9e54..62fbd6f 100644 --- a/backend/src/database/migrations/meta/_journal.json +++ b/backend/src/database/migrations/meta/_journal.json @@ -201,78 +201,8 @@ { "idx": 28, "version": "7", - "when": 1787772031530, - "tag": "0028_aberrant_mysterio", - "breakpoints": true - }, - { - "idx": 29, - "version": "7", - "when": 1787775694616, - "tag": "0029_famous_thing", - "breakpoints": true - }, - { - "idx": 30, - "version": "7", - "when": 1787783587154, - "tag": "0030_yielding_thunderbolts", - "breakpoints": true - }, - { - "idx": 31, - "version": "7", - "when": 1787787747447, - "tag": "0031_volatile_slapstick", - "breakpoints": true - }, - { - "idx": 32, - "version": "7", - "when": 1787787805288, - "tag": "0032_groovy_mother_askani", - "breakpoints": true - }, - { - "idx": 33, - "version": "7", - "when": 1787790647191, - "tag": "0033_lazy_salo", - "breakpoints": true - }, - { - "idx": 34, - "version": "7", - "when": 1787790664235, - "tag": "0034_fantastic_silver_centurion", - "breakpoints": true - }, - { - "idx": 35, - "version": "7", - "when": 1787790669968, - "tag": "0035_true_ultragirl", - "breakpoints": true - }, - { - "idx": 36, - "version": "7", - "when": 1787840601183, - "tag": "0036_tiresome_madame_hydra", - "breakpoints": true - }, - { - "idx": 37, - "version": "7", - "when": 1787842074687, - "tag": "0037_sleepy_avengers", - "breakpoints": true - }, - { - "idx": 38, - "version": "7", - "when": 1787843369629, - "tag": "0038_white_nightshade", + "when": 1788026112577, + "tag": "0028_tan_slapstick", "breakpoints": true } ] From e498d493a67afd37555c7e4b53b65c6e4e2b97f0 Mon Sep 17 00:00:00 2001 From: Arthur Dodin Date: Sun, 30 Aug 2026 10:00:13 +0200 Subject: [PATCH 11/19] fix: leftJoin instead of innerJoin --- backend/src/services/user.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/services/user.service.ts b/backend/src/services/user.service.ts index a9c7a84..d1c7c90 100644 --- a/backend/src/services/user.service.ts +++ b/backend/src/services/user.service.ts @@ -211,7 +211,7 @@ export const getUsersAdmin = async () => { maker_battle_team: MakerBattleAttributionSchema.maker_team_id, }) .from(userSchema) - .innerJoin(MakerBattleAttributionSchema, eq(userSchema.id, MakerBattleAttributionSchema.user_id)); + .leftJoin(MakerBattleAttributionSchema, eq(userSchema.id, MakerBattleAttributionSchema.user_id)); return users; } catch (err) { console.error('Erreur lors de la récupération des utilisateurs ', err); From eceb1685d1740eb71df911084603aa789be38dbb Mon Sep 17 00:00:00 2001 From: Arthur Dodin Date: Sun, 30 Aug 2026 10:33:17 +0200 Subject: [PATCH 12/19] fix: use Ok returns --- backend/src/controllers/maker_battle.controller.ts | 14 ++++++++------ .../src/services/requests/maker_battle.service.ts | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/backend/src/controllers/maker_battle.controller.ts b/backend/src/controllers/maker_battle.controller.ts index 396bdcf..cdf6afe 100644 --- a/backend/src/controllers/maker_battle.controller.ts +++ b/backend/src/controllers/maker_battle.controller.ts @@ -1,6 +1,6 @@ import * as maker_battle_service from '../services/maker_battle.service'; import type { AppRequestHandler } from '../types/http'; -import { Error } from '../shared/http/responses'; +import { Error, Ok } from '../shared/http/responses'; import type { Group, GroupsList } from '../dto/maker_battle.dto'; export const distributeGroups: AppRequestHandler = async (req, res) => { @@ -14,7 +14,9 @@ export const distributeGroups: AppRequestHandler = async (req, res) await maker_battle_service.distributeGroups(group); } await maker_battle_service.placeTeamsOnTables(groups); - return res.status(200).json({ success: true, message: 'Groups allocated successfully' }); + + Ok(res, { data: { success: true, message: 'Groups allocated successfully' } }); + return; } catch (err) { return Error(res, { msg: 'Erreur lors de la distribution des groupes : ' + err }); } @@ -32,7 +34,8 @@ export const exportGroups: AppRequestHandler = async (req, res) => { res.setHeader('Content-Type', 'application/json'); res.setHeader('Content-Disposition', `attachment; filename="maker_battle_${group}_${Date.now()}.json"`); - return res.status(200).json(exportData); + Ok(res, { data: exportData }); + return; } catch (err) { return Error(res, { msg: "Erreur lors de l'exportation des groupes : " + err }); } @@ -48,9 +51,8 @@ export const getCurrentUser: AppRequestHandler = async (req, res) => { const userGroup = await maker_battle_service.getUserTeam(userId); - return res.status(200).json({ - group: userGroup ?? null, - }); + Ok(res, { data: { group: userGroup ?? null } }); + return; } catch (err) { return Error(res, { msg: "Erreur lors de la récupération du groupe de l'utilisateur : " + err, diff --git a/frontend/src/services/requests/maker_battle.service.ts b/frontend/src/services/requests/maker_battle.service.ts index 23e802c..f58f8b4 100644 --- a/frontend/src/services/requests/maker_battle.service.ts +++ b/frontend/src/services/requests/maker_battle.service.ts @@ -3,15 +3,15 @@ import api from '../api'; export const allocateGroups = async (groups: MakerBattleGroupTypeOption[]) => { const response = await api.post('/maker-battle/admin/allocate', { groups: groups.map((group) => group.value) }); - return response.data; + return response.data.data; }; export const fetchExportData = async (group: MakerBattleGroupTypeOption) => { const response = await api.get(`/maker-battle/admin/export/${group.value}`); - return response.data; + return response.data.data; }; export const getUserGroup = async () => { const response = await api.get(`/maker-battle/group/me`); - return response.data; + return response.data.data; }; From 8387c1358c9e1dc6c1323453879f4e0722ceb053 Mon Sep 17 00:00:00 2001 From: Arthur Dodin Date: Sun, 30 Aug 2026 10:33:52 +0200 Subject: [PATCH 13/19] fix: makerbattleresponsedata format --- .../src/components/home/makerBattleSection.tsx | 16 ++++++++-------- .../src/interfaces/maker_battle.interface.ts | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/home/makerBattleSection.tsx b/frontend/src/components/home/makerBattleSection.tsx index d9e094b..e919fb6 100644 --- a/frontend/src/components/home/makerBattleSection.tsx +++ b/frontend/src/components/home/makerBattleSection.tsx @@ -2,25 +2,25 @@ import { useEffect, useState } from 'react'; import { useUser } from '../../contexts/user'; import type { MakerBattleGroupResponseData } from '../../interfaces/maker_battle.interface'; +import { getUserGroup } from '../../services/requests/maker_battle.service'; import { Card, CardContent, CardHeader, CardTitle } from '../ui/card'; export const MakerBattle = () => { - const [groupInfos, setGroupInfos] = useState({ groupId: 16 }); + const [groupInfos, setGroupInfos] = useState(null); const [loading, setLoading] = useState(true); + const [makerBattleType, setMakerBattleType] = useState(''); const { user, loading: userLoading } = useUser(); useEffect(() => { const fetchGroup = async () => { - // const group = await getUserGroup(); - const group = { - groupId: 16, - }; + const { group } = await getUserGroup(); setGroupInfos(group); setLoading(false); }; if (user?.permission === 'Nouveau') { void fetchGroup(); + setMakerBattleType(['TC', 'IA_BACH'].includes(user.branch) ? 'TC' : 'Branche'); } else { // if not a new user, we don't need to load team setLoading(false); @@ -54,18 +54,18 @@ export const MakerBattle = () => { } return ( -
+
- Trouve ta table au défi {user.branch} ! + Trouve ta table au défi {makerBattleType} !

Tu as été placé(e) à la table

- {groupInfos.groupId} + {groupInfos.table}

diff --git a/frontend/src/interfaces/maker_battle.interface.ts b/frontend/src/interfaces/maker_battle.interface.ts index 36272ba..3b4410e 100644 --- a/frontend/src/interfaces/maker_battle.interface.ts +++ b/frontend/src/interfaces/maker_battle.interface.ts @@ -8,5 +8,6 @@ export interface MakerBattleGroupDownloadResponseData { } export interface MakerBattleGroupResponseData { - groupId: number; + table: number; + team_id: number; } From bac0ec570761407165560aab30eb14dc18592354 Mon Sep 17 00:00:00 2001 From: Arthur Dodin Date: Sun, 30 Aug 2026 10:41:58 +0200 Subject: [PATCH 14/19] fix: adminSettings --- .../src/components/Admin/adminSettings.tsx | 95 ------------------- 1 file changed, 95 deletions(-) diff --git a/frontend/src/components/Admin/adminSettings.tsx b/frontend/src/components/Admin/adminSettings.tsx index 4b468c3..126ca88 100644 --- a/frontend/src/components/Admin/adminSettings.tsx +++ b/frontend/src/components/Admin/adminSettings.tsx @@ -2,27 +2,8 @@ import { CheckCircle, Loader2, XCircle } from 'lucide-react'; import { useEffect, useState } from 'react'; import Swal from 'sweetalert2'; -<<<<<<< HEAD:frontend/src/components/Admin/adminEvent.tsx -import { - checkChallengeStatus, - checkFoodStatus, - checkMakerBattleGroupStatus, - checkPreRegisterStatus, - checkSDIStatus, - checkShotgunStatus, - checkWEIStatus, - toggleChallenge, - toggleFood, - toggleMakerBattleGroupStatus, - togglePreRegistration, - toggleSDI, - toggleShotgun, - toggleWEI, -} from '../../services/requests/event.service'; -======= import type { Setting } from '../../interfaces/settings.interface'; import { getAdminSettings, updateSetting } from '../../services/requests/settings.service'; ->>>>>>> origin/dev:frontend/src/components/Admin/adminSettings.tsx import { Button } from '../ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../ui/card'; @@ -30,47 +11,13 @@ export const AdminSettings = () => { const [loading, setLoading] = useState(false); const [loadingStatuses, setLoadingStatuses] = useState(true); -<<<<<<< HEAD:frontend/src/components/Admin/adminEvent.tsx - const [statuses, setStatuses] = useState({ - preRegistration: false, - shotgun: false, - sdi: false, - wei: false, - food: false, - chall: false, - makerBattleGroup: false, - }); -======= const [settings, setSettings] = useState([]); ->>>>>>> origin/dev:frontend/src/components/Admin/adminSettings.tsx // Charger les statuts au montage useEffect(() => { const fetchStatuses = async () => { try { -<<<<<<< HEAD:frontend/src/components/Admin/adminEvent.tsx - const [preReg, shot, sdi, wei, food, chall, makerBattleGroup] = await Promise.all([ - checkPreRegisterStatus(), - checkShotgunStatus(), - checkSDIStatus(), - checkWEIStatus(), - checkFoodStatus(), - checkChallengeStatus(), - checkMakerBattleGroupStatus(), - ]); - - setStatuses({ - preRegistration: preReg, - shotgun: shot.status, - sdi, - wei, - food, - chall, - makerBattleGroup, - }); -======= setSettings(await getAdminSettings()); ->>>>>>> origin/dev:frontend/src/components/Admin/adminSettings.tsx } catch { Swal.fire({ icon: 'error', @@ -111,48 +58,6 @@ export const AdminSettings = () => { } }; -<<<<<<< HEAD:frontend/src/components/Admin/adminEvent.tsx - // Configuration des événements - const events = [ - { - key: 'preRegistration' as const, - label: 'Pré-inscription', - toggleFn: togglePreRegistration, - }, - { - key: 'shotgun' as const, - label: 'Shotgun', - toggleFn: toggleShotgun, - }, - { - key: 'sdi' as const, - label: 'SDI (Billetterie)', - toggleFn: toggleSDI, - }, - { - key: 'wei' as const, - label: 'WEI (Billetterie + Tentes)', - toggleFn: toggleWEI, - }, - { - key: 'food' as const, - label: 'Nourriture (Billetterie)', - toggleFn: toggleFood, - }, - { - key: 'chall' as const, - label: 'Challenges (Affichage des challenges)', - toggleFn: toggleChallenge, - }, - { - key: 'makerBattleGroup' as const, - label: 'Groupe Défis TC/Branche', - toggleFn: toggleMakerBattleGroupStatus, - }, - ]; - -======= ->>>>>>> origin/dev:frontend/src/components/Admin/adminSettings.tsx if (loadingStatuses) { return (

From f2970ed9a7b4729e4dac759643fa74f966553139 Mon Sep 17 00:00:00 2001 From: Arthur Dodin Date: Sun, 30 Aug 2026 10:47:58 +0200 Subject: [PATCH 15/19] feat: makerBattleGroup Card settings condition --- frontend/src/components/home/makerBattleSection.tsx | 8 ++++++++ frontend/src/services/requests/settings.service.ts | 2 ++ 2 files changed, 10 insertions(+) diff --git a/frontend/src/components/home/makerBattleSection.tsx b/frontend/src/components/home/makerBattleSection.tsx index e919fb6..a721f51 100644 --- a/frontend/src/components/home/makerBattleSection.tsx +++ b/frontend/src/components/home/makerBattleSection.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from 'react'; import { useUser } from '../../contexts/user'; import type { MakerBattleGroupResponseData } from '../../interfaces/maker_battle.interface'; import { getUserGroup } from '../../services/requests/maker_battle.service'; +import { checkMakerBattleGroupStatus } from '../../services/requests/settings.service'; import { Card, CardContent, CardHeader, CardTitle } from '../ui/card'; export const MakerBattle = () => { @@ -13,6 +14,13 @@ export const MakerBattle = () => { useEffect(() => { const fetchGroup = async () => { + const isEnabled = await checkMakerBattleGroupStatus(); + + if (!isEnabled) { + setLoading(false); + return; + } + const { group } = await getUserGroup(); setGroupInfos(group); setLoading(false); diff --git a/frontend/src/services/requests/settings.service.ts b/frontend/src/services/requests/settings.service.ts index dea7186..32a8bf9 100644 --- a/frontend/src/services/requests/settings.service.ts +++ b/frontend/src/services/requests/settings.service.ts @@ -44,6 +44,8 @@ export const checkFoodStatus = async () => (await getSetting('food')).open; export const checkChallengeStatus = async () => (await getSetting('challenge')).open; +export const checkMakerBattleGroupStatus = async () => (await getSetting('makerBattleGroup')).open; + export const attemptShotgun = async (payload: ShotgunAttemptPayload): Promise => { const response = await api.post('settings/user/shotgunattempt', payload); return response.data; From dd6b38dcfda91e0cc2ffa693a0572cb2a3e04f57 Mon Sep 17 00:00:00 2001 From: Arthur Dodin Date: Sun, 30 Aug 2026 11:46:10 +0200 Subject: [PATCH 16/19] feat: remove MM newcomers from Branch MakerBattle --- backend/src/services/maker_battle.service.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/src/services/maker_battle.service.ts b/backend/src/services/maker_battle.service.ts index 36de93b..4d83bff 100644 --- a/backend/src/services/maker_battle.service.ts +++ b/backend/src/services/maker_battle.service.ts @@ -74,7 +74,14 @@ export const distributeGroups = async (group: string): Promise => { .where( and( eq(userSchema.permission, 'Nouveau'), - not(or(eq(userSchema.branch, 'RI'), eq(userSchema.branch, 'TC'), eq(userSchema.branch, 'IA_BACH'))), + not( + or( + eq(userSchema.branch, 'RI'), + eq(userSchema.branch, 'TC'), + eq(userSchema.branch, 'IA_BACH'), + eq(userSchema.branch, 'MM'), + ), + ), ), ); usersWithTeamsFactions = usersWithTeamsFactions.map((user) => ({ ...user, group: 'branch' })); From 6b034e8cfddd648cab8c14351bb72ddb4d38245c Mon Sep 17 00:00:00 2001 From: Arthur Dodin Date: Sun, 30 Aug 2026 12:06:07 +0200 Subject: [PATCH 17/19] feat: releases system --- .github/workflows/ci.yaml | 29 ++++++++------ frontend/Dockerfile | 4 ++ frontend/src/components/footer.tsx | 63 +++++++++++++++++++++++++++--- 3 files changed, 79 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6ce061b..698b929 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,12 +3,13 @@ name: CI on: push: branches: - - prod - dev + tags: + - 'v*' pull_request: branches: - - prod - dev + - prod env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" @@ -68,7 +69,7 @@ jobs: build-api: runs-on: self-hosted - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' || github.event_name == 'push' needs: - lint-api steps: @@ -97,7 +98,7 @@ jobs: build-front: runs-on: self-hosted - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' || github.event_name == 'push' needs: - lint-front steps: @@ -126,10 +127,11 @@ jobs: deploy-api: runs-on: self-hosted - if : github.event_name == 'push' - environment: ${{ github.ref == 'refs/heads/dev' && 'development' || 'production' }} + if: github.event_name == 'push' && (github.ref == 'refs/heads/dev' || startswith(github.ref, 'refs/tags/v')) + environment: ${{ startswith(github.ref, 'refs/tags/') && 'production' || 'development' }} needs: - lint-api + - build-api steps: - name: Checkout repository uses: actions/checkout@v5 @@ -150,14 +152,16 @@ jobs: context: ./backend push: true tags: | - ${{ secrets.REGISTRY_URL }}/integration/api:${{ github.ref == 'refs/heads/prod' && 'prod' || 'dev' }} + ${{ secrets.REGISTRY_URL }}/integration/api:${{ startswith(github.ref, 'refs/tags/') && github.ref_name || 'dev' }} + ${{ startswith(github.ref, 'refs/tags/') && format('{0}/integration/api:prod', secrets.REGISTRY_URL) || '' }} deploy-front: runs-on: self-hosted - if : github.event_name == 'push' - environment: ${{ github.ref == 'refs/heads/dev' && 'development' || 'production' }} + if: github.event_name == 'push' && (github.ref == 'refs/heads/dev' || startswith(github.ref, 'refs/tags/v')) + environment: ${{ startswith(github.ref, 'refs/tags/') && 'production' || 'development' }} needs: - lint-front + - build-front steps: - name: Checkout repository uses: actions/checkout@v5 @@ -172,7 +176,7 @@ jobs: - name: Install docker uses: docker/setup-buildx-action@v3 - - name: Front- Build and push + - name: Front - Build and push uses: docker/build-push-action@v6 with: context: ./frontend @@ -199,5 +203,8 @@ jobs: VITE_BDE_SIREN=${{ vars.BDE_SIREN }} VITE_DPO_EMAIL=${{ vars.DPO_EMAIL }} VITE_DPO_NAME=${{ vars.DPO_NAME }} + VITE_APP_VERSION=${{ startswith(github.ref, 'refs/tags/') && github.ref_name || 'dev' }} + VITE_RELEASE_URL=${{ startswith(github.ref, 'refs/tags/') && format('https://github.com/{0}/releases/tag/{1}', github.repository, github.ref_name) || '' }} tags: | - ${{ secrets.REGISTRY_URL }}/integration/front:${{ github.ref == 'refs/heads/prod' && 'prod' || 'dev' }} + ${{ secrets.REGISTRY_URL }}/integration/front:${{ startswith(github.ref, 'refs/tags/') && github.ref_name || 'dev' }} + ${{ startswith(github.ref, 'refs/tags/') && format('{0}/integration/front:prod', secrets.REGISTRY_URL) || '' }} diff --git a/frontend/Dockerfile b/frontend/Dockerfile index f5b8a1e..ab6a1e8 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -22,6 +22,8 @@ ARG VITE_BDE_SIRET="" ARG VITE_BDE_SIREN="" ARG VITE_DPO_EMAIL="" ARG VITE_DPO_NAME="" +ARG VITE_APP_VERSION="" +ARG VITE_RELEASE_URL="" ENV VITE_CAS_LOGIN_URL=${VITE_CAS_LOGIN_URL} ENV VITE_SERVICE_URL=${VITE_SERVICE_URL} @@ -44,6 +46,8 @@ ENV VITE_BDE_SIRET=${VITE_BDE_SIRET} ENV VITE_BDE_SIREN=${VITE_BDE_SIREN} ENV VITE_DPO_EMAIL=${VITE_DPO_EMAIL} ENV VITE_DPO_NAME=${VITE_DPO_NAME} +ENV VITE_APP_VERSION=${VITE_APP_VERSION} +ENV VITE_RELEASE_URL=${VITE_RELEASE_URL} # COPY package.json package-lock.json ./ # RUN npm install -g npm@latest diff --git a/frontend/src/components/footer.tsx b/frontend/src/components/footer.tsx index 0ff7ceb..085e45d 100644 --- a/frontend/src/components/footer.tsx +++ b/frontend/src/components/footer.tsx @@ -1,19 +1,70 @@ export const Footer = () => { const currentYear = new Date().getFullYear(); + const APP_VERSION = import.meta.env.VITE_APP_VERSION; + const RELEASE_URL = import.meta.env.VITE_RELEASE_URL; + const SERVICE_URL = import.meta.env.VITE_SERVICE_URL; + const envType = + !RELEASE_URL || !APP_VERSION + ? SERVICE_URL.includes('localhost') || SERVICE_URL.includes('127.0.0.1') + ? 'local' + : 'dev' + : 'production'; return ( ); -} +}; From 21bac6e9b7c4a75f4940ee6bd721a2c377efb294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Poncin?= Date: Sun, 30 Aug 2026 13:45:28 +0200 Subject: [PATCH 18/19] fix: add first and last name to maker battle team export --- backend/src/services/maker_battle.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/services/maker_battle.service.ts b/backend/src/services/maker_battle.service.ts index 4d83bff..83cd5d9 100644 --- a/backend/src/services/maker_battle.service.ts +++ b/backend/src/services/maker_battle.service.ts @@ -349,6 +349,8 @@ export const getUserTeam = async (userId: number): Promise<{ team_id: number; ta export const exportGroups = async (group: string): Promise => { const teams = await db .selectDistinct({ + first_name: userSchema.first_name, + last_name: userSchema.last_name, user_id: MakerBattleAttributionSchema.user_id, group: MakerBattleAttributionSchema.group, faction_id: MakerBattleAttributionSchema.faction_id, @@ -356,6 +358,7 @@ export const exportGroups = async (group: string): Promise table: MakerBattleAttributionSchema.table, }) .from(MakerBattleAttributionSchema) + .innerJoin(userSchema, eq(MakerBattleAttributionSchema.user_id, userSchema.id)) .where(eq(MakerBattleAttributionSchema.group, group)); return teams; From b89c2902aa1602fd4f048cd743fa280072f0bd19 Mon Sep 17 00:00:00 2001 From: Arthur Dodin Date: Sun, 30 Aug 2026 16:56:08 +0200 Subject: [PATCH 19/19] fix: maker battle orga access --- backend/src/routes/maker_battle.routes.ts | 4 ++-- frontend/src/App.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/routes/maker_battle.routes.ts b/backend/src/routes/maker_battle.routes.ts index ea0dd0f..d4f3f8f 100644 --- a/backend/src/routes/maker_battle.routes.ts +++ b/backend/src/routes/maker_battle.routes.ts @@ -3,8 +3,8 @@ import * as makerBattleController from '../controllers/maker_battle.controller'; import { checkRole } from '../middlewares/user.middleware'; const makerBattleRouter = Router(); -makerBattleRouter.post('/admin/allocate', checkRole('Admin'), makerBattleController.distributeGroups); -makerBattleRouter.get('/admin/export/:group', checkRole('Admin'), makerBattleController.exportGroups); +makerBattleRouter.post('/admin/allocate', checkRole('Admin', ['Défis TC']), makerBattleController.distributeGroups); +makerBattleRouter.get('/admin/export/:group', checkRole('Admin', ['Défis TC']), makerBattleController.exportGroups); makerBattleRouter.get('/group/me', makerBattleController.getCurrentUser); export default makerBattleRouter; diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 6ed228c..8559d9f 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -331,9 +331,9 @@ const App: React.FC = () => { + - + } />