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
+
+
+
+
+
+ Groupes à télécharger
+
+
+
+ inputId="maker-battle-group-types"
+ options={groupTypeOptions}
+ value={selectedGroupType}
+ onChange={setSelectedGroupType}
+ placeholder="Sélectionner un type"
+ isClearable
+ />
+
+
+
+ Télécharger
+
+
+
+
+ );
+};
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
+
+
+
+
+
+ Types de nouveaux à répartir:
+
+
selectedGroupTypes.includes(option))}
+ onChange={(options: MultiValue) =>
+ setSelectedGroupTypes(Array.from(options))
+ }
+ placeholder="Sélectionner un ou plusieurs types"
+ closeMenuOnSelect={false}
+ isClearable
+ />
+
+ ATTENTION : Si vous ne souhaitez pas que les
+ numéros de table entrent en collision entre deux groupes, veillez à les générer ensemble.
+
+
+
+ Exemple : si vous souhaitez que les
+ nouveaux Branche et RI effectuent la bataille en même temps, il faut sélectionner
+ les deux groupes afin de les générer en même temps. Dans le cas contraire, une table{' '}
+ Branche pourrait avoir le même numéro qu'une table RI .
+
+
+
+
+ Répartir les nouveaux par table
+
+
+
+
+ );
+};
diff --git a/frontend/src/components/Admin/adminEvent.tsx b/frontend/src/components/Admin/adminEvent.tsx
index 2e85f79..7c20eab 100644
--- a/frontend/src/components/Admin/adminEvent.tsx
+++ b/frontend/src/components/Admin/adminEvent.tsx
@@ -5,12 +5,14 @@ import Swal from 'sweetalert2';
import {
checkChallengeStatus,
checkFoodStatus,
+ checkMakerBattleGroupStatus,
checkPreRegisterStatus,
checkSDIStatus,
checkShotgunStatus,
checkWEIStatus,
toggleChallenge,
toggleFood,
+ toggleMakerBattleGroupStatus,
togglePreRegistration,
toggleSDI,
toggleShotgun,
@@ -30,19 +32,21 @@ export const AdminEvents = () => {
wei: false,
food: false,
chall: false,
+ makerBattleGroup: false,
});
// Charger les statuts au montage
useEffect(() => {
const fetchStatuses = async () => {
try {
- const [preReg, shot, sdi, wei, food, chall] = await Promise.all([
+ const [preReg, shot, sdi, wei, food, chall, makerBattleGroup] = await Promise.all([
checkPreRegisterStatus(),
checkShotgunStatus(),
checkSDIStatus(),
checkWEIStatus(),
checkFoodStatus(),
checkChallengeStatus(),
+ checkMakerBattleGroupStatus(),
]);
setStatuses({
@@ -52,6 +56,7 @@ export const AdminEvents = () => {
wei,
food,
chall,
+ makerBattleGroup,
});
} catch {
Swal.fire({
@@ -126,6 +131,11 @@ export const AdminEvents = () => {
label: 'Challenges (Affichage des challenges)',
toggleFn: toggleChallenge,
},
+ {
+ key: 'makerBattleGroup' as const,
+ label: 'Groupe Défis TC/Branche',
+ toggleFn: toggleMakerBattleGroupStatus,
+ },
];
if (loadingStatuses) {
diff --git a/frontend/src/components/home/infosSection.tsx b/frontend/src/components/home/infosSection.tsx
index 7cce01d..4429a6d 100644
--- a/frontend/src/components/home/infosSection.tsx
+++ b/frontend/src/components/home/infosSection.tsx
@@ -6,6 +6,7 @@ import { Swiper, SwiperSlide } from 'swiper/react';
import { Button } from '../ui/button';
import { RevealSection } from '../ui/revealSection';
+import { MakerBattle } from './makerBattleSection';
import { Team } from './teamSection';
export const Infos = () => (
@@ -49,6 +50,11 @@ export const Infos = () => (
+ {/* Team */}
+
+
+
+
{/* Team */}
diff --git a/frontend/src/components/home/makerBattleSection.tsx b/frontend/src/components/home/makerBattleSection.tsx
new file mode 100644
index 0000000..d9e094b
--- /dev/null
+++ b/frontend/src/components/home/makerBattleSection.tsx
@@ -0,0 +1,79 @@
+import { useEffect, useState } from 'react';
+
+import { useUser } from '../../contexts/user';
+import type { MakerBattleGroupResponseData } from '../../interfaces/maker_battle.interface';
+import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
+
+export const MakerBattle = () => {
+ const [groupInfos, setGroupInfos] = useState({ groupId: 16 });
+ const [loading, setLoading] = useState(true);
+ const { user, loading: userLoading } = useUser();
+
+ useEffect(() => {
+ const fetchGroup = async () => {
+ // const group = await getUserGroup();
+ const group = {
+ groupId: 16,
+ };
+ setGroupInfos(group);
+ setLoading(false);
+ };
+
+ if (user?.permission === 'Nouveau') {
+ void fetchGroup();
+ } else {
+ // if not a new user, we don't need to load team
+ setLoading(false);
+ }
+ }, [user]);
+
+ const loadingDiv = (
+
+
+
+ Chargement de ton groupe de défis...
+
+
+
+ );
+
+ if (userLoading) {
+ return loadingDiv;
+ }
+
+ if (user?.permission !== 'Nouveau') {
+ return;
+ }
+
+ if (loading) {
+ return loadingDiv;
+ }
+
+ if (!groupInfos) {
+ return;
+ }
+
+ return (
+
+
+
+
+ Trouve ta table au défi {user.branch} !
+
+
+
+ Tu as été placé(e) à la table
+
+
+ {groupInfos.groupId}
+
+
+
+ Rejoins ta table dès que possible pour rencontrer tes cohéquipiers et cohéquipières pour relever
+ le défi !
+
+
+
+
+ );
+};
diff --git a/frontend/src/components/home/teamSection.tsx b/frontend/src/components/home/teamSection.tsx
index d825d35..7e0a51a 100644
--- a/frontend/src/components/home/teamSection.tsx
+++ b/frontend/src/components/home/teamSection.tsx
@@ -27,16 +27,18 @@ export const Team = () => {
}
}, [user]);
+ const loadingDiv = (
+
+
+
+ Chargement de ton équipe...
+
+
+
+ );
+
if (userLoading) {
- return (
-
-
-
- Chargement de ton équipe...
-
-
-
- );
+ return loadingDiv;
}
if (user?.permission !== 'Nouveau') {
@@ -44,15 +46,7 @@ export const Team = () => {
}
if (loading) {
- return (
-
-
-
- Chargement de ton équipe...
-
-
-
- );
+ return loadingDiv;
}
if (!teamInfos) {
diff --git a/frontend/src/components/navbar.tsx b/frontend/src/components/navbar.tsx
index 79bd146..827a403 100644
--- a/frontend/src/components/navbar.tsx
+++ b/frontend/src/components/navbar.tsx
@@ -91,6 +91,7 @@ export const Navbar = () => {
{ label: 'Bannis', to: '/admin/banned', rolesAllowed: ['Admin'] },
{ label: 'Bus', to: '/admin/bus', rolesAllowed: ['Admin'] },
{ label: 'Challenge', to: '/admin/challenge', rolesAllowed: ['Admin', 'Arbitre'] },
+ { label: 'Défis TC', to: '/admin/maker-battle', rolesAllowed: ['Admin', 'Défis TC'] },
{ label: 'Email', to: '/admin/email', rolesAllowed: ['Admin'] },
{ label: 'Events', to: '/admin/events', rolesAllowed: ['Admin'] },
{ label: 'Export / Import', to: '/admin/export-import', rolesAllowed: ['Admin'] },
diff --git a/frontend/src/interfaces/maker_battle.interface.ts b/frontend/src/interfaces/maker_battle.interface.ts
new file mode 100644
index 0000000..36272ba
--- /dev/null
+++ b/frontend/src/interfaces/maker_battle.interface.ts
@@ -0,0 +1,12 @@
+export interface MakerBattleGroupTypeOption {
+ value: string;
+ label: string;
+}
+
+export interface MakerBattleGroupDownloadResponseData {
+ filename: string;
+}
+
+export interface MakerBattleGroupResponseData {
+ groupId: number;
+}
diff --git a/frontend/src/pages/admin/adminMakerBattle.tsx b/frontend/src/pages/admin/adminMakerBattle.tsx
new file mode 100644
index 0000000..4fd47ca
--- /dev/null
+++ b/frontend/src/pages/admin/adminMakerBattle.tsx
@@ -0,0 +1,26 @@
+import { AdminLayout } from '../../components/Admin/adminLayout';
+import { AdminMakerBattleTeamDownload } from '../../components/Admin/AdminMakerBattle/adminMakerBattleDownload';
+import { AdminMakerBattleTeamGeneration } from '../../components/Admin/AdminMakerBattle/adminMakerBattleTeamGeneration';
+import { RevealSection } from '../../components/ui/revealSection';
+import type { MakerBattleGroupTypeOption } from '../../interfaces/maker_battle.interface';
+
+const groupTypeOptions: MakerBattleGroupTypeOption[] = [
+ { value: 'tc', label: 'TC' },
+ { value: 'ri', label: 'RI' },
+ { value: 'branch', label: 'Branche' },
+];
+
+const AdminPageMakerBattle: React.FC = () => (
+
+
+
+);
+
+export default AdminPageMakerBattle;
diff --git a/frontend/src/services/requests/event.service.ts b/frontend/src/services/requests/event.service.ts
index bc46a59..383ebad 100644
--- a/frontend/src/services/requests/event.service.ts
+++ b/frontend/src/services/requests/event.service.ts
@@ -1,43 +1,53 @@
-import { type ApiMessageResponse, type ShotgunAttemptPayload, type ShotgunAttemptRow, type ShotgunStatusData } from '../../interfaces/event.interface';
+import {
+ type ApiMessageResponse,
+ type ShotgunAttemptPayload,
+ type ShotgunAttemptRow,
+ type ShotgunStatusData,
+} from '../../interfaces/event.interface';
import api from '../api';
export const checkShotgunStatus = async (): Promise => {
- const response = await api.get<{ data: ShotgunStatusData }>("/event/user/shotgunstatus");
+ const response = await api.get<{ data: ShotgunStatusData }>('/event/user/shotgunstatus');
return response.data.data;
};
export const checkPreRegisterStatus = async () => {
- const response = await api.get("/event/user/preregisterstatus");
+ const response = await api.get('/event/user/preregisterstatus');
return response.data.data;
};
export const checkSDIStatus = async () => {
- const response = await api.get("/event/user/sdistatus");
+ const response = await api.get('/event/user/sdistatus');
return response.data.data;
};
export const checkWEIStatus = async () => {
- const response = await api.get("/event/user/weistatus");
+ const response = await api.get('/event/user/weistatus');
return response.data.data;
};
export const checkFoodStatus = async () => {
- const response = await api.get("/event/user/foodstatus");
+ const response = await api.get('/event/user/foodstatus');
return response.data.data;
};
export const checkChallengeStatus = async () => {
- const response = await api.get("/event/user/challstatus");
+ const response = await api.get('/event/user/challstatus');
+ return response.data.data;
+};
+
+export const checkMakerBattleGroupStatus = async () => {
+ const response = await api.get('/event/user/maker-battle-group');
return response.data.data;
};
export const attemptShotgun = async (payload: ShotgunAttemptPayload): Promise => {
- const response = await api.post("event/user/shotgunattempt", payload);
+ const response = await api.post('event/user/shotgunattempt', payload);
return response.data;
};
export const getShotgunAttemptsAdmin = async (): Promise => {
- const response = await api.get<{ data: ShotgunAttemptRow[] }>("/event/admin/shotgunattempts");
+ const response = await api.get<{ data: ShotgunAttemptRow[] }>('/event/admin/shotgunattempts');
return response.data.data;
};
@@ -70,3 +80,8 @@ export const toggleChallenge = async (challOpen: boolean) => {
const response = await api.post(`event/admin/challtoggle`, { challOpen });
return response.data;
};
+
+export const toggleMakerBattleGroupStatus = async (makerBattleGroupOpen: boolean) => {
+ const response = await api.post(`event/admin/makerbattlegrouptoggle`, { makerBattleGroupOpen });
+ return response.data;
+};
diff --git a/frontend/src/services/requests/maker_battle.service.ts b/frontend/src/services/requests/maker_battle.service.ts
new file mode 100644
index 0000000..01f1f9c
--- /dev/null
+++ b/frontend/src/services/requests/maker_battle.service.ts
@@ -0,0 +1,21 @@
+import type {
+ MakerBattleGroupDownloadResponseData,
+ MakerBattleGroupResponseData,
+ MakerBattleGroupTypeOption,
+} from '../../interfaces/maker_battle.interface';
+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;
+};
+
+export const exportGroups = async (group: MakerBattleGroupTypeOption) => {
+ const response = await api.get(`/maker-battle/admin/export/${group.value}`);
+ return response.data as MakerBattleGroupDownloadResponseData;
+};
+
+export const getUserGroup = async () => {
+ const response = await api.get(`/maker-battle/group/me`);
+ return response.data as MakerBattleGroupResponseData;
+};
From ef3593353c5e84ef76a18813a77ced96d8faa5d5 Mon Sep 17 00:00:00 2001
From: Arthur Dodin
Date: Thu, 27 Aug 2026 00:32:11 +0200
Subject: [PATCH 02/19] feat: new Settings logic
---
backend/server.ts | 4 +-
backend/src/controllers/event.controller.ts | 199 ------------------
.../src/controllers/im_export.controller.ts | 4 +-
.../src/controllers/settings.controller.ts | 139 ++++++++++++
backend/src/controllers/team.controller.ts | 4 +-
backend/src/dto/event.dto.ts | 7 +-
backend/src/routes/event.routes.ts | 25 ---
backend/src/routes/settings.routes.ts | 17 ++
backend/src/schemas/Basic/event.schema.ts | 19 +-
backend/src/services/event.service.ts | 83 --------
backend/src/services/settings.service.ts | 116 ++++++++++
frontend/src/App.tsx | 6 +-
.../{adminEvent.tsx => adminSettings.tsx} | 106 ++--------
.../src/components/Admin/adminShotgun.tsx | 4 +-
.../components/WEI_SDI_Food/foodSection.tsx | 2 +-
.../components/WEI_SDI_Food/sdiSection.tsx | 2 +-
.../components/WEI_SDI_Food/weiSection.tsx | 2 +-
.../components/challenge/challengeList.tsx | 2 +-
frontend/src/components/navbar.tsx | 2 +-
.../shotgun/preregisterCESection.tsx | 11 +-
.../shotgun/preregisterTeamSection.tsx | 41 ++--
.../src/components/shotgun/shotgunSection.tsx | 52 ++---
frontend/src/components/tent/tentSection.tsx | 2 +-
...ent.interface.ts => settings.interface.ts} | 6 +
.../{adminEvents.tsx => adminSettings.tsx} | 8 +-
.../src/services/requests/event.service.ts | 72 -------
.../src/services/requests/settings.service.ts | 55 +++++
27 files changed, 436 insertions(+), 554 deletions(-)
delete mode 100644 backend/src/controllers/event.controller.ts
create mode 100644 backend/src/controllers/settings.controller.ts
delete mode 100644 backend/src/routes/event.routes.ts
create mode 100644 backend/src/routes/settings.routes.ts
delete mode 100644 backend/src/services/event.service.ts
create mode 100644 backend/src/services/settings.service.ts
rename frontend/src/components/Admin/{adminEvent.tsx => adminSettings.tsx} (57%)
rename frontend/src/interfaces/{event.interface.ts => settings.interface.ts} (84%)
rename frontend/src/pages/admin/{adminEvents.tsx => adminSettings.tsx} (63%)
delete mode 100644 frontend/src/services/requests/event.service.ts
create mode 100644 frontend/src/services/requests/settings.service.ts
diff --git a/backend/server.ts b/backend/server.ts
index 5f5b6dc..abc47b1 100644
--- a/backend/server.ts
+++ b/backend/server.ts
@@ -18,7 +18,7 @@ import challengeRoutes from './src/routes/challenge.routes';
import defaultRoute from './src/routes/default.routes';
import discordRoutes from './src/routes/discord.routes';
import emailRoutes from './src/routes/email.routes';
-import eventRoutes from './src/routes/event.routes';
+import settingsRoutes from './src/routes/settings.routes';
import factionRoutes from './src/routes/faction.routes';
import imexportRouter from './src/routes/im_export.routes';
import newsRoutes from './src/routes/news.routes';
@@ -59,7 +59,7 @@ async function startServer() {
app.use('/api/role', authenticateUser, roleRoutes);
app.use('/api/user', authenticateUser, userRoutes);
app.use('/api/team', authenticateUser, teamRoutes);
- app.use('/api/event', authenticateUser, eventRoutes);
+ app.use('/api/settings', authenticateUser, settingsRoutes);
app.use('/api/faction', authenticateUser, factionRoutes);
app.use('/api/imexport', authenticateUser, imexportRouter);
app.use('/api/permanence', authenticateUser, permanenceRoutes);
diff --git a/backend/src/controllers/event.controller.ts b/backend/src/controllers/event.controller.ts
deleted file mode 100644
index b32b11c..0000000
--- a/backend/src/controllers/event.controller.ts
+++ /dev/null
@@ -1,199 +0,0 @@
-import * as event_service from '../services/event.service';
-import * as team_service from '../services/team.service';
-import { Conflict, Error, Ok, Teapot, Unauthorized } from '../shared/http/responses';
-import { shotgun_password } from '../shared/secrets/secrets';
-import type { AppRequestHandler } from '../types/http';
-import type { ShotgunBody, ToggleStatusBody } from '../dto/event.dto';
-
-export const checkShotgunStatus: AppRequestHandler = async (_req, res) => {
- try {
- const status = await event_service.getEventsStatus();
- Ok(res, {
- data: { status: Boolean(status?.shotgun_open), password: status?.shotgun_open ? shotgun_password : '' },
- });
- } catch (error) {
- Error(res, { msg: 'Error while catching shotgun status :' + error });
- }
-};
-
-export const checkPreRegisterStatus: AppRequestHandler = async (_req, res) => {
- try {
- const status = await event_service.getEventsStatus();
- Ok(res, { data: status?.pre_registration_open });
- } catch (error) {
- Error(res, { msg: 'Error while catching pre-registration status :' + error });
- }
-};
-
-export const checkSDIStatus: AppRequestHandler = async (_req, res) => {
- try {
- const status = await event_service.getEventsStatus();
- Ok(res, { data: status?.sdi_open });
- } catch (error) {
- Error(res, { msg: 'Error while catching SDI status :' + error });
- }
-};
-
-export const checkWEIStatus: AppRequestHandler = async (_req, res) => {
- try {
- const status = await event_service.getEventsStatus();
- Ok(res, { data: status?.wei_open });
- } catch (error) {
- Error(res, { msg: 'Error while catching WEI status :' + error });
- }
-};
-
-export const checkFoodStatus: AppRequestHandler = async (_req, res) => {
- try {
- const status = await event_service.getEventsStatus();
- Ok(res, { data: status?.food_open });
- } catch (error) {
- Error(res, { msg: 'Error while catching Food status :' + error });
- }
-};
-
-export const checkChallStatus: AppRequestHandler = async (_req, res) => {
- try {
- const status = await event_service.getEventsStatus();
- Ok(res, { data: status?.chall_open });
- } catch (error) {
- Error(res, { msg: 'Error while catching Challenge status :' + error });
- }
-};
-
-export const getShotgunAttempts: AppRequestHandler = async (_req, res) => {
- try {
- const shotgunAttempts = await event_service.getAllTeamShotguns();
- const shotgunAttemptsWithLeaders = await Promise.all(
- shotgunAttempts.map(async (attempt) => {
- if (!attempt.teamId) {
- return { ...attempt, leaderCount: 0 };
- }
-
- const teamUsers = await team_service.getTeamUsers(attempt.teamId);
- const leaderCount = teamUsers.filter((user) => user.permission !== 'Nouveau').length;
-
- return { ...attempt, leaderCount };
- }),
- );
-
- Ok(res, { data: shotgunAttemptsWithLeaders });
- } catch (error) {
- Error(res, { msg: 'Erreur lors de la récupération des tentatives shotgun : ' + error });
- }
-};
-
-export const shotgunAttempt: AppRequestHandler = async (req, res) => {
- const { password } = req.body;
-
- const userId = req.user?.userId;
-
- if (!userId) {
- Unauthorized(res, { msg: 'Utilisateur non authentifié.' });
- return;
- }
-
- if (!shotgun_password) {
- Error(res, { msg: 'Mot de passe shotgun non configuré côté serveur.' });
- return;
- }
-
- if (password !== shotgun_password) {
- Teapot(res, { msg: 'Le mot de passe shotgun est incorrect.' });
- return;
- }
-
- const status = await event_service.getEventsStatus();
- if (!status?.shotgun_open) {
- Unauthorized(res, { msg: 'Le shotgun est fermé.' });
- return;
- }
- try {
- const userTeam = await team_service.getUserTeam(userId);
-
- if (!userTeam) {
- Error(res, { msg: "Erreur : Tu n'as pas d'équipe !" });
- return;
- }
-
- const alreadyShotgun = await event_service.alreadyShotgun(userTeam);
-
- if (alreadyShotgun) {
- Conflict(res, { msg: 'Votre équipe est déjà dans le shotgun.' });
- return;
- }
-
- await event_service.validateShotgun(userTeam);
- Ok(res, { msg: 'Shotgun validé !' });
- return;
- } catch (error) {
- Error(res, { msg: 'Erreur pendant le shotguns : ' + error });
- return;
- }
-};
-
-export const togglePreRegistration: AppRequestHandler = async (req, res) => {
- const { preRegistrationOpen } = req.body;
-
- try {
- const result = await event_service.updatepreRegistrationStatus(preRegistrationOpen);
- Ok(res, { msg: 'Paramètres mis à jour.', data: result });
- } catch {
- Error(res, { msg: 'Erreur lors de la mise à jour.' });
- }
-};
-
-export const toggleShotgun: AppRequestHandler = async (req, res) => {
- const { shotgunOpen } = req.body;
-
- try {
- const result = await event_service.updateShotgunStatus(shotgunOpen);
- Ok(res, { msg: 'Paramètres mis à jour.', data: result });
- } catch {
- Error(res, { msg: 'Erreur lors de la mise à jour.' });
- }
-};
-
-export const toggleSDI: AppRequestHandler = async (req, res) => {
- const { sdiOpen } = req.body;
-
- try {
- const result = await event_service.updateSDIStatus(sdiOpen);
- Ok(res, { msg: 'Paramètres mis à jour.', data: result });
- } catch {
- Error(res, { msg: 'Erreur lors de la mise à jour.' });
- }
-};
-
-export const toggleWEI: AppRequestHandler = async (req, res) => {
- const { weiOpen } = req.body;
-
- try {
- const result = await event_service.updateWEIStatus(weiOpen);
- Ok(res, { msg: 'Paramètres mis à jour.', data: result });
- } catch {
- Error(res, { msg: 'Erreur lors de la mise à jour.' });
- }
-};
-
-export const toggleFood: AppRequestHandler = async (req, res) => {
- const { foodOpen } = req.body;
-
- try {
- const result = await event_service.updateFoodStatus(foodOpen);
- Ok(res, { msg: 'Paramètres mis à jour.', data: result });
- } catch {
- Error(res, { msg: 'Erreur lors de la mise à jour.' });
- }
-};
-
-export const toggleChall: AppRequestHandler = async (req, res) => {
- const { challOpen } = req.body;
-
- try {
- const result = await event_service.updateChallStatus(challOpen);
- Ok(res, { msg: 'Paramètres mis à jour.', data: result });
- } catch {
- Error(res, { msg: 'Erreur lors de la mise à jour.' });
- }
-};
diff --git a/backend/src/controllers/im_export.controller.ts b/backend/src/controllers/im_export.controller.ts
index 668c40f..ee1505f 100644
--- a/backend/src/controllers/im_export.controller.ts
+++ b/backend/src/controllers/im_export.controller.ts
@@ -1,6 +1,6 @@
import fs from 'fs';
import path from 'path';
-import * as event_service from '../services/event.service';
+import * as settings_service from '../services/settings.service';
import * as export_service from '../services/im_export.service';
import * as permanence_service from '../services/permanence.service';
import * as team_service from '../services/team.service';
@@ -22,7 +22,7 @@ export const exportAllDataToSheets: AppRequestHandler = async (_req, res) => {
const userList = await user_service.getUsersAll();
const teamList = await team_service.getTeamsAll();
const permanenceList = await permanence_service.getAllPermanencesWithUsers();
- const shotgunList = await event_service.getAllTeamShotguns();
+ const shotgunList = await settings_service.getAllTeamShotguns();
// 2. Mapping -> format pour Google Sheets (array de array)
const usersValues = [
diff --git a/backend/src/controllers/settings.controller.ts b/backend/src/controllers/settings.controller.ts
new file mode 100644
index 0000000..004e768
--- /dev/null
+++ b/backend/src/controllers/settings.controller.ts
@@ -0,0 +1,139 @@
+import * as settings_service from '../services/settings.service';
+import * as team_service from '../services/team.service';
+import { Conflict, Error, Ok, Teapot, Unauthorized } from '../shared/http/responses';
+import { shotgun_password } from '../shared/secrets/secrets';
+import type { AppRequestHandler } from '../types/http';
+import type { ShotgunBody, ToggleStatusBody } from '../dto/event.dto';
+
+export const getSettingStatus: AppRequestHandler = async (req, res) => {
+ const { setting } = req.params;
+
+ if (!setting || !settings_service.isSetting(setting)) {
+ Error(res, { msg: 'Setting événement inconnu.' });
+ return;
+ }
+
+ try {
+ const status = await settings_service.getSettingStatus(setting);
+ if (setting === 'shotgun') {
+ Ok(res, { data: { status, password: status ? shotgun_password : '' } });
+ } else {
+ Ok(res, { data: status });
+ }
+ } catch (error) {
+ Error(res, { msg: 'Erreur lors de la récupération du statut :' + error });
+ }
+};
+
+export const getAvailableSettings: AppRequestHandler = async (req, res) => {
+ try {
+ const userPermission = req.user?.userPermission ?? '';
+ const userRoles = req.user?.userRoles?.map((role) => role.roleName) ?? [];
+ const settings = await settings_service.getAvailableSettings(userPermission, userRoles);
+ Ok(res, { data: settings });
+ } catch (error) {
+ Error(res, { msg: 'Erreur lors de la récupération des settings :' + error });
+ }
+};
+
+export const getAdminSettings: AppRequestHandler = async (_req, res) => {
+ try {
+ const settings = await settings_service.getAllSettings();
+ Ok(res, { data: settings });
+ } catch (error) {
+ Error(res, { msg: 'Erreur lors de la récupération des settings :' + error });
+ }
+};
+
+export const getShotgunAttempts: AppRequestHandler = async (_req, res) => {
+ try {
+ const shotgunAttempts = await settings_service.getAllTeamShotguns();
+ const shotgunAttemptsWithLeaders = await Promise.all(
+ shotgunAttempts.map(async (attempt) => {
+ if (!attempt.teamId) {
+ return { ...attempt, leaderCount: 0 };
+ }
+
+ const teamUsers = await team_service.getTeamUsers(attempt.teamId);
+ const leaderCount = teamUsers.filter((user) => user.permission !== 'Nouveau').length;
+
+ return { ...attempt, leaderCount };
+ }),
+ );
+
+ Ok(res, { data: shotgunAttemptsWithLeaders });
+ } catch (error) {
+ Error(res, { msg: 'Erreur lors de la récupération des tentatives shotgun : ' + error });
+ }
+};
+
+export const shotgunAttempt: AppRequestHandler = async (req, res) => {
+ const { password } = req.body;
+
+ const userId = req.user?.userId;
+
+ if (!userId) {
+ Unauthorized(res, { msg: 'Utilisateur non authentifié.' });
+ return;
+ }
+
+ if (!shotgun_password) {
+ Error(res, { msg: 'Mot de passe shotgun non configuré côté serveur.' });
+ return;
+ }
+
+ if (password !== shotgun_password) {
+ Teapot(res, { msg: 'Le mot de passe shotgun est incorrect.' });
+ return;
+ }
+
+ const status = await settings_service.getSettingsStatus();
+ if (!status?.shotgun_open) {
+ Unauthorized(res, { msg: 'Le shotgun est fermé.' });
+ return;
+ }
+ try {
+ const userTeam = await team_service.getUserTeam(userId);
+
+ if (!userTeam) {
+ Error(res, { msg: "Erreur : Tu n'as pas d'équipe !" });
+ return;
+ }
+
+ const alreadyShotgun = await settings_service.alreadyShotgun(userTeam);
+
+ if (alreadyShotgun) {
+ Conflict(res, { msg: 'Votre équipe est déjà dans le shotgun.' });
+ return;
+ }
+
+ await settings_service.validateShotgun(userTeam);
+ Ok(res, { msg: 'Shotgun validé !' });
+ return;
+ } catch (error) {
+ Error(res, { msg: 'Erreur pendant le shotguns : ' + error });
+ return;
+ }
+};
+
+export const updateSettingStatus: AppRequestHandler = async (req, res) => {
+ const { setting } = req.params;
+ const { open } = req.body;
+
+ if (!setting || !settings_service.isSetting(setting)) {
+ Error(res, { msg: 'Setting événement inconnu.' });
+ return;
+ }
+
+ if (typeof open !== 'boolean') {
+ Error(res, { msg: "Le champ 'open' doit être un booléen." });
+ return;
+ }
+
+ try {
+ const result = await settings_service.updateSettingStatus(setting, open);
+ Ok(res, { msg: 'Paramètres mis à jour.', data: result });
+ } catch (error) {
+ Error(res, { msg: 'Erreur lors de la mise à jour : ' + error });
+ }
+};
diff --git a/backend/src/controllers/team.controller.ts b/backend/src/controllers/team.controller.ts
index 5377d9a..78a6461 100644
--- a/backend/src/controllers/team.controller.ts
+++ b/backend/src/controllers/team.controller.ts
@@ -1,5 +1,5 @@
import { type Event } from '../schemas/Basic/event.schema';
-import * as event_service from '../services/event.service';
+import * as settings_service from '../services/settings.service';
import * as faction_service from '../services/faction.service';
import * as team_service from '../services/team.service';
import { Error, Ok } from '../shared/http/responses';
@@ -14,7 +14,7 @@ export const createNewTeam: AppRequestHandler = async (req, res)
Error(res, { msg: "Il n'y a pas de nom d'équipe" });
return;
}
- const status: Event = await event_service.getEventsStatus();
+ const status: Event = await settings_service.getSettingsStatus();
if (!status?.pre_registration_open) {
Error(res, { msg: "L'enregistrement d'équipe est fermé." });
return;
diff --git a/backend/src/dto/event.dto.ts b/backend/src/dto/event.dto.ts
index d70cf2f..b126d58 100644
--- a/backend/src/dto/event.dto.ts
+++ b/backend/src/dto/event.dto.ts
@@ -3,10 +3,5 @@ export type ShotgunBody = {
};
export type ToggleStatusBody = {
- preRegistrationOpen?: boolean;
- shotgunOpen?: boolean;
- sdiOpen?: boolean;
- weiOpen?: boolean;
- foodOpen?: boolean;
- challOpen?: boolean;
+ open?: boolean;
};
diff --git a/backend/src/routes/event.routes.ts b/backend/src/routes/event.routes.ts
deleted file mode 100644
index 206174d..0000000
--- a/backend/src/routes/event.routes.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import express from 'express';
-import * as eventController from '../controllers/event.controller';
-import { checkRole } from '../middlewares/user.middleware';
-
-const eventRouter = express.Router();
-
-// User routes
-eventRouter.get("/user/shotgunstatus", checkRole("Student", []), eventController.checkShotgunStatus);
-eventRouter.get("/user/preregisterstatus", checkRole("Student", []), eventController.checkPreRegisterStatus);
-eventRouter.get("/user/sdistatus", eventController.checkSDIStatus);
-eventRouter.get("/user/weistatus", eventController.checkWEIStatus);
-eventRouter.get("/user/foodstatus", eventController.checkFoodStatus);
-eventRouter.get("/user/challstatus", eventController.checkChallStatus);
-eventRouter.post("/user/shotgunattempt", checkRole("Student", []), eventController.shotgunAttempt);
-
-// Admin routes
-eventRouter.post("/admin/shotguntoggle", checkRole("Admin", []), eventController.toggleShotgun);
-eventRouter.get("/admin/shotgunattempts", checkRole("Admin", ["Respo CE"]), eventController.getShotgunAttempts);
-eventRouter.post("/admin/preregistrationtoggle", checkRole("Admin", []), eventController.togglePreRegistration);
-eventRouter.post("/admin/sditoggle", checkRole("Admin", []), eventController.toggleSDI);
-eventRouter.post("/admin/weitoggle", checkRole("Admin", []), eventController.toggleWEI);
-eventRouter.post("/admin/foodtoggle", checkRole("Admin", []), eventController.toggleFood);
-eventRouter.post("/admin/challtoggle", checkRole("Admin", []), eventController.toggleChall);
-
-export default eventRouter;
diff --git a/backend/src/routes/settings.routes.ts b/backend/src/routes/settings.routes.ts
new file mode 100644
index 0000000..4e8ddc8
--- /dev/null
+++ b/backend/src/routes/settings.routes.ts
@@ -0,0 +1,17 @@
+import express from 'express';
+import * as settingsController from '../controllers/settings.controller';
+import { checkRole } from '../middlewares/user.middleware';
+
+const settingsRouter = express.Router();
+
+// User routes
+settingsRouter.get('/user/status', settingsController.getAvailableSettings);
+settingsRouter.get('/user/status/:setting', settingsController.getSettingStatus);
+settingsRouter.post('/user/shotgunattempt', checkRole('Student', []), settingsController.shotgunAttempt);
+
+// Admin routes
+settingsRouter.get('/admin/shotgunattempts', checkRole('Admin', ['Respo CE']), settingsController.getShotgunAttempts);
+settingsRouter.get('/admin/settings', checkRole('Admin', []), settingsController.getAdminSettings);
+settingsRouter.patch('/admin/status/:setting', checkRole('Admin', []), settingsController.updateSettingStatus);
+
+export default settingsRouter;
diff --git a/backend/src/schemas/Basic/event.schema.ts b/backend/src/schemas/Basic/event.schema.ts
index 0ca2969..466fd24 100644
--- a/backend/src/schemas/Basic/event.schema.ts
+++ b/backend/src/schemas/Basic/event.schema.ts
@@ -1,13 +1,14 @@
-import { boolean, pgTable, serial } from "drizzle-orm/pg-core";
+import { boolean, pgTable, serial } from 'drizzle-orm/pg-core';
-export const eventSchema = pgTable("events", {
- id: serial("id").primaryKey(),
- pre_registration_open: boolean("pre_registration_open").default(false),
- shotgun_open: boolean("shotgun_open").default(false),
- sdi_open: boolean("sdi_open").default(false),
- wei_open: boolean("wei_open").default(false),
- food_open: boolean("food_open").default(false),
- chall_open: boolean("chall_open").default(false),
+export const eventSchema = pgTable('events', {
+ id: serial('id').primaryKey(),
+ pre_registration_open: boolean('pre_registration_open').default(false),
+ shotgun_open: boolean('shotgun_open').default(false),
+ sdi_open: boolean('sdi_open').default(false),
+ wei_open: boolean('wei_open').default(false),
+ food_open: boolean('food_open').default(false),
+ chall_open: boolean('chall_open').default(false),
+ maker_battle_group_open: boolean('chall_open').default(false),
});
export type Event = typeof eventSchema.$inferSelect;
diff --git a/backend/src/services/event.service.ts b/backend/src/services/event.service.ts
deleted file mode 100644
index 1457dec..0000000
--- a/backend/src/services/event.service.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-import { asc, eq } from "drizzle-orm";
-import { db } from "../database/db";
-import { eventSchema } from "../schemas/Basic/event.schema";
-import { teamSchema } from "../schemas/Basic/team.schema";
-import { teamShotgunSchema } from "../schemas/Relational/teamshotgun.schema";
-
-export const getEventsStatus = async () => {
- const events = await db.select().from(eventSchema);
- if (events.length > 0) {
- return events[0]; // Renvoie le premier événement s'il existe
- } else {
- return null; // ou une valeur par défaut
- }
-};
-
-export const validateShotgun = async (teamId: number) => {
- await db.transaction(async (tx) => {
- await tx.insert(teamShotgunSchema).values({ team_id: teamId });
- })
-};
-
-export const alreadyShotgun = async (teamId: number) => {
- const shotgunTeam = await db.select({ shotgunId: teamShotgunSchema.id })
- .from(teamShotgunSchema)
- .where(eq(teamShotgunSchema.team_id, teamId));
-
- if (shotgunTeam[0]) {
- return true
- }
- else {
- return false
- }
-};
-
-export const updatepreRegistrationStatus = async (preRegistrationOpen: boolean) => {
- return await db.update(eventSchema)
- .set({ pre_registration_open: preRegistrationOpen })
- .returning();
-};
-
-export const updateShotgunStatus = async (shotgunOpen: boolean) => {
- return await db.update(eventSchema)
- .set({ shotgun_open: shotgunOpen })
- .returning();
-};
-
-export const getAllTeamShotguns = async () => {
- return await db
- .select({
- id: teamShotgunSchema.id,
- teamId: teamShotgunSchema.team_id,
- timestamp: teamShotgunSchema.timestamp,
- teamName: teamSchema.name,
- teamType: teamSchema.type,
- })
- .from(teamShotgunSchema)
- .leftJoin(teamSchema, eq(teamShotgunSchema.team_id, teamSchema.id))
- .orderBy(asc(teamShotgunSchema.timestamp), asc(teamShotgunSchema.id));
-};
-
-export const updateSDIStatus = async (sdiOpen: boolean) => {
- return await db.update(eventSchema)
- .set({ sdi_open: sdiOpen })
- .returning();
-};
-
-export const updateWEIStatus = async (weiOpen: boolean) => {
- return await db.update(eventSchema)
- .set({ wei_open: weiOpen })
- .returning();
-};
-
-export const updateFoodStatus = async (foodOpen: boolean) => {
- return await db.update(eventSchema)
- .set({ food_open: foodOpen })
- .returning();
-};
-
-export const updateChallStatus = async (challOpen: boolean) => {
- return await db.update(eventSchema)
- .set({ chall_open: challOpen })
- .returning();
-};
diff --git a/backend/src/services/settings.service.ts b/backend/src/services/settings.service.ts
new file mode 100644
index 0000000..43055a0
--- /dev/null
+++ b/backend/src/services/settings.service.ts
@@ -0,0 +1,116 @@
+import { asc, eq } from 'drizzle-orm';
+import { db } from '../database/db';
+import { eventSchema } from '../schemas/Basic/event.schema';
+import { teamSchema } from '../schemas/Basic/team.schema';
+import { teamShotgunSchema } from '../schemas/Relational/teamshotgun.schema';
+
+export const settingColumns = {
+ preRegistration: 'pre_registration_open',
+ shotgun: 'shotgun_open',
+ sdi: 'sdi_open',
+ wei: 'wei_open',
+ food: 'food_open',
+ challenge: 'chall_open',
+ makerBattleGroup: 'maker_battle_group_open',
+} as const;
+
+export type Setting = keyof typeof settingColumns;
+
+type SettingDefinition = {
+ key: Setting;
+ label: string;
+ column: (typeof settingColumns)[Setting];
+ roles: string[];
+};
+
+export const settingDefinitions: SettingDefinition[] = [
+ { key: 'preRegistration', label: 'Pré-inscription', column: 'pre_registration_open', roles: [] },
+ { key: 'shotgun', label: 'Shotgun', column: 'shotgun_open', roles: [] },
+ { key: 'sdi', label: 'SDI (Billetterie)', column: 'sdi_open', roles: [] },
+ { key: 'wei', label: 'WEI (Billetterie + Tentes)', column: 'wei_open', roles: [] },
+ { key: 'food', label: 'Nourriture (Billetterie)', column: 'food_open', roles: [] },
+ { key: 'challenge', label: 'Challenges (Affichage des challenges)', column: 'chall_open', roles: [] },
+ {
+ key: 'makerBattleGroup',
+ label: 'Groupes de défis TC & Branche (Affichage des groupes)',
+ column: 'maker_battle_group_open',
+ roles: [],
+ },
+];
+
+export const isSetting = (setting: string): setting is Setting => setting in settingColumns;
+
+export const getSettingsStatus = async () => {
+ const events = await db.select().from(eventSchema);
+ if (events.length > 0) {
+ return events[0]; // Renvoie le premier événement s'il existe
+ } else {
+ return null; // ou une valeur par défaut
+ }
+};
+
+export const getSettingStatus = async (setting: Setting) => {
+ const settings = await getSettingsStatus();
+ return settings ? Boolean(settings[settingColumns[setting] as keyof typeof settings]) : false;
+};
+
+const canAccessSetting = (definition: SettingDefinition, userPermission: string, userRoles: string[]) =>
+ userPermission === 'Admin' ||
+ definition.roles.length === 0 ||
+ definition.roles.includes(userPermission) ||
+ definition.roles.some((role) => userRoles.includes(role));
+
+export const getAvailableSettings = async (userPermission: string, userRoles: string[]) => {
+ const settings = await getSettingsStatus();
+
+ return settingDefinitions
+ .filter((definition) => canAccessSetting(definition, userPermission, userRoles))
+ .map(({ key, label, roles, column }) => ({
+ key,
+ label,
+ roles,
+ open: settings ? Boolean(settings[column as keyof typeof settings]) : false,
+ }));
+};
+
+export const getAllSettings = async () => getAvailableSettings('Admin', []);
+
+export const validateShotgun = async (teamId: number) => {
+ await db.transaction(async (tx) => {
+ await tx.insert(teamShotgunSchema).values({ team_id: teamId });
+ });
+};
+
+export const alreadyShotgun = async (teamId: number) => {
+ const shotgunTeam = await db
+ .select({ shotgunId: teamShotgunSchema.id })
+ .from(teamShotgunSchema)
+ .where(eq(teamShotgunSchema.team_id, teamId));
+
+ if (shotgunTeam[0]) {
+ return true;
+ } else {
+ return false;
+ }
+};
+
+export const updateSettingStatus = async (setting: Setting, open: boolean) => {
+ return await db
+ .update(eventSchema)
+ .set({ [settingColumns[setting]]: open })
+ .returning();
+};
+
+export const getAllTeamShotguns = async () => {
+ return await db
+ .select({
+ id: teamShotgunSchema.id,
+ teamId: teamShotgunSchema.team_id,
+ timestamp: teamShotgunSchema.timestamp,
+ teamName: teamSchema.name,
+ teamType: teamSchema.type,
+ })
+ .from(teamShotgunSchema)
+ .leftJoin(teamSchema, eq(teamShotgunSchema.team_id, teamSchema.id))
+ .orderBy(asc(teamShotgunSchema.timestamp), asc(teamShotgunSchema.id));
+};
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 46b0562..5b14d8b 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -12,7 +12,7 @@ const AdminPageBanned = lazy(() => import('./pages/admin/adminBanned'));
const AdminPageBus = lazy(() => import('./pages/admin/adminBus'));
const AdminPageChallenges = lazy(() => import('./pages/admin/adminChallenges'));
const AdminPageEmail = lazy(() => import('./pages/admin/adminEmail'));
-const AdminPageEvents = lazy(() => import('./pages/admin/adminEvents'));
+const AdminPageSettings = lazy(() => import('./pages/admin/adminSettings'));
const AdminPageExport = lazy(() => import('./pages/admin/adminExport'));
const AdminPageFaction = lazy(() => import('./pages/admin/adminFaction'));
const AdminPageGames = lazy(() => import('./pages/admin/adminGames'));
@@ -264,10 +264,10 @@ const App: React.FC = () => {
}
/>
-
+
}
/>
diff --git a/frontend/src/components/Admin/adminEvent.tsx b/frontend/src/components/Admin/adminSettings.tsx
similarity index 57%
rename from frontend/src/components/Admin/adminEvent.tsx
rename to frontend/src/components/Admin/adminSettings.tsx
index 2e85f79..126ca88 100644
--- a/frontend/src/components/Admin/adminEvent.tsx
+++ b/frontend/src/components/Admin/adminSettings.tsx
@@ -2,57 +2,22 @@ import { CheckCircle, Loader2, XCircle } from 'lucide-react';
import { useEffect, useState } from 'react';
import Swal from 'sweetalert2';
-import {
- checkChallengeStatus,
- checkFoodStatus,
- checkPreRegisterStatus,
- checkSDIStatus,
- checkShotgunStatus,
- checkWEIStatus,
- toggleChallenge,
- toggleFood,
- togglePreRegistration,
- toggleSDI,
- toggleShotgun,
- toggleWEI,
-} from '../../services/requests/event.service';
+import type { Setting } from '../../interfaces/settings.interface';
+import { getAdminSettings, updateSetting } from '../../services/requests/settings.service';
import { Button } from '../ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
-export const AdminEvents = () => {
+export const AdminSettings = () => {
const [loading, setLoading] = useState(false);
const [loadingStatuses, setLoadingStatuses] = useState(true);
- const [statuses, setStatuses] = useState({
- preRegistration: false,
- shotgun: false,
- sdi: false,
- wei: false,
- food: false,
- chall: false,
- });
+ const [settings, setSettings] = useState([]);
// Charger les statuts au montage
useEffect(() => {
const fetchStatuses = async () => {
try {
- const [preReg, shot, sdi, wei, food, chall] = await Promise.all([
- checkPreRegisterStatus(),
- checkShotgunStatus(),
- checkSDIStatus(),
- checkWEIStatus(),
- checkFoodStatus(),
- checkChallengeStatus(),
- ]);
-
- setStatuses({
- preRegistration: preReg,
- shotgun: shot.status,
- sdi,
- wei,
- food,
- chall,
- });
+ setSettings(await getAdminSettings());
} catch {
Swal.fire({
icon: 'error',
@@ -67,19 +32,18 @@ export const AdminEvents = () => {
}, []);
// Fonction générique pour toggle un événement
- const handleToggle = async (
- key: keyof typeof statuses,
- toggleFn: (value: boolean) => Promise,
- successMsg: string,
- ) => {
+ const handleToggle = async (setting: Setting) => {
setLoading(true);
try {
- await toggleFn(!statuses[key]);
- setStatuses((prev) => ({ ...prev, [key]: !prev[key] }));
+ const open = !setting.open;
+ await updateSetting(setting.key, open);
+ setSettings((previous) =>
+ previous.map((current) => (current.key === setting.key ? { ...current, open } : current)),
+ );
Swal.fire({
icon: 'success',
title: 'Succès',
- text: successMsg,
+ text: `${setting.label} mis à jour !`,
timer: 1500,
showConfirmButton: false,
});
@@ -94,40 +58,6 @@ export const AdminEvents = () => {
}
};
- // 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,
- },
- ];
-
if (loadingStatuses) {
return (
@@ -141,15 +71,15 @@ export const AdminEvents = () => {
- ⚙️ Gestion des Événements
+ ⚙️ Gestion des settings
- {events.map(({ key, label, toggleFn }) => {
- const isActive = statuses[key];
+ {settings.map((setting) => {
+ const isActive = setting.open;
return (
{isActive ? (
@@ -157,11 +87,11 @@ export const AdminEvents = () => {
) : (
)}
- {label}
+ {setting.label}
handleToggle(key, toggleFn, `${label} mis à jour !`)}
+ onClick={() => handleToggle(setting)}
disabled={loading}
className={`transition-colors duration-300 ${
isActive
diff --git a/frontend/src/components/Admin/adminShotgun.tsx b/frontend/src/components/Admin/adminShotgun.tsx
index f2a9f29..218c65d 100644
--- a/frontend/src/components/Admin/adminShotgun.tsx
+++ b/frontend/src/components/Admin/adminShotgun.tsx
@@ -1,8 +1,8 @@
import { useEffect, useMemo, useState } from 'react';
import { Link } from 'react-router-dom';
-import { type ShotgunAttemptRow } from '../../interfaces/event.interface';
-import { getShotgunAttemptsAdmin } from '../../services/requests/event.service';
+import { type ShotgunAttemptRow } from '../../interfaces/settings.interface';
+import { getShotgunAttemptsAdmin } from '../../services/requests/settings.service';
import { Button } from '../ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
diff --git a/frontend/src/components/WEI_SDI_Food/foodSection.tsx b/frontend/src/components/WEI_SDI_Food/foodSection.tsx
index ccd4fb0..f8aa861 100644
--- a/frontend/src/components/WEI_SDI_Food/foodSection.tsx
+++ b/frontend/src/components/WEI_SDI_Food/foodSection.tsx
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
-import { checkFoodStatus } from '../../services/requests/event.service';
+import { checkFoodStatus } from '../../services/requests/settings.service';
// import { getPermission } from '../../services/requests/user.service';
import { checkUploadAvailability } from '../../utils/utils';
import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
diff --git a/frontend/src/components/WEI_SDI_Food/sdiSection.tsx b/frontend/src/components/WEI_SDI_Food/sdiSection.tsx
index 572359d..59e1e5c 100644
--- a/frontend/src/components/WEI_SDI_Food/sdiSection.tsx
+++ b/frontend/src/components/WEI_SDI_Food/sdiSection.tsx
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
import { useOnboarding } from '../../contexts/onboarding';
import { decodeToken, getToken } from '../../services/requests/auth.service';
-import { checkSDIStatus } from '../../services/requests/event.service';
+import { checkSDIStatus } from '../../services/requests/settings.service';
import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
export const SdiSection = () => {
diff --git a/frontend/src/components/WEI_SDI_Food/weiSection.tsx b/frontend/src/components/WEI_SDI_Food/weiSection.tsx
index c728b01..ca2e0c9 100644
--- a/frontend/src/components/WEI_SDI_Food/weiSection.tsx
+++ b/frontend/src/components/WEI_SDI_Food/weiSection.tsx
@@ -3,7 +3,7 @@ import { useEffect, useState } from 'react';
import { useOnboarding } from '../../contexts/onboarding';
import { useUser } from '../../contexts/user';
import { decodeToken, getToken } from '../../services/requests/auth.service';
-import { checkWEIStatus } from '../../services/requests/event.service';
+import { checkWEIStatus } from '../../services/requests/settings.service';
import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
export const WeiSection = () => {
diff --git a/frontend/src/components/challenge/challengeList.tsx b/frontend/src/components/challenge/challengeList.tsx
index 9deba70..1f141f5 100644
--- a/frontend/src/components/challenge/challengeList.tsx
+++ b/frontend/src/components/challenge/challengeList.tsx
@@ -4,8 +4,8 @@ import Swal from 'sweetalert2';
import { type Challenge } from '../../interfaces/challenge.interface';
import { type Faction } from '../../interfaces/faction.interface';
import { getAllChallenges, getFactionsPoints } from '../../services/requests/challenge.service';
-import { checkChallengeStatus } from '../../services/requests/event.service';
import { getAllFactionsUser } from '../../services/requests/faction.service';
+import { checkChallengeStatus } from '../../services/requests/settings.service';
import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
export const UserChallengeList = () => {
diff --git a/frontend/src/components/navbar.tsx b/frontend/src/components/navbar.tsx
index 79bd146..6c56745 100644
--- a/frontend/src/components/navbar.tsx
+++ b/frontend/src/components/navbar.tsx
@@ -92,13 +92,13 @@ export const Navbar = () => {
{ label: 'Bus', to: '/admin/bus', rolesAllowed: ['Admin'] },
{ label: 'Challenge', to: '/admin/challenge', rolesAllowed: ['Admin', 'Arbitre'] },
{ label: 'Email', to: '/admin/email', rolesAllowed: ['Admin'] },
- { label: 'Events', to: '/admin/events', rolesAllowed: ['Admin'] },
{ label: 'Export / Import', to: '/admin/export-import', rolesAllowed: ['Admin'] },
{ label: 'Factions', to: '/admin/factions', rolesAllowed: ['Admin', 'Respo CE'] },
{ label: 'Games', to: '/admin/games', rolesAllowed: ['Admin'] },
{ label: 'News', to: '/admin/news', rolesAllowed: ['Admin', 'Communication'] },
{ label: 'Permanences', to: '/admin/permanences', rolesAllowed: ['Admin', 'Respo CE'] },
{ label: 'Roles', to: '/admin/roles', rolesAllowed: ['Admin'] },
+ { label: 'Settings', to: '/admin/settings', rolesAllowed: ['Admin'] },
{ label: 'Shotgun', to: '/admin/shotgun', rolesAllowed: ['Admin', 'Respo CE'] },
{ label: 'Teams', to: '/admin/teams', rolesAllowed: ['Admin', 'Respo CE'] },
{ label: 'Tentes', to: '/admin/tent', rolesAllowed: ['Admin'] },
diff --git a/frontend/src/components/shotgun/preregisterCESection.tsx b/frontend/src/components/shotgun/preregisterCESection.tsx
index 8a8e907..3c03751 100644
--- a/frontend/src/components/shotgun/preregisterCESection.tsx
+++ b/frontend/src/components/shotgun/preregisterCESection.tsx
@@ -1,7 +1,7 @@
-import { useEffect, useState } from "react";
+import { useEffect, useState } from 'react';
-import { checkPreRegisterStatus } from "../../services/requests/event.service";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { checkPreRegisterStatus } from '../../services/requests/settings.service';
+import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
export const PreregisterCESection = () => {
const [isPreRegistrationOpen, setIsPreRegistrationOpen] = useState(false);
@@ -12,7 +12,7 @@ export const PreregisterCESection = () => {
const status = await checkPreRegisterStatus();
setIsPreRegistrationOpen(status);
} catch {
- alert("Erreur lors de la récupération du statut de pré-inscription.");
+ alert('Erreur lors de la récupération du statut de pré-inscription.');
}
};
fetchStatus();
@@ -35,8 +35,7 @@ export const PreregisterCESection = () => {
src="https://forms.gle/32yHKGSTzfFvp7NP9"
className="absolute inset-0 w-full h-full border-none"
title="Formulaire de pré-inscription CE"
- loading="lazy"
- >
+ loading="lazy">
Chargement…
diff --git a/frontend/src/components/shotgun/preregisterTeamSection.tsx b/frontend/src/components/shotgun/preregisterTeamSection.tsx
index 6e3fa46..cd8eae0 100644
--- a/frontend/src/components/shotgun/preregisterTeamSection.tsx
+++ b/frontend/src/components/shotgun/preregisterTeamSection.tsx
@@ -1,15 +1,15 @@
-import { useEffect, useState } from "react";
-import Select from "react-select";
+import { useEffect, useState } from 'react';
+import Select from 'react-select';
-import { checkPreRegisterStatus } from "../../services/requests/event.service";
-import { createTeam } from "../../services/requests/team.service";
-import { getUsers } from "../../services/requests/user.service";
-import { Button } from "../ui/button";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
-import { Input } from "../ui/input";
+import { checkPreRegisterStatus } from '../../services/requests/settings.service';
+import { createTeam } from '../../services/requests/team.service';
+import { getUsers } from '../../services/requests/user.service';
+import { Button } from '../ui/button';
+import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
+import { Input } from '../ui/input';
export const PreregisterTeamSection = () => {
- const [teamName, setTeamName] = useState("");
+ const [teamName, setTeamName] = useState('');
const [members, setMembers] = useState([]);
const [isPreRegistrationOpen, setIsPreRegistrationOpen] = useState(false);
const [users, setUsers] = useState<{ userId: number; firstName: string; lastName: string }[]>([]);
@@ -20,7 +20,7 @@ export const PreregisterTeamSection = () => {
const status = await checkPreRegisterStatus();
setIsPreRegistrationOpen(status);
} catch {
- alert("Erreur lors de la récupération du statut de pré-inscription.");
+ alert('Erreur lors de la récupération du statut de pré-inscription.');
}
};
fetchStatus();
@@ -32,7 +32,7 @@ export const PreregisterTeamSection = () => {
const userList = await getUsers();
setUsers(userList);
} catch {
- alert("Erreur lors de la récupération des utilisateurs.");
+ alert('Erreur lors de la récupération des utilisateurs.');
}
};
fetchUsers();
@@ -72,20 +72,23 @@ export const PreregisterTeamSection = () => {
{isPreRegistrationOpen ? (
<>
- Etape 1: le GForm de motivation !
+
+ Etape 1: le GForm de motivation !
+
- Etape 2: Sélection des membres
+
+ Etape 2: Sélection des membres
+
@@ -141,15 +144,15 @@ export const PreregisterTeamSection = () => {
- Si tu ne trouves pas un coéquipier, c'est qu'il ne s'est jamais connecté sur ce site !
+ Si tu ne trouves pas un coéquipier, c'est qu'il ne s'est jamais connecté sur ce
+ site !
Il lui suffit de se connecter une fois pour apparaitre dans cette liste.
+ className="w-full py-3 text-lg bg-blue-600 text-white rounded-xl shadow-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300">
Enregistrer l'équipe
@@ -162,6 +165,6 @@ export const PreregisterTeamSection = () => {
)}
-
+
);
};
diff --git a/frontend/src/components/shotgun/shotgunSection.tsx b/frontend/src/components/shotgun/shotgunSection.tsx
index ba41295..8c62380 100644
--- a/frontend/src/components/shotgun/shotgunSection.tsx
+++ b/frontend/src/components/shotgun/shotgunSection.tsx
@@ -1,17 +1,17 @@
-import { type AxiosError } from "axios";
-import { useEffect, useState } from "react";
+import { type AxiosError } from 'axios';
+import { useEffect, useState } from 'react';
-import { type ApiErrorResponse } from "../../interfaces/event.interface";
-import { attemptShotgun, checkShotgunStatus } from "../../services/requests/event.service";
-import { Button } from "../ui/button";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
-import { Input } from "../ui/input";
+import { type ApiErrorResponse } from '../../interfaces/settings.interface';
+import { attemptShotgun, checkShotgunStatus } from '../../services/requests/settings.service';
+import { Button } from '../ui/button';
+import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
+import { Input } from '../ui/input';
export const Shotgun = () => {
const [status, setStatus] = useState(false);
- const [message, setMessage] = useState("");
- const [inputValue, setInputValue] = useState("");
- const [shotgunPassword, setShotgunPassword] = useState("");
+ const [message, setMessage] = useState('');
+ const [inputValue, setInputValue] = useState('');
+ const [shotgunPassword, setShotgunPassword] = useState('');
useEffect(() => {
const fetchStatus = async () => {
@@ -26,12 +26,12 @@ export const Shotgun = () => {
e.preventDefault();
if (!shotgunPassword) {
- setMessage("❌ Erreur : mot de passe shotgun indisponible.");
+ setMessage('❌ Erreur : mot de passe shotgun indisponible.');
return;
}
if (inputValue !== shotgunPassword) {
- setMessage("❌ Erreur : Mot de passe de Shotgun incorrect.");
+ setMessage('❌ Erreur : Mot de passe de Shotgun incorrect.');
return;
}
@@ -40,16 +40,14 @@ export const Shotgun = () => {
setMessage(response.message);
} catch (error) {
const axiosError = error as AxiosError;
- setMessage(axiosError.response?.data?.message || "Une erreur est survenue.");
+ setMessage(axiosError.response?.data?.message || 'Une erreur est survenue.');
}
};
return (
-
- Shotgun 🎯
-
+ Shotgun 🎯
Tape exactement la bonne phrase pour valider ton shotgun (majuscules incluses).
@@ -57,9 +55,10 @@ export const Shotgun = () => {
- Mot à entrer :{" "}
-
- {shotgunPassword || "patience..."}
+ Mot à entrer :{' '}
+
+ {shotgunPassword || 'patience...'}
{!status && (
@@ -80,17 +79,18 @@ export const Shotgun = () => {
/>
+ className="w-full py-3 text-lg bg-purple-600 text-white rounded-xl shadow-md hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 transition duration-300">
Shotgun !
{message && (
+ className={`text-center text-lg mt-4 ${
+ message.includes('Erreur') ||
+ message.toLowerCase().includes('déjà') ||
+ message.toLowerCase().includes('incorrect')
+ ? 'text-red-500'
+ : 'text-green-600'
+ }`}>
{message}
)}
diff --git a/frontend/src/components/tent/tentSection.tsx b/frontend/src/components/tent/tentSection.tsx
index a641ab9..cd6ca7a 100644
--- a/frontend/src/components/tent/tentSection.tsx
+++ b/frontend/src/components/tent/tentSection.tsx
@@ -6,7 +6,7 @@ import { useOnboarding } from '../../contexts/onboarding';
import { type Tent } from '../../interfaces/tent.interface';
import { type User } from '../../interfaces/user.interface';
import { decodeToken, getToken } from '../../services/requests/auth.service';
-import { checkWEIStatus } from '../../services/requests/event.service';
+import { checkWEIStatus } from '../../services/requests/settings.service';
import { cancelTent, createTent, getUserTent } from '../../services/requests/tent.service';
import { getUsers } from '../../services/requests/user.service';
import { Button } from '../ui/button';
diff --git a/frontend/src/interfaces/event.interface.ts b/frontend/src/interfaces/settings.interface.ts
similarity index 84%
rename from frontend/src/interfaces/event.interface.ts
rename to frontend/src/interfaces/settings.interface.ts
index 5954848..983c50f 100644
--- a/frontend/src/interfaces/event.interface.ts
+++ b/frontend/src/interfaces/settings.interface.ts
@@ -3,6 +3,12 @@ export interface ShotgunStatusData {
password: string;
}
+export interface Setting {
+ key: string;
+ label: string;
+ open: boolean;
+}
+
export interface ShotgunAttemptPayload {
password: string;
}
diff --git a/frontend/src/pages/admin/adminEvents.tsx b/frontend/src/pages/admin/adminSettings.tsx
similarity index 63%
rename from frontend/src/pages/admin/adminEvents.tsx
rename to frontend/src/pages/admin/adminSettings.tsx
index 27b200f..b53e27c 100644
--- a/frontend/src/pages/admin/adminEvents.tsx
+++ b/frontend/src/pages/admin/adminSettings.tsx
@@ -1,15 +1,15 @@
-import { AdminEvents } from '../../components/Admin/adminEvent';
import { AdminLayout } from '../../components/Admin/adminLayout';
+import { AdminSettings } from '../../components/Admin/adminSettings';
import { RevealSection } from '../../components/ui/revealSection';
-const AdminPageEvents: React.FC = () => (
+const AdminPageSettings: React.FC = () => (
);
-export default AdminPageEvents;
+export default AdminPageSettings;
diff --git a/frontend/src/services/requests/event.service.ts b/frontend/src/services/requests/event.service.ts
deleted file mode 100644
index bc46a59..0000000
--- a/frontend/src/services/requests/event.service.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-import { type ApiMessageResponse, type ShotgunAttemptPayload, type ShotgunAttemptRow, type ShotgunStatusData } from '../../interfaces/event.interface';
-import api from '../api';
-
-export const checkShotgunStatus = async (): Promise
=> {
- const response = await api.get<{ data: ShotgunStatusData }>("/event/user/shotgunstatus");
- return response.data.data;
-};
-
-export const checkPreRegisterStatus = async () => {
- const response = await api.get("/event/user/preregisterstatus");
- return response.data.data;
-};
-
-export const checkSDIStatus = async () => {
- const response = await api.get("/event/user/sdistatus");
- return response.data.data;
-};
-
-export const checkWEIStatus = async () => {
- const response = await api.get("/event/user/weistatus");
- return response.data.data;
-};
-
-export const checkFoodStatus = async () => {
- const response = await api.get("/event/user/foodstatus");
- return response.data.data;
-};
-
-export const checkChallengeStatus = async () => {
- const response = await api.get("/event/user/challstatus");
- return response.data.data;
-};
-
-export const attemptShotgun = async (payload: ShotgunAttemptPayload): Promise => {
- const response = await api.post("event/user/shotgunattempt", payload);
- return response.data;
-};
-
-export const getShotgunAttemptsAdmin = async (): Promise => {
- const response = await api.get<{ data: ShotgunAttemptRow[] }>("/event/admin/shotgunattempts");
- return response.data.data;
-};
-
-export const toggleShotgun = async (shotgunOpen: boolean) => {
- const response = await api.post(`event/admin/shotguntoggle`, { shotgunOpen });
- return response.data;
-};
-
-export const togglePreRegistration = async (preRegistrationOpen: boolean) => {
- const response = await api.post(`event/admin/preregistrationtoggle`, { preRegistrationOpen });
- return response.data;
-};
-
-export const toggleSDI = async (sdiOpen: boolean) => {
- const response = await api.post(`event/admin/sditoggle`, { sdiOpen });
- return response.data;
-};
-
-export const toggleWEI = async (weiOpen: boolean) => {
- const response = await api.post(`event/admin/weitoggle`, { weiOpen });
- return response.data;
-};
-
-export const toggleFood = async (foodOpen: boolean) => {
- const response = await api.post(`event/admin/foodtoggle`, { foodOpen });
- return response.data;
-};
-
-export const toggleChallenge = async (challOpen: boolean) => {
- const response = await api.post(`event/admin/challtoggle`, { challOpen });
- return response.data;
-};
diff --git a/frontend/src/services/requests/settings.service.ts b/frontend/src/services/requests/settings.service.ts
new file mode 100644
index 0000000..dea7186
--- /dev/null
+++ b/frontend/src/services/requests/settings.service.ts
@@ -0,0 +1,55 @@
+import {
+ type ApiMessageResponse,
+ type Setting,
+ type ShotgunAttemptPayload,
+ type ShotgunAttemptRow,
+ type ShotgunStatusData,
+} from '../../interfaces/settings.interface';
+import api from '../api';
+
+export const checkShotgunStatus = async (): Promise => {
+ const response = await api.get<{ data: ShotgunStatusData }>('/settings/user/status/shotgun');
+ return response.data.data;
+};
+
+const getSetting = async (key: string): Promise => {
+ const response = await api.get<{ data: Array }>('/settings/user/status');
+ const setting = response.data.data.find((item) => item.key === key);
+ if (!setting) throw new Error(`Le setting ${key} n'est pas disponible.`);
+ return setting;
+};
+
+export const getSettings = async (): Promise => {
+ const response = await api.get<{ data: Setting[] }>('/settings/user/status');
+ return response.data.data;
+};
+
+export const getAdminSettings = async (): Promise => {
+ const response = await api.get<{ data: Setting[] }>('/settings/admin/settings');
+ return response.data.data;
+};
+
+export const updateSetting = async (key: string, open: boolean) => {
+ const response = await api.patch(`/settings/admin/status/${key}`, { open });
+ return response.data;
+};
+
+export const checkPreRegisterStatus = async () => (await getSetting('preRegistration')).open;
+
+export const checkSDIStatus = async () => (await getSetting('sdi')).open;
+
+export const checkWEIStatus = async () => (await getSetting('wei')).open;
+
+export const checkFoodStatus = async () => (await getSetting('food')).open;
+
+export const checkChallengeStatus = async () => (await getSetting('challenge')).open;
+
+export const attemptShotgun = async (payload: ShotgunAttemptPayload): Promise => {
+ const response = await api.post('settings/user/shotgunattempt', payload);
+ return response.data;
+};
+
+export const getShotgunAttemptsAdmin = async (): Promise => {
+ const response = await api.get<{ data: ShotgunAttemptRow[] }>('/settings/admin/shotgunattempts');
+ return response.data.data;
+};
From 73a2f4ff820e714e825f1a6c82b8e13d50be766d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Poncin?=
Date: Thu, 27 Aug 2026 01:03:10 +0200
Subject: [PATCH 03/19] feat: distribute maker battle teams
---
.../controllers/maker_battle.controller.ts | 15 +
backend/src/database/db.ts | 2 +
.../migrations/0028_aberrant_mysterio.sql | 6 +
.../database/migrations/0029_famous_thing.sql | 5 +
.../migrations/0030_yielding_thunderbolts.sql | 2 +
.../migrations/meta/0028_snapshot.json | 1548 ++++++++++++++++
.../migrations/meta/0029_snapshot.json | 1554 ++++++++++++++++
.../migrations/meta/0030_snapshot.json | 1560 +++++++++++++++++
.../database/migrations/meta/_journal.json | 423 ++---
backend/src/dto/battle_maker.dto.ts | 3 +
backend/src/routes/battle_maker.routes.ts | 8 +
.../Relational/makerbattletribution.schema.ts | 14 +
backend/src/services/maker_battle.service.ts | 270 +++
13 files changed, 5209 insertions(+), 201 deletions(-)
create mode 100644 backend/src/controllers/maker_battle.controller.ts
create mode 100644 backend/src/database/migrations/0028_aberrant_mysterio.sql
create mode 100644 backend/src/database/migrations/0029_famous_thing.sql
create mode 100644 backend/src/database/migrations/0030_yielding_thunderbolts.sql
create mode 100644 backend/src/database/migrations/meta/0028_snapshot.json
create mode 100644 backend/src/database/migrations/meta/0029_snapshot.json
create mode 100644 backend/src/database/migrations/meta/0030_snapshot.json
create mode 100644 backend/src/dto/battle_maker.dto.ts
create mode 100644 backend/src/routes/battle_maker.routes.ts
create mode 100644 backend/src/schemas/Relational/makerbattletribution.schema.ts
create mode 100644 backend/src/services/maker_battle.service.ts
diff --git a/backend/src/controllers/maker_battle.controller.ts b/backend/src/controllers/maker_battle.controller.ts
new file mode 100644
index 0000000..e016274
--- /dev/null
+++ b/backend/src/controllers/maker_battle.controller.ts
@@ -0,0 +1,15 @@
+import * as maker_battle_service from '../services/maker_battle.service';
+import type { AppRequestHandler } from '../types/http';
+import { Error } from '../shared/http/responses';
+import type { BattleMakerDTO } from '../dto/battle_maker.dto';
+
+export const distributeGroups: AppRequestHandler = async (req, res) => {
+ const groups = req.body.groups;
+ for (const group of groups) {
+ try {
+ await maker_battle_service.distributeGroups(group);
+ } catch (err) {
+ return Error(res, { msg: 'Erreur lors de la distribution des groupes : ' + err });
+ }
+ }
+};
diff --git a/backend/src/database/db.ts b/backend/src/database/db.ts
index af9e389..1eaeb17 100644
--- a/backend/src/database/db.ts
+++ b/backend/src/database/db.ts
@@ -12,6 +12,7 @@ import * as role from '../schemas/Basic/role.schema';
import * as team from '../schemas/Basic/team.schema';
import * as user from '../schemas/Basic/user.schema';
import * as busattribution from '../schemas/Relational/busattribution.schema';
+import * as MakerBattleAttribution from '../schemas/Relational/makerbattletribution.schema';
import * as challengValidation from '../schemas/Relational/challengevalidation.schema';
import * as registration from '../schemas/Relational/registration.schema';
import * as rolepoints from '../schemas/Relational/rolepoints.schema';
@@ -38,6 +39,7 @@ const schema = {
...userRole,
...challengValidation,
...busattribution,
+ ...MakerBattleAttribution,
...registration,
...tent,
...rolepoints,
diff --git a/backend/src/database/migrations/0028_aberrant_mysterio.sql b/backend/src/database/migrations/0028_aberrant_mysterio.sql
new file mode 100644
index 0000000..7dc6d6b
--- /dev/null
+++ b/backend/src/database/migrations/0028_aberrant_mysterio.sql
@@ -0,0 +1,6 @@
+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/0029_famous_thing.sql b/backend/src/database/migrations/0029_famous_thing.sql
new file mode 100644
index 0000000..c4ee369
--- /dev/null
+++ b/backend/src/database/migrations/0029_famous_thing.sql
@@ -0,0 +1,5 @@
+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
new file mode 100644
index 0000000..4b21aaa
--- /dev/null
+++ b/backend/src/database/migrations/0030_yielding_thunderbolts.sql
@@ -0,0 +1,2 @@
+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/meta/0028_snapshot.json b/backend/src/database/migrations/meta/0028_snapshot.json
new file mode 100644
index 0000000..40f8b69
--- /dev/null
+++ b/backend/src/database/migrations/meta/0028_snapshot.json
@@ -0,0 +1,1548 @@
+{
+ "id": "5651e446-a477-449c-b53b-93f202470fb2",
+ "prevId": "6179fb88-23bd-4656-9980-faa52a9d9b24",
+ "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.defi_tc_attribution": {
+ "name": "defi_tc_attribution",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "team": {
+ "name": "team",
+ "type": "integer",
+ "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",
+ "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/0029_snapshot.json b/backend/src/database/migrations/meta/0029_snapshot.json
new file mode 100644
index 0000000..9975f12
--- /dev/null
+++ b/backend/src/database/migrations/meta/0029_snapshot.json
@@ -0,0 +1,1554 @@
+{
+ "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
new file mode 100644
index 0000000..0267c93
--- /dev/null
+++ b/backend/src/database/migrations/meta/0030_snapshot.json
@@ -0,0 +1,1560 @@
+{
+ "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/_journal.json b/backend/src/database/migrations/meta/_journal.json
index 3424d95..171ed63 100644
--- a/backend/src/database/migrations/meta/_journal.json
+++ b/backend/src/database/migrations/meta/_journal.json
@@ -1,202 +1,223 @@
{
- "version": "7",
- "dialect": "postgresql",
- "entries": [
- {
- "idx": 0,
- "version": "7",
- "when": 1743857362115,
- "tag": "0000_workable_rafael_vega",
- "breakpoints": true
- },
- {
- "idx": 1,
- "version": "7",
- "when": 1743868246465,
- "tag": "0001_stormy_quicksilver",
- "breakpoints": true
- },
- {
- "idx": 2,
- "version": "7",
- "when": 1743897931065,
- "tag": "0002_luxuriant_lockjaw",
- "breakpoints": true
- },
- {
- "idx": 3,
- "version": "7",
- "when": 1743979532382,
- "tag": "0003_material_lorna_dane",
- "breakpoints": true
- },
- {
- "idx": 4,
- "version": "7",
- "when": 1744064732443,
- "tag": "0004_careless_misty_knight",
- "breakpoints": true
- },
- {
- "idx": 5,
- "version": "7",
- "when": 1744118020611,
- "tag": "0005_needy_darwin",
- "breakpoints": true
- },
- {
- "idx": 6,
- "version": "7",
- "when": 1744126517418,
- "tag": "0006_bright_boomerang",
- "breakpoints": true
- },
- {
- "idx": 7,
- "version": "7",
- "when": 1744212319949,
- "tag": "0007_striped_mulholland_black",
- "breakpoints": true
- },
- {
- "idx": 8,
- "version": "7",
- "when": 1744215076184,
- "tag": "0008_striped_bushwacker",
- "breakpoints": true
- },
- {
- "idx": 9,
- "version": "7",
- "when": 1744241202940,
- "tag": "0009_previous_mystique",
- "breakpoints": true
- },
- {
- "idx": 10,
- "version": "7",
- "when": 1744241242502,
- "tag": "0010_fair_mulholland_black",
- "breakpoints": true
- },
- {
- "idx": 11,
- "version": "7",
- "when": 1744241259194,
- "tag": "0011_fearless_nextwave",
- "breakpoints": true
- },
- {
- "idx": 12,
- "version": "7",
- "when": 1746040673007,
- "tag": "0012_productive_giant_man",
- "breakpoints": true
- },
- {
- "idx": 13,
- "version": "7",
- "when": 1752757642698,
- "tag": "0013_curly_angel",
- "breakpoints": true
- },
- {
- "idx": 14,
- "version": "7",
- "when": 1753638076374,
- "tag": "0014_special_reaper",
- "breakpoints": true
- },
- {
- "idx": 15,
- "version": "7",
- "when": 1753744481956,
- "tag": "0015_greedy_genesis",
- "breakpoints": true
- },
- {
- "idx": 16,
- "version": "7",
- "when": 1754903172897,
- "tag": "0016_sudden_ultimatum",
- "breakpoints": true
- },
- {
- "idx": 17,
- "version": "7",
- "when": 1755637642205,
- "tag": "0017_melted_meggan",
- "breakpoints": true
- },
- {
- "idx": 18,
- "version": "7",
- "when": 1755858317109,
- "tag": "0018_puzzling_arachne",
- "breakpoints": true
- },
- {
- "idx": 19,
- "version": "7",
- "when": 1755906116757,
- "tag": "0019_complete_moondragon",
- "breakpoints": true
- },
- {
- "idx": 20,
- "version": "7",
- "when": 1755907709198,
- "tag": "0020_strange_colonel_america",
- "breakpoints": true
- },
- {
- "idx": 21,
- "version": "7",
- "when": 1756063134903,
- "tag": "0021_colossal_madame_web",
- "breakpoints": true
- },
- {
- "idx": 22,
- "version": "7",
- "when": 1757002717384,
- "tag": "0022_light_omega_red",
- "breakpoints": true
- },
- {
- "idx": 23,
- "version": "7",
- "when": 1782943789540,
- "tag": "0023_zippy_colonel_america",
- "breakpoints": true
- },
- {
- "idx": 24,
- "version": "7",
- "when": 1783776285772,
- "tag": "0024_optimal_garia",
- "breakpoints": true
- },
- {
- "idx": 25,
- "version": "7",
- "when": 1784742510283,
- "tag": "0025_perfect_ulik",
- "breakpoints": true
- },
- {
- "idx": 26,
- "version": "7",
- "when": 1784824629918,
- "tag": "0026_swift_excalibur",
- "breakpoints": true
- },
- {
- "idx": 27,
- "version": "7",
- "when": 1785000000000,
- "tag": "0027_faulty_hellion",
- "breakpoints": true
- }
- ]
-}
+ "version": "7",
+ "dialect": "postgresql",
+ "entries": [
+ {
+ "idx": 0,
+ "version": "7",
+ "when": 1743857362115,
+ "tag": "0000_workable_rafael_vega",
+ "breakpoints": true
+ },
+ {
+ "idx": 1,
+ "version": "7",
+ "when": 1743868246465,
+ "tag": "0001_stormy_quicksilver",
+ "breakpoints": true
+ },
+ {
+ "idx": 2,
+ "version": "7",
+ "when": 1743897931065,
+ "tag": "0002_luxuriant_lockjaw",
+ "breakpoints": true
+ },
+ {
+ "idx": 3,
+ "version": "7",
+ "when": 1743979532382,
+ "tag": "0003_material_lorna_dane",
+ "breakpoints": true
+ },
+ {
+ "idx": 4,
+ "version": "7",
+ "when": 1744064732443,
+ "tag": "0004_careless_misty_knight",
+ "breakpoints": true
+ },
+ {
+ "idx": 5,
+ "version": "7",
+ "when": 1744118020611,
+ "tag": "0005_needy_darwin",
+ "breakpoints": true
+ },
+ {
+ "idx": 6,
+ "version": "7",
+ "when": 1744126517418,
+ "tag": "0006_bright_boomerang",
+ "breakpoints": true
+ },
+ {
+ "idx": 7,
+ "version": "7",
+ "when": 1744212319949,
+ "tag": "0007_striped_mulholland_black",
+ "breakpoints": true
+ },
+ {
+ "idx": 8,
+ "version": "7",
+ "when": 1744215076184,
+ "tag": "0008_striped_bushwacker",
+ "breakpoints": true
+ },
+ {
+ "idx": 9,
+ "version": "7",
+ "when": 1744241202940,
+ "tag": "0009_previous_mystique",
+ "breakpoints": true
+ },
+ {
+ "idx": 10,
+ "version": "7",
+ "when": 1744241242502,
+ "tag": "0010_fair_mulholland_black",
+ "breakpoints": true
+ },
+ {
+ "idx": 11,
+ "version": "7",
+ "when": 1744241259194,
+ "tag": "0011_fearless_nextwave",
+ "breakpoints": true
+ },
+ {
+ "idx": 12,
+ "version": "7",
+ "when": 1746040673007,
+ "tag": "0012_productive_giant_man",
+ "breakpoints": true
+ },
+ {
+ "idx": 13,
+ "version": "7",
+ "when": 1752757642698,
+ "tag": "0013_curly_angel",
+ "breakpoints": true
+ },
+ {
+ "idx": 14,
+ "version": "7",
+ "when": 1753638076374,
+ "tag": "0014_special_reaper",
+ "breakpoints": true
+ },
+ {
+ "idx": 15,
+ "version": "7",
+ "when": 1753744481956,
+ "tag": "0015_greedy_genesis",
+ "breakpoints": true
+ },
+ {
+ "idx": 16,
+ "version": "7",
+ "when": 1754903172897,
+ "tag": "0016_sudden_ultimatum",
+ "breakpoints": true
+ },
+ {
+ "idx": 17,
+ "version": "7",
+ "when": 1755637642205,
+ "tag": "0017_melted_meggan",
+ "breakpoints": true
+ },
+ {
+ "idx": 18,
+ "version": "7",
+ "when": 1755858317109,
+ "tag": "0018_puzzling_arachne",
+ "breakpoints": true
+ },
+ {
+ "idx": 19,
+ "version": "7",
+ "when": 1755906116757,
+ "tag": "0019_complete_moondragon",
+ "breakpoints": true
+ },
+ {
+ "idx": 20,
+ "version": "7",
+ "when": 1755907709198,
+ "tag": "0020_strange_colonel_america",
+ "breakpoints": true
+ },
+ {
+ "idx": 21,
+ "version": "7",
+ "when": 1756063134903,
+ "tag": "0021_colossal_madame_web",
+ "breakpoints": true
+ },
+ {
+ "idx": 22,
+ "version": "7",
+ "when": 1757002717384,
+ "tag": "0022_light_omega_red",
+ "breakpoints": true
+ },
+ {
+ "idx": 23,
+ "version": "7",
+ "when": 1782943789540,
+ "tag": "0023_zippy_colonel_america",
+ "breakpoints": true
+ },
+ {
+ "idx": 24,
+ "version": "7",
+ "when": 1783776285772,
+ "tag": "0024_optimal_garia",
+ "breakpoints": true
+ },
+ {
+ "idx": 25,
+ "version": "7",
+ "when": 1784742510283,
+ "tag": "0025_perfect_ulik",
+ "breakpoints": true
+ },
+ {
+ "idx": 26,
+ "version": "7",
+ "when": 1784824629918,
+ "tag": "0026_swift_excalibur",
+ "breakpoints": true
+ },
+ {
+ "idx": 27,
+ "version": "7",
+ "when": 1785000000000,
+ "tag": "0027_faulty_hellion",
+ "breakpoints": true
+ },
+ {
+ "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
+ }
+ ]
+}
\ No newline at end of file
diff --git a/backend/src/dto/battle_maker.dto.ts b/backend/src/dto/battle_maker.dto.ts
new file mode 100644
index 0000000..a66483f
--- /dev/null
+++ b/backend/src/dto/battle_maker.dto.ts
@@ -0,0 +1,3 @@
+export interface BattleMakerDTO {
+ groups: string[];
+}
diff --git a/backend/src/routes/battle_maker.routes.ts b/backend/src/routes/battle_maker.routes.ts
new file mode 100644
index 0000000..28cedb6
--- /dev/null
+++ b/backend/src/routes/battle_maker.routes.ts
@@ -0,0 +1,8 @@
+import { Router } from 'express';
+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);
+
+export default makerBattleRouter;
diff --git a/backend/src/schemas/Relational/makerbattletribution.schema.ts b/backend/src/schemas/Relational/makerbattletribution.schema.ts
new file mode 100644
index 0000000..e7a6782
--- /dev/null
+++ b/backend/src/schemas/Relational/makerbattletribution.schema.ts
@@ -0,0 +1,14 @@
+import { integer, pgTable, text } from 'drizzle-orm/pg-core';
+import { userSchema } from '../Basic/user.schema';
+
+export const MakerBattleAttributionSchema = pgTable('maker_battle_attribution', {
+ user_id: integer('user_id')
+ .primaryKey()
+ .notNull()
+ .references(() => userSchema.id),
+ maker_team_id: integer('maker_team_id').notNull(),
+ table: text('table').notNull(),
+ group: text('group').notNull(),
+});
+
+export type MakerBattleAttributionSchema = typeof MakerBattleAttributionSchema.$inferInsert;
diff --git a/backend/src/services/maker_battle.service.ts b/backend/src/services/maker_battle.service.ts
new file mode 100644
index 0000000..43756df
--- /dev/null
+++ b/backend/src/services/maker_battle.service.ts
@@ -0,0 +1,270 @@
+import { and, eq, inArray, not, or, sql } from 'drizzle-orm';
+import { db } from '../database/db';
+import { userSchema } from '../schemas/Basic/user.schema';
+import { userTeamsSchema } from '../schemas/Relational/userteams.schema';
+import { teamSchema } from '../schemas/Basic/team.schema';
+import { teamFactionSchema } from '../schemas/Relational/teamfaction.schema';
+import { MakerBattleAttributionSchema } from '../schemas/Relational/makerbattletribution.schema';
+
+export interface UserWithTeamFaction {
+ user_id: number;
+ group: string;
+ team_id: number;
+ faction_id: number;
+}
+
+export interface TeamsWithGroup {
+ maker_team_id: number;
+ group: string;
+}
+
+const TEAM_SIZE = 6;
+const MAX_PLACEMENT_ATTEMPTS = 20;
+
+export const distributeGroups = async (group: string): Promise => {
+ let usersWithTeamsFactions = [];
+ if (group === 'tc') {
+ usersWithTeamsFactions = await db
+ .select({
+ user_id: userSchema.id,
+ team_id: userTeamsSchema.team_id,
+ faction_id: teamFactionSchema.faction_id,
+ })
+ .from(userSchema)
+ .innerJoin(userTeamsSchema, eq(userSchema.id, userTeamsSchema.user_id))
+ .innerJoin(teamSchema, eq(userTeamsSchema.team_id, teamSchema.id))
+ .innerJoin(teamFactionSchema, eq(teamSchema.id, teamFactionSchema.team_id))
+ .where(
+ and(
+ eq(userSchema.permission, 'Nouveau'),
+ or(eq(userSchema.branch, 'TC'), eq(userSchema.branch, 'IA_BACH')),
+ ),
+ );
+ usersWithTeamsFactions = usersWithTeamsFactions.map((user) => ({ ...user, group: 'tc' }));
+ } else if (group === 'ri') {
+ usersWithTeamsFactions = await db
+ .select({
+ user_id: userSchema.id,
+ team_id: userTeamsSchema.team_id,
+ faction_id: teamFactionSchema.faction_id,
+ })
+ .from(userSchema)
+ .innerJoin(userTeamsSchema, eq(userSchema.id, userTeamsSchema.user_id))
+ .innerJoin(teamSchema, eq(userTeamsSchema.team_id, teamSchema.id))
+ .innerJoin(teamFactionSchema, eq(teamSchema.id, teamFactionSchema.team_id))
+ .where(and(eq(userSchema.permission, 'Nouveau'), eq(userSchema.branch, 'RI')));
+ usersWithTeamsFactions = usersWithTeamsFactions.map((user) => ({ ...user, group: 'ri' }));
+ } else if (group === 'branch') {
+ usersWithTeamsFactions = await db
+ .select({
+ user_id: userSchema.id,
+ team_id: userTeamsSchema.team_id,
+ faction_id: teamFactionSchema.faction_id,
+ })
+ .from(userSchema)
+ .innerJoin(userTeamsSchema, eq(userSchema.id, userTeamsSchema.user_id))
+ .innerJoin(teamSchema, eq(userTeamsSchema.team_id, teamSchema.id))
+ .innerJoin(teamFactionSchema, eq(teamSchema.id, teamFactionSchema.team_id))
+ .where(
+ and(
+ eq(userSchema.permission, 'Nouveau'),
+ not(or(eq(userSchema.branch, 'RI'), eq(userSchema.branch, 'TC'), eq(userSchema.branch, 'IA_BACH'))),
+ ),
+ );
+ usersWithTeamsFactions = usersWithTeamsFactions.map((user) => ({ ...user, group: 'branch' }));
+ }
+
+ const usersByFaction = new Map();
+ for (const user of usersWithTeamsFactions) {
+ if (!usersByFaction.has(user.faction_id)) {
+ usersByFaction.set(user.faction_id, []);
+ }
+ usersByFaction.get(user.faction_id)!.push(user);
+ }
+
+ let numberOfTeams = 0;
+ for (const factionUsers of usersByFaction.values()) {
+ const neededForThisFaction = Math.ceil(factionUsers.length / TEAM_SIZE);
+ if (neededForThisFaction > numberOfTeams) {
+ numberOfTeams = neededForThisFaction;
+ }
+ }
+
+ if (numberOfTeams === 0) return;
+
+ const allTeams: UserWithTeamFaction[][] = [];
+
+ for (const [factionId, factionUsers] of usersByFaction) {
+ const teamsForFaction = generateTeamsWithRetry(
+ factionUsers,
+ numberOfTeams,
+ MAX_PLACEMENT_ATTEMPTS,
+ `faction ${factionId}`,
+ );
+ allTeams.push(...teamsForFaction);
+ }
+
+ const rows: MakerBattleAttributionSchema[] = [];
+ let globalTeamId = 1;
+
+ for (const team of allTeams) {
+ for (const user of team) {
+ rows.push({
+ user_id: user.user_id,
+ maker_team_id: globalTeamId,
+ table: '',
+ group: user.group,
+ });
+ }
+ globalTeamId++;
+ }
+
+ if (rows.length > 0) {
+ await db
+ .insert(MakerBattleAttributionSchema)
+ .values(rows)
+ .onConflictDoUpdate({
+ target: MakerBattleAttributionSchema.user_id,
+ set: {
+ maker_team_id: sql`excluded.maker_team_id`,
+ table: sql`excluded.table`,
+ },
+ });
+ }
+
+ return;
+};
+
+const generateTeamsWithRetry = (
+ users: UserWithTeamFaction[],
+ numberOfTeams: number,
+ maxAttempts = MAX_PLACEMENT_ATTEMPTS,
+ label = 'faction',
+): UserWithTeamFaction[][] => {
+ let lastError: unknown;
+
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
+ try {
+ return generateTeams(users, numberOfTeams);
+ } catch (err) {
+ lastError = err;
+ }
+ }
+
+ throw new Error(
+ `Impossible de générer les équipes pour ${label} après ${maxAttempts} tentatives. ` +
+ `Dernière erreur : ${lastError instanceof Error ? lastError.message : String(lastError)}`,
+ );
+};
+
+export const generateTeams = (users: UserWithTeamFaction[], numberOfTeams: number): UserWithTeamFaction[][] => {
+ const numberOfSixTeams = users.length - numberOfTeams * 5;
+
+ const capacities = [...Array(numberOfSixTeams).fill(6), ...Array(numberOfTeams - numberOfSixTeams).fill(5)];
+
+ const shuffle = (array: T[]): T[] => {
+ const result = [...array];
+ for (let i = result.length - 1; i > 0; i--) {
+ const j = Math.floor(Math.random() * (i + 1));
+ [result[i], result[j]] = [result[j], result[i]];
+ }
+ return result;
+ };
+
+ const usersByTeamId = new Map();
+ for (const user of users) {
+ if (!usersByTeamId.has(user.team_id)) {
+ usersByTeamId.set(user.team_id, []);
+ }
+ usersByTeamId.get(user.team_id)!.push(user);
+ }
+
+ const teams: UserWithTeamFaction[][] = Array.from({ length: numberOfTeams }, () => []);
+
+ const teamGroups = shuffle([...usersByTeamId.entries()]).sort(([, a], [, b]) => b.length - a.length);
+
+ for (const [teamId, teamUsers] of teamGroups) {
+ const availableTeams = teams
+ .map((team, index) => ({ index, team, remaining: capacities[index] - team.length }))
+ .filter(({ team, remaining }) => remaining > 0 && !team.some((user) => user.team_id === teamId));
+
+ const selectedTeams = shuffle(availableTeams).slice(0, teamUsers.length);
+
+ for (let i = 0; i < teamUsers.length; i++) {
+ teams[selectedTeams[i].index].push(teamUsers[i]);
+ }
+ }
+
+ return teams;
+};
+
+export const placeTeamsOnTables = async (groups: string[]): Promise => {
+ const [{ maxTable }] = await db
+ .select({
+ maxTable: sql`coalesce(max(nullif(${MakerBattleAttributionSchema.table}, '')::int), 0)`,
+ })
+ .from(MakerBattleAttributionSchema);
+
+ let lastTable = maxTable;
+ const assignments: { maker_team_id: number; table: string }[] = [];
+
+ for (const group of groups) {
+ const teams = await db
+ .selectDistinct({
+ maker_team_id: MakerBattleAttributionSchema.maker_team_id,
+ faction_id: teamFactionSchema.faction_id,
+ })
+ .from(MakerBattleAttributionSchema)
+ .innerJoin(userTeamsSchema, eq(MakerBattleAttributionSchema.user_id, userTeamsSchema.user_id))
+ .innerJoin(teamFactionSchema, eq(userTeamsSchema.team_id, teamFactionSchema.team_id))
+ .where(eq(MakerBattleAttributionSchema.group, group));
+
+ const teamsByFaction = new Map();
+ for (const { maker_team_id, faction_id } of teams) {
+ if (!teamsByFaction.has(faction_id)) {
+ teamsByFaction.set(faction_id, []);
+ }
+ teamsByFaction.get(faction_id)!.push(maker_team_id);
+ }
+
+ const factionGroups = [...teamsByFaction.values()];
+ const maxTeamsInAnyFaction = Math.max(0, ...factionGroups.map((group) => group.length));
+
+ for (let i = 0; i < maxTeamsInAnyFaction; i++) {
+ for (const group of factionGroups) {
+ if (group[i] !== undefined) {
+ lastTable++;
+ assignments.push({ maker_team_id: group[i], table: String(lastTable) });
+ }
+ }
+ }
+ }
+
+ if (assignments.length === 0) return;
+
+ const teamIdCases = sql.join(
+ assignments.map((a) => sql`WHEN ${a.maker_team_id} THEN ${a.table}`),
+ sql` `,
+ );
+
+ await db
+ .update(MakerBattleAttributionSchema)
+ .set({ table: sql`CASE ${MakerBattleAttributionSchema.maker_team_id} ${teamIdCases} END` })
+ .where(
+ inArray(
+ MakerBattleAttributionSchema.maker_team_id,
+ assignments.map((a) => a.maker_team_id),
+ ),
+ );
+};
+
+export const getTableByUserId = async (userId: number): Promise => {
+ const result = await db
+ .select({
+ table: MakerBattleAttributionSchema.table,
+ })
+ .from(MakerBattleAttributionSchema)
+ .where(eq(MakerBattleAttributionSchema.user_id, userId));
+
+ return result.length > 0 ? result[0].table : null;
+};
From aeef3da709f342f8a63799e19e185183c9912389 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Poncin?=
Date: Thu, 27 Aug 2026 02:47:17 +0200
Subject: [PATCH 04/19] =?UTF-8?q?feat:=20api=20route=20for=20generating=20?=
=?UTF-8?q?maker=20battle=20team=20(ca=20march=C3=A9=20mais=20ca=20marche?=
=?UTF-8?q?=20plus=20on=20verra=20demain)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
backend/server.ts | 2 +
.../controllers/maker_battle.controller.ts | 17 +-
backend/src/database/db.ts | 2 -
.../migrations/0031_volatile_slapstick.sql | 1 +
.../migrations/0032_groovy_mother_askani.sql | 8 +
.../database/migrations/0033_lazy_salo.sql | 1 +
.../0034_fantastic_silver_centurion.sql | 1 +
.../migrations/0035_true_ultragirl.sql | 8 +
.../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 +++++++++++++++++
.../database/migrations/meta/_journal.json | 35 +
backend/src/dto/maker_battle.dto.ts | 3 +
...maker.routes.ts => maker_battle.routes.ts} | 3 +-
backend/src/services/maker_battle.service.ts | 97 +-
17 files changed, 7843 insertions(+), 33 deletions(-)
create mode 100644 backend/src/database/migrations/0031_volatile_slapstick.sql
create mode 100644 backend/src/database/migrations/0032_groovy_mother_askani.sql
create mode 100644 backend/src/database/migrations/0033_lazy_salo.sql
create mode 100644 backend/src/database/migrations/0034_fantastic_silver_centurion.sql
create mode 100644 backend/src/database/migrations/0035_true_ultragirl.sql
create mode 100644 backend/src/database/migrations/meta/0031_snapshot.json
create mode 100644 backend/src/database/migrations/meta/0032_snapshot.json
create mode 100644 backend/src/database/migrations/meta/0033_snapshot.json
create mode 100644 backend/src/database/migrations/meta/0034_snapshot.json
create mode 100644 backend/src/database/migrations/meta/0035_snapshot.json
create mode 100644 backend/src/dto/maker_battle.dto.ts
rename backend/src/routes/{battle_maker.routes.ts => maker_battle.routes.ts} (52%)
diff --git a/backend/server.ts b/backend/server.ts
index 5f5b6dc..864774a 100644
--- a/backend/server.ts
+++ b/backend/server.ts
@@ -27,6 +27,7 @@ import roleRoutes from './src/routes/role.routes';
import teamRoutes from './src/routes/team.routes';
import tentRoutes from './src/routes/tent.routes';
import userRoutes from './src/routes/user.routes';
+import makerBattleRoutes from './src/routes/maker_battle.routes';
import bannedRoutes from './src/routes/banned.routes';
import { server_port } from './src/shared/secrets/secrets';
import { initQcmvss } from './src/database/initdb/initQcmvss';
@@ -69,6 +70,7 @@ async function startServer() {
app.use('/api/discord', authenticateUser, discordRoutes);
app.use('/api/tent', authenticateUser, tentRoutes);
app.use('/api/bus', authenticateUser, busRoutes);
+ app.use('/api/maker-battle', authenticateUser, makerBattleRoutes);
app.use('/api/uploads/news', express.static(path.join(__dirname, '/uploads/news')));
app.use('/api/uploads/notebooks', express.static(path.join(__dirname, '/uploads/notebooks')));
app.use('/api/uploads/foodmenu', express.static(path.join(__dirname, '/uploads/foodmenu')));
diff --git a/backend/src/controllers/maker_battle.controller.ts b/backend/src/controllers/maker_battle.controller.ts
index e016274..7b36896 100644
--- a/backend/src/controllers/maker_battle.controller.ts
+++ b/backend/src/controllers/maker_battle.controller.ts
@@ -1,15 +1,20 @@
import * as maker_battle_service from '../services/maker_battle.service';
import type { AppRequestHandler } from '../types/http';
import { Error } from '../shared/http/responses';
-import type { BattleMakerDTO } from '../dto/battle_maker.dto';
+import type { MakerBattleDTO } from '../dto/maker_battle.dto';
-export const distributeGroups: AppRequestHandler = async (req, res) => {
+export const distributeGroups: AppRequestHandler = async (req, res) => {
const groups = req.body.groups;
- for (const group of groups) {
- try {
+ if (!groups || !Array.isArray(groups)) {
+ return Error(res, { msg: 'Invalid request: groups must be an array' });
+ }
+
+ try {
+ for (const group of groups) {
await maker_battle_service.distributeGroups(group);
- } catch (err) {
- return Error(res, { msg: 'Erreur lors de la distribution des groupes : ' + err });
}
+ return res.status(200).json({ success: true, message: 'Groups allocated successfully' });
+ } catch (err) {
+ return Error(res, { msg: 'Erreur lors de la distribution des groupes : ' + err });
}
};
diff --git a/backend/src/database/db.ts b/backend/src/database/db.ts
index 1eaeb17..af9e389 100644
--- a/backend/src/database/db.ts
+++ b/backend/src/database/db.ts
@@ -12,7 +12,6 @@ import * as role from '../schemas/Basic/role.schema';
import * as team from '../schemas/Basic/team.schema';
import * as user from '../schemas/Basic/user.schema';
import * as busattribution from '../schemas/Relational/busattribution.schema';
-import * as MakerBattleAttribution from '../schemas/Relational/makerbattletribution.schema';
import * as challengValidation from '../schemas/Relational/challengevalidation.schema';
import * as registration from '../schemas/Relational/registration.schema';
import * as rolepoints from '../schemas/Relational/rolepoints.schema';
@@ -39,7 +38,6 @@ const schema = {
...userRole,
...challengValidation,
...busattribution,
- ...MakerBattleAttribution,
...registration,
...tent,
...rolepoints,
diff --git a/backend/src/database/migrations/0031_volatile_slapstick.sql b/backend/src/database/migrations/0031_volatile_slapstick.sql
new file mode 100644
index 0000000..2d65e80
--- /dev/null
+++ b/backend/src/database/migrations/0031_volatile_slapstick.sql
@@ -0,0 +1 @@
+DROP TABLE "maker_battle_attribution" CASCADE;
\ No newline at end of file
diff --git a/backend/src/database/migrations/0032_groovy_mother_askani.sql b/backend/src/database/migrations/0032_groovy_mother_askani.sql
new file mode 100644
index 0000000..093f6a8
--- /dev/null
+++ b/backend/src/database/migrations/0032_groovy_mother_askani.sql
@@ -0,0 +1,8 @@
+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/0033_lazy_salo.sql b/backend/src/database/migrations/0033_lazy_salo.sql
new file mode 100644
index 0000000..3977012
--- /dev/null
+++ b/backend/src/database/migrations/0033_lazy_salo.sql
@@ -0,0 +1 @@
+-- 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
new file mode 100644
index 0000000..58acc26
--- /dev/null
+++ b/backend/src/database/migrations/0034_fantastic_silver_centurion.sql
@@ -0,0 +1 @@
+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
new file mode 100644
index 0000000..093f6a8
--- /dev/null
+++ b/backend/src/database/migrations/0035_true_ultragirl.sql
@@ -0,0 +1,8 @@
+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/meta/0031_snapshot.json b/backend/src/database/migrations/meta/0031_snapshot.json
new file mode 100644
index 0000000..f355d90
--- /dev/null
+++ b/backend/src/database/migrations/meta/0031_snapshot.json
@@ -0,0 +1,1509 @@
+{
+ "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
new file mode 100644
index 0000000..6064a4c
--- /dev/null
+++ b/backend/src/database/migrations/meta/0032_snapshot.json
@@ -0,0 +1,1560 @@
+{
+ "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
new file mode 100644
index 0000000..19ee071
--- /dev/null
+++ b/backend/src/database/migrations/meta/0033_snapshot.json
@@ -0,0 +1,1560 @@
+{
+ "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
new file mode 100644
index 0000000..cd432ec
--- /dev/null
+++ b/backend/src/database/migrations/meta/0034_snapshot.json
@@ -0,0 +1,1509 @@
+{
+ "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
new file mode 100644
index 0000000..5e5734f
--- /dev/null
+++ b/backend/src/database/migrations/meta/0035_snapshot.json
@@ -0,0 +1,1560 @@
+{
+ "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/_journal.json b/backend/src/database/migrations/meta/_journal.json
index 171ed63..1349d67 100644
--- a/backend/src/database/migrations/meta/_journal.json
+++ b/backend/src/database/migrations/meta/_journal.json
@@ -218,6 +218,41 @@
"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
}
]
}
\ No newline at end of file
diff --git a/backend/src/dto/maker_battle.dto.ts b/backend/src/dto/maker_battle.dto.ts
new file mode 100644
index 0000000..18b70a3
--- /dev/null
+++ b/backend/src/dto/maker_battle.dto.ts
@@ -0,0 +1,3 @@
+export interface MakerBattleDTO {
+ groups: string[];
+}
diff --git a/backend/src/routes/battle_maker.routes.ts b/backend/src/routes/maker_battle.routes.ts
similarity index 52%
rename from backend/src/routes/battle_maker.routes.ts
rename to backend/src/routes/maker_battle.routes.ts
index 28cedb6..e94cf2f 100644
--- a/backend/src/routes/battle_maker.routes.ts
+++ b/backend/src/routes/maker_battle.routes.ts
@@ -1,8 +1,7 @@
import { Router } from 'express';
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.post('/admin/allocate', makerBattleController.distributeGroups);
export default makerBattleRouter;
diff --git a/backend/src/services/maker_battle.service.ts b/backend/src/services/maker_battle.service.ts
index 43756df..2bfc95c 100644
--- a/backend/src/services/maker_battle.service.ts
+++ b/backend/src/services/maker_battle.service.ts
@@ -23,6 +23,7 @@ const MAX_PLACEMENT_ATTEMPTS = 20;
export const distributeGroups = async (group: string): Promise => {
let usersWithTeamsFactions = [];
+
if (group === 'tc') {
usersWithTeamsFactions = await db
.select({
@@ -72,6 +73,12 @@ export const distributeGroups = async (group: string): Promise => {
),
);
usersWithTeamsFactions = usersWithTeamsFactions.map((user) => ({ ...user, group: 'branch' }));
+ } else {
+ throw new Error(`Unknown group: ${group}`);
+ }
+
+ if (usersWithTeamsFactions.length === 0) {
+ return;
}
const usersByFaction = new Map();
@@ -90,17 +97,13 @@ export const distributeGroups = async (group: string): Promise => {
}
}
- if (numberOfTeams === 0) return;
+ if (numberOfTeams === 0) {
+ return;
+ }
const allTeams: UserWithTeamFaction[][] = [];
-
- for (const [factionId, factionUsers] of usersByFaction) {
- const teamsForFaction = generateTeamsWithRetry(
- factionUsers,
- numberOfTeams,
- MAX_PLACEMENT_ATTEMPTS,
- `faction ${factionId}`,
- );
+ for (const [, factionUsers] of usersByFaction) {
+ const teamsForFaction = generateTeamsWithRetry(factionUsers, numberOfTeams, MAX_PLACEMENT_ATTEMPTS);
allTeams.push(...teamsForFaction);
}
@@ -139,27 +142,26 @@ const generateTeamsWithRetry = (
users: UserWithTeamFaction[],
numberOfTeams: number,
maxAttempts = MAX_PLACEMENT_ATTEMPTS,
- label = 'faction',
): UserWithTeamFaction[][] => {
let lastError: unknown;
for (let attempt = 0; attempt < maxAttempts; attempt++) {
try {
- return generateTeams(users, numberOfTeams);
+ const result = generateTeams(users, numberOfTeams);
+ return result;
} catch (err) {
lastError = err;
}
}
throw new Error(
- `Impossible de générer les équipes pour ${label} après ${maxAttempts} tentatives. ` +
+ `Impossible de générer les équipes après ${maxAttempts} tentatives. ` +
`Dernière erreur : ${lastError instanceof Error ? lastError.message : String(lastError)}`,
);
};
export const generateTeams = (users: UserWithTeamFaction[], numberOfTeams: number): UserWithTeamFaction[][] => {
const numberOfSixTeams = users.length - numberOfTeams * 5;
-
const capacities = [...Array(numberOfSixTeams).fill(6), ...Array(numberOfTeams - numberOfSixTeams).fill(5)];
const shuffle = (array: T[]): T[] => {
@@ -179,20 +181,65 @@ export const generateTeams = (users: UserWithTeamFaction[], numberOfTeams: numbe
usersByTeamId.get(user.team_id)!.push(user);
}
- const teams: UserWithTeamFaction[][] = Array.from({ length: numberOfTeams }, () => []);
+ for (const [teamId, members] of usersByTeamId) {
+ usersByTeamId.set(teamId, shuffle(members));
+ }
- const teamGroups = shuffle([...usersByTeamId.entries()]).sort(([, a], [, b]) => b.length - a.length);
+ const teams: UserWithTeamFaction[][] = capacities.map(() => []);
- for (const [teamId, teamUsers] of teamGroups) {
- const availableTeams = teams
- .map((team, index) => ({ index, team, remaining: capacities[index] - team.length }))
- .filter(({ team, remaining }) => remaining > 0 && !team.some((user) => user.team_id === teamId));
+ let placedAllUsers = false;
+ let attemptCount = 0;
+ const maxAttempts = 100;
- const selectedTeams = shuffle(availableTeams).slice(0, teamUsers.length);
+ while (!placedAllUsers && attemptCount < maxAttempts) {
+ attemptCount++;
- for (let i = 0; i < teamUsers.length; i++) {
- teams[selectedTeams[i].index].push(teamUsers[i]);
+ for (let i = 0; i < teams.length; i++) {
+ teams[i] = [];
}
+
+ const allUsers = shuffle([...users]);
+
+ let allPlaced = true;
+ for (const user of allUsers) {
+ let placed = false;
+
+ const shuffledTeamIndices = shuffle([...Array(numberOfTeams).keys()]);
+
+ for (const teamIndex of shuffledTeamIndices) {
+ if (teams[teamIndex].length < capacities[teamIndex]) {
+ const hasSameTeam = teams[teamIndex].some((u) => u.team_id === user.team_id);
+ if (!hasSameTeam) {
+ teams[teamIndex].push(user);
+ placed = true;
+ break;
+ }
+ }
+ }
+
+ if (!placed) {
+ for (const teamIndex of shuffledTeamIndices) {
+ if (teams[teamIndex].length < capacities[teamIndex]) {
+ teams[teamIndex].push(user);
+ placed = true;
+ break;
+ }
+ }
+ }
+
+ if (!placed) {
+ allPlaced = false;
+ break;
+ }
+ }
+
+ if (allPlaced) {
+ placedAllUsers = true;
+ }
+ }
+
+ if (!placedAllUsers) {
+ throw new Error(`Could not place all users after ${maxAttempts} attempts`);
}
return teams;
@@ -240,7 +287,9 @@ export const placeTeamsOnTables = async (groups: string[]): Promise => {
}
}
- if (assignments.length === 0) return;
+ if (assignments.length === 0) {
+ return;
+ }
const teamIdCases = sql.join(
assignments.map((a) => sql`WHEN ${a.maker_team_id} THEN ${a.table}`),
@@ -256,6 +305,8 @@ export const placeTeamsOnTables = async (groups: string[]): Promise => {
assignments.map((a) => a.maker_team_id),
),
);
+
+ return;
};
export const getTableByUserId = async (userId: number): Promise => {
From 509b203143debda5de0bfeb618ccccc205258f7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Poncin?=
Date: Thu, 27 Aug 2026 18:04:04 +0200
Subject: [PATCH 05/19] feat: generate maker battle placement
---
.../controllers/maker_battle.controller.ts | 23 +-
.../migrations/0036_tiresome_madame_hydra.sql | 1 +
.../migrations/0037_sleepy_avengers.sql | 1 +
.../migrations/0038_white_nightshade.sql | 1 +
.../migrations/meta/0036_snapshot.json | 1560 ++++++++++++++++
.../migrations/meta/0037_snapshot.json | 1560 ++++++++++++++++
.../migrations/meta/0038_snapshot.json | 1566 +++++++++++++++++
.../database/migrations/meta/_journal.json | 21 +
backend/src/dto/maker_battle.dto.ts | 5 +-
backend/src/routes/maker_battle.routes.ts | 5 +-
.../Relational/makerbattletribution.schema.ts | 3 +-
backend/src/services/maker_battle.service.ts | 135 +-
.../adminMakerBattleDownload.tsx | 35 +-
.../adminMakerBattleTeamGeneration.tsx | 6 +
.../services/requests/maker_battle.service.ts | 12 +-
15 files changed, 4854 insertions(+), 80 deletions(-)
create mode 100644 backend/src/database/migrations/0036_tiresome_madame_hydra.sql
create mode 100644 backend/src/database/migrations/0037_sleepy_avengers.sql
create mode 100644 backend/src/database/migrations/0038_white_nightshade.sql
create mode 100644 backend/src/database/migrations/meta/0036_snapshot.json
create mode 100644 backend/src/database/migrations/meta/0037_snapshot.json
create mode 100644 backend/src/database/migrations/meta/0038_snapshot.json
diff --git a/backend/src/controllers/maker_battle.controller.ts b/backend/src/controllers/maker_battle.controller.ts
index 7b36896..b46dc28 100644
--- a/backend/src/controllers/maker_battle.controller.ts
+++ b/backend/src/controllers/maker_battle.controller.ts
@@ -1,9 +1,9 @@
import * as maker_battle_service from '../services/maker_battle.service';
import type { AppRequestHandler } from '../types/http';
import { Error } from '../shared/http/responses';
-import type { MakerBattleDTO } from '../dto/maker_battle.dto';
+import type { Group, GroupsList } from '../dto/maker_battle.dto';
-export const distributeGroups: AppRequestHandler = async (req, res) => {
+export const distributeGroups: AppRequestHandler = async (req, res) => {
const groups = req.body.groups;
if (!groups || !Array.isArray(groups)) {
return Error(res, { msg: 'Invalid request: groups must be an array' });
@@ -13,8 +13,27 @@ export const distributeGroups: AppRequestHandler = async (req, r
for (const group of groups) {
await maker_battle_service.distributeGroups(group);
}
+ await maker_battle_service.placeTeamsOnTables(groups);
return res.status(200).json({ success: true, message: 'Groups allocated successfully' });
} catch (err) {
return Error(res, { msg: 'Erreur lors de la distribution des groupes : ' + err });
}
};
+
+export const exportGroups: AppRequestHandler = async (req, res) => {
+ const { group } = req.params;
+ if (!group || typeof group !== 'string') {
+ return Error(res, { msg: 'Invalid request: group must be a string' });
+ }
+
+ try {
+ const exportData = await maker_battle_service.exportGroups(group);
+
+ res.setHeader('Content-Type', 'application/json');
+ res.setHeader('Content-Disposition', `attachment; filename="maker_battle_${group}_${Date.now()}.json"`);
+
+ return res.status(200).json(exportData);
+ } catch (err) {
+ return Error(res, { msg: "Erreur lors de l'exportation des groupes : " + err });
+ }
+};
diff --git a/backend/src/database/migrations/0036_tiresome_madame_hydra.sql b/backend/src/database/migrations/0036_tiresome_madame_hydra.sql
new file mode 100644
index 0000000..112bdbf
--- /dev/null
+++ b/backend/src/database/migrations/0036_tiresome_madame_hydra.sql
@@ -0,0 +1 @@
+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
new file mode 100644
index 0000000..42d9723
--- /dev/null
+++ b/backend/src/database/migrations/0037_sleepy_avengers.sql
@@ -0,0 +1 @@
+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
new file mode 100644
index 0000000..b9f2504
--- /dev/null
+++ b/backend/src/database/migrations/0038_white_nightshade.sql
@@ -0,0 +1 @@
+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/0036_snapshot.json b/backend/src/database/migrations/meta/0036_snapshot.json
new file mode 100644
index 0000000..4ce976d
--- /dev/null
+++ b/backend/src/database/migrations/meta/0036_snapshot.json
@@ -0,0 +1,1560 @@
+{
+ "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
new file mode 100644
index 0000000..a68cfb5
--- /dev/null
+++ b/backend/src/database/migrations/meta/0037_snapshot.json
@@ -0,0 +1,1560 @@
+{
+ "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
new file mode 100644
index 0000000..bbd12e9
--- /dev/null
+++ b/backend/src/database/migrations/meta/0038_snapshot.json
@@ -0,0 +1,1566 @@
+{
+ "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 1349d67..aac9e54 100644
--- a/backend/src/database/migrations/meta/_journal.json
+++ b/backend/src/database/migrations/meta/_journal.json
@@ -253,6 +253,27 @@
"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",
+ "breakpoints": true
}
]
}
\ No newline at end of file
diff --git a/backend/src/dto/maker_battle.dto.ts b/backend/src/dto/maker_battle.dto.ts
index 18b70a3..e8c7b0c 100644
--- a/backend/src/dto/maker_battle.dto.ts
+++ b/backend/src/dto/maker_battle.dto.ts
@@ -1,3 +1,6 @@
-export interface MakerBattleDTO {
+export interface GroupsList {
groups: string[];
}
+export interface Group {
+ group: string;
+}
diff --git a/backend/src/routes/maker_battle.routes.ts b/backend/src/routes/maker_battle.routes.ts
index e94cf2f..656d607 100644
--- a/backend/src/routes/maker_battle.routes.ts
+++ b/backend/src/routes/maker_battle.routes.ts
@@ -1,7 +1,8 @@
import { Router } from 'express';
import * as makerBattleController from '../controllers/maker_battle.controller';
+import { checkRole } from '../middlewares/user.middleware';
const makerBattleRouter = Router();
-makerBattleRouter.post('/admin/allocate', makerBattleController.distributeGroups);
-
+makerBattleRouter.post('/admin/allocate', checkRole('Admin'), makerBattleController.distributeGroups);
+makerBattleRouter.get('/admin/export/:group', checkRole('Admin'), makerBattleController.exportGroups);
export default makerBattleRouter;
diff --git a/backend/src/schemas/Relational/makerbattletribution.schema.ts b/backend/src/schemas/Relational/makerbattletribution.schema.ts
index e7a6782..b898937 100644
--- a/backend/src/schemas/Relational/makerbattletribution.schema.ts
+++ b/backend/src/schemas/Relational/makerbattletribution.schema.ts
@@ -7,7 +7,8 @@ export const MakerBattleAttributionSchema = pgTable('maker_battle_attribution',
.notNull()
.references(() => userSchema.id),
maker_team_id: integer('maker_team_id').notNull(),
- table: text('table').notNull(),
+ faction_id: integer('faction_id').notNull(),
+ table: integer('table'),
group: text('group').notNull(),
});
diff --git a/backend/src/services/maker_battle.service.ts b/backend/src/services/maker_battle.service.ts
index 2bfc95c..789df96 100644
--- a/backend/src/services/maker_battle.service.ts
+++ b/backend/src/services/maker_battle.service.ts
@@ -18,6 +18,11 @@ export interface TeamsWithGroup {
group: string;
}
+export interface MakerBattleExport {
+ maker_team_id: number;
+ table: number;
+}
+
const TEAM_SIZE = 6;
const MAX_PLACEMENT_ATTEMPTS = 20;
@@ -115,7 +120,8 @@ export const distributeGroups = async (group: string): Promise => {
rows.push({
user_id: user.user_id,
maker_team_id: globalTeamId,
- table: '',
+ table: null,
+ faction_id: user.faction_id,
group: user.group,
});
}
@@ -246,72 +252,82 @@ export const generateTeams = (users: UserWithTeamFaction[], numberOfTeams: numbe
};
export const placeTeamsOnTables = async (groups: string[]): Promise => {
- const [{ maxTable }] = await db
- .select({
- maxTable: sql`coalesce(max(nullif(${MakerBattleAttributionSchema.table}, '')::int), 0)`,
+ await db
+ .update(MakerBattleAttributionSchema)
+ .set({ table: null })
+ .where(inArray(MakerBattleAttributionSchema.group, groups));
+
+ const teams = await db
+ .selectDistinct({
+ maker_team_id: MakerBattleAttributionSchema.maker_team_id,
+ group: MakerBattleAttributionSchema.group,
+ faction_id: MakerBattleAttributionSchema.faction_id,
})
- .from(MakerBattleAttributionSchema);
+ .from(MakerBattleAttributionSchema)
+ .where(inArray(MakerBattleAttributionSchema.group, groups));
+ if (teams.length === 0) return;
- let lastTable = maxTable;
- const assignments: { maker_team_id: number; table: string }[] = [];
+ const groupsMap = new Map();
+ for (const t of teams) {
+ if (!groupsMap.has(t.group)) groupsMap.set(t.group, []);
+ groupsMap.get(t.group).push(t);
+ }
- for (const group of groups) {
- const teams = await db
- .selectDistinct({
- maker_team_id: MakerBattleAttributionSchema.maker_team_id,
- faction_id: teamFactionSchema.faction_id,
- })
- .from(MakerBattleAttributionSchema)
- .innerJoin(userTeamsSchema, eq(MakerBattleAttributionSchema.user_id, userTeamsSchema.user_id))
- .innerJoin(teamFactionSchema, eq(userTeamsSchema.team_id, teamFactionSchema.team_id))
- .where(eq(MakerBattleAttributionSchema.group, group));
-
- const teamsByFaction = new Map();
- for (const { maker_team_id, faction_id } of teams) {
- if (!teamsByFaction.has(faction_id)) {
- teamsByFaction.set(faction_id, []);
- }
- teamsByFaction.get(faction_id)!.push(maker_team_id);
- }
+ const groupOrder = ['ri', 'branch', 'tc'];
+ const sortedGroups = groups.sort((a, b) => {
+ return groupOrder.indexOf(a) - groupOrder.indexOf(b);
+ });
- const factionGroups = [...teamsByFaction.values()];
- const maxTeamsInAnyFaction = Math.max(0, ...factionGroups.map((group) => group.length));
+ const assignments = [];
+ let tableNum = 0;
- for (let i = 0; i < maxTeamsInAnyFaction; i++) {
- for (const group of factionGroups) {
- if (group[i] !== undefined) {
- lastTable++;
- assignments.push({ maker_team_id: group[i], table: String(lastTable) });
+ for (const group of sortedGroups) {
+ const groupTeams = groupsMap.get(group) || [];
+ if (groupTeams.length === 0) continue;
+
+ const factions = new Map();
+ for (const t of groupTeams) {
+ if (!factions.has(t.faction_id)) factions.set(t.faction_id, []);
+ factions.get(t.faction_id).push(t);
+ }
+
+ const factionIds = Array.from(factions.keys());
+ const maxLen = Math.max(...Array.from(factions.values()).map((arr) => arr.length));
+
+ for (let i = 0; i < maxLen; i++) {
+ for (const fid of factionIds) {
+ const fTeams = factions.get(fid);
+ if (i < fTeams.length) {
+ tableNum++;
+ assignments.push({
+ maker_team_id: fTeams[i].maker_team_id,
+ group,
+ table: tableNum,
+ });
}
}
}
}
- if (assignments.length === 0) {
- return;
+ for (const assignment of assignments) {
+ await db
+ .update(MakerBattleAttributionSchema)
+ .set({
+ table: assignment.table,
+ })
+ .where(
+ and(
+ eq(MakerBattleAttributionSchema.maker_team_id, assignment.maker_team_id),
+ eq(MakerBattleAttributionSchema.group, assignment.group),
+ ),
+ );
}
-
- const teamIdCases = sql.join(
- assignments.map((a) => sql`WHEN ${a.maker_team_id} THEN ${a.table}`),
- sql` `,
- );
-
- await db
- .update(MakerBattleAttributionSchema)
- .set({ table: sql`CASE ${MakerBattleAttributionSchema.maker_team_id} ${teamIdCases} END` })
- .where(
- inArray(
- MakerBattleAttributionSchema.maker_team_id,
- assignments.map((a) => a.maker_team_id),
- ),
- );
-
- return;
};
-export const getTableByUserId = async (userId: number): Promise => {
+export const getUserTeam = async (userId: number): Promise => {
const result = await db
.select({
+ team_id: MakerBattleAttributionSchema.maker_team_id,
table: MakerBattleAttributionSchema.table,
})
.from(MakerBattleAttributionSchema)
@@ -319,3 +335,18 @@ export const getTableByUserId = async (userId: number): Promise =
return result.length > 0 ? result[0].table : null;
};
+
+export const exportGroups = async (group: string): Promise => {
+ const teams = await db
+ .selectDistinct({
+ user_id: MakerBattleAttributionSchema.user_id,
+ group: MakerBattleAttributionSchema.group,
+ faction_id: MakerBattleAttributionSchema.faction_id,
+ maker_team_id: MakerBattleAttributionSchema.maker_team_id,
+ table: MakerBattleAttributionSchema.table,
+ })
+ .from(MakerBattleAttributionSchema)
+ .where(eq(MakerBattleAttributionSchema.group, group));
+
+ return teams;
+};
diff --git a/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx
index 23e72ea..053a1b8 100644
--- a/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx
+++ b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx
@@ -1,9 +1,10 @@
+// src/components/Admin/MakerBattle/download/AdminMakerBattleTeamDownload.tsx
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 { type MakerBattleGroupTypeOption } from '../../../interfaces/maker_battle.interface';
+import { fetchExportData } from '../../../services/requests/maker_battle.service';
import { Button } from '../../ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '../../ui/card';
@@ -13,6 +14,7 @@ type Props = {
export const AdminMakerBattleTeamDownload = ({ groupTypeOptions }: Props) => {
const [selectedGroupType, setSelectedGroupType] = useState(null);
+ const [isDownloading, setIsDownloading] = useState(false);
const handleDownloadGroup = async () => {
if (!selectedGroupType) {
@@ -24,24 +26,28 @@ export const AdminMakerBattleTeamDownload = ({ groupTypeOptions }: Props) => {
return;
}
- const newTab = window.open('', '_blank');
-
+ setIsDownloading(true);
try {
- const { filename } = await exportGroups(selectedGroupType);
-
- const url = `${import.meta.env.VITE_API_URL}/exports/makerbattlegroups${filename}`;
-
- if (newTab) {
- newTab.location.href = url;
- }
+ const exportData = await fetchExportData(selectedGroupType);
+ const blob = new Blob([JSON.stringify(exportData, null, 2)], { type: 'application/json' });
+ const filename = `maker_battle_${selectedGroupType.value}_${Date.now()}.json`;
+ const url = window.URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = filename;
+ document.body.appendChild(a);
+ a.click();
+ document.body.removeChild(a);
+ window.URL.revokeObjectURL(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.',
});
+ } finally {
+ setIsDownloading(false);
}
};
@@ -64,6 +70,7 @@ export const AdminMakerBattleTeamDownload = ({ groupTypeOptions }: Props) => {
onChange={setSelectedGroupType}
placeholder="Sélectionner un type"
isClearable
+ isDisabled={isDownloading}
/>
@@ -71,8 +78,8 @@ export const AdminMakerBattleTeamDownload = ({ groupTypeOptions }: Props) => {
type="button"
onClick={handleDownloadGroup}
className="bg-green-600 hover:bg-green-700 text-white"
- disabled={!selectedGroupType}>
- Télécharger
+ disabled={!selectedGroupType || isDownloading}>
+ {isDownloading ? 'Téléchargement...' : 'Télécharger'}
diff --git a/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleTeamGeneration.tsx b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleTeamGeneration.tsx
index f3b0175..f9060fe 100644
--- a/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleTeamGeneration.tsx
+++ b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleTeamGeneration.tsx
@@ -26,6 +26,12 @@ export const AdminMakerBattleTeamGeneration = ({ groupTypeOptions }: Props) => {
try {
await allocateGroups(selectedGroupTypes);
+ Swal.fire({
+ icon: 'success',
+ title: 'Répartition réussie',
+ text: 'Les nouveaux ont été répartis par table avec succès.',
+ });
+ setSelectedGroupTypes([]); // Réinitialiser la sélection après la répartition
} catch (error) {
console.error('Erreur lors de la répartition des groupes:', error);
Swal.fire({
diff --git a/frontend/src/services/requests/maker_battle.service.ts b/frontend/src/services/requests/maker_battle.service.ts
index 01f1f9c..23e802c 100644
--- a/frontend/src/services/requests/maker_battle.service.ts
+++ b/frontend/src/services/requests/maker_battle.service.ts
@@ -1,8 +1,4 @@
-import type {
- MakerBattleGroupDownloadResponseData,
- MakerBattleGroupResponseData,
- MakerBattleGroupTypeOption,
-} from '../../interfaces/maker_battle.interface';
+import type { MakerBattleGroupTypeOption } from '../../interfaces/maker_battle.interface';
import api from '../api';
export const allocateGroups = async (groups: MakerBattleGroupTypeOption[]) => {
@@ -10,12 +6,12 @@ export const allocateGroups = async (groups: MakerBattleGroupTypeOption[]) => {
return response.data;
};
-export const exportGroups = async (group: MakerBattleGroupTypeOption) => {
+export const fetchExportData = async (group: MakerBattleGroupTypeOption) => {
const response = await api.get(`/maker-battle/admin/export/${group.value}`);
- return response.data as MakerBattleGroupDownloadResponseData;
+ return response.data;
};
export const getUserGroup = async () => {
const response = await api.get(`/maker-battle/group/me`);
- return response.data as MakerBattleGroupResponseData;
+ return response.data;
};
From e5cdc757313d6023ceb46121af3937c254dc2e29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Poncin?=
Date: Thu, 27 Aug 2026 20:29:36 +0200
Subject: [PATCH 06/19] feat: getme route
---
.../controllers/maker_battle.controller.ts | 18 ++++++++
backend/src/routes/maker_battle.routes.ts | 2 +
backend/src/services/maker_battle.service.ts | 5 +-
.../adminMakerBattleDownload.tsx | 46 +++++++++++++++----
4 files changed, 61 insertions(+), 10 deletions(-)
diff --git a/backend/src/controllers/maker_battle.controller.ts b/backend/src/controllers/maker_battle.controller.ts
index b46dc28..71a43b1 100644
--- a/backend/src/controllers/maker_battle.controller.ts
+++ b/backend/src/controllers/maker_battle.controller.ts
@@ -37,3 +37,21 @@ export const exportGroups: AppRequestHandler = async (req, res) => {
return Error(res, { msg: "Erreur lors de l'exportation des groupes : " + err });
}
};
+
+export const getCurrentUser: AppRequestHandler = async (req, res) => {
+ try {
+ const userId = req.user.userId;
+ if (!userId) {
+ return Error(res, { msg: 'User not authenticated' });
+ }
+
+ const userGroup = await maker_battle_service.getUserTeam(userId);
+ if (!userGroup) {
+ return Error(res, { msg: 'User does not belong to any group' });
+ }
+
+ return res.status(200).json({ group: userGroup });
+ } catch (err) {
+ return Error(res, { msg: "Erreur lors de la récupération du groupe de l'utilisateur : " + err });
+ }
+};
diff --git a/backend/src/routes/maker_battle.routes.ts b/backend/src/routes/maker_battle.routes.ts
index 656d607..ea0dd0f 100644
--- a/backend/src/routes/maker_battle.routes.ts
+++ b/backend/src/routes/maker_battle.routes.ts
@@ -5,4 +5,6 @@ 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.get('/group/me', makerBattleController.getCurrentUser);
export default makerBattleRouter;
diff --git a/backend/src/services/maker_battle.service.ts b/backend/src/services/maker_battle.service.ts
index 789df96..0a65ce8 100644
--- a/backend/src/services/maker_battle.service.ts
+++ b/backend/src/services/maker_battle.service.ts
@@ -301,6 +301,7 @@ export const placeTeamsOnTables = async (groups: string[]): Promise => {
tableNum++;
assignments.push({
maker_team_id: fTeams[i].maker_team_id,
+ faction_id: fTeams[i].faction_id,
group,
table: tableNum,
});
@@ -324,7 +325,7 @@ export const placeTeamsOnTables = async (groups: string[]): Promise => {
}
};
-export const getUserTeam = async (userId: number): Promise => {
+export const getUserTeam = async (userId: number): Promise<{ team_id: number; table: number } | undefined> => {
const result = await db
.select({
team_id: MakerBattleAttributionSchema.maker_team_id,
@@ -333,7 +334,7 @@ export const getUserTeam = async (userId: number): Promise => {
.from(MakerBattleAttributionSchema)
.where(eq(MakerBattleAttributionSchema.user_id, userId));
- return result.length > 0 ? result[0].table : null;
+ return result[0];
};
export const exportGroups = async (group: string): Promise => {
diff --git a/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx
index 053a1b8..43645ef 100644
--- a/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx
+++ b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx
@@ -29,15 +29,45 @@ export const AdminMakerBattleTeamDownload = ({ groupTypeOptions }: Props) => {
setIsDownloading(true);
try {
const exportData = await fetchExportData(selectedGroupType);
- const blob = new Blob([JSON.stringify(exportData, null, 2)], { type: 'application/json' });
- const filename = `maker_battle_${selectedGroupType.value}_${Date.now()}.json`;
+ const headers = Object.keys(exportData[0] || {});
+
+ const csvRows = [
+ headers.join(','),
+ ...exportData.map((row: { [x: string]: unknown }) =>
+ headers
+ .map((header) => {
+ const value = row[header];
+ if (value === null || value === undefined) return '';
+ const stringValue = String(value);
+ if (/[",\n\r]/.test(stringValue)) {
+ return `"${stringValue.replace(/"/g, '""')}"`;
+ }
+
+ return stringValue;
+ })
+ .join(','),
+ ),
+ ];
+
+ const csv = csvRows.join('\n');
+
+ // Créer le fichier CSV
+ const blob = new Blob([csv], {
+ type: 'text/csv;charset=utf-8;',
+ });
+
+ // Créer un lien de téléchargement
const url = window.URL.createObjectURL(blob);
- const a = document.createElement('a');
- a.href = url;
- a.download = filename;
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
+ const link = document.createElement('a');
+
+ link.href = url;
+ link.download = `maker_battle_${selectedGroupType.value}_${Date.now()}.csv`;
+
+ document.body.appendChild(link);
+ link.click();
+
+ // Nettoyer
+ document.body.removeChild(link);
window.URL.revokeObjectURL(url);
} catch (error) {
console.error('Erreur lors du téléchargement des groupes:', error);
From 48009a07c44a6fdbe45831c51b56f6da39a6cdd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Poncin?=
Date: Fri, 28 Aug 2026 22:44:48 +0200
Subject: [PATCH 07/19] feat: maker battle table and team in adminusers
---
.../src/controllers/maker_battle.controller.ts | 12 +++++++-----
backend/src/services/user.service.ts | 6 +++++-
frontend/src/components/Admin/adminUser.tsx | 16 ++++++++++++++--
frontend/src/interfaces/user.interface.ts | 5 +++++
4 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/backend/src/controllers/maker_battle.controller.ts b/backend/src/controllers/maker_battle.controller.ts
index 71a43b1..396bdcf 100644
--- a/backend/src/controllers/maker_battle.controller.ts
+++ b/backend/src/controllers/maker_battle.controller.ts
@@ -41,17 +41,19 @@ export const exportGroups: AppRequestHandler = async (req, res) => {
export const getCurrentUser: AppRequestHandler = async (req, res) => {
try {
const userId = req.user.userId;
+
if (!userId) {
return Error(res, { msg: 'User not authenticated' });
}
const userGroup = await maker_battle_service.getUserTeam(userId);
- if (!userGroup) {
- return Error(res, { msg: 'User does not belong to any group' });
- }
- return res.status(200).json({ group: userGroup });
+ return res.status(200).json({
+ group: userGroup ?? null,
+ });
} catch (err) {
- return Error(res, { msg: "Erreur lors de la récupération du groupe de l'utilisateur : " + err });
+ return Error(res, {
+ msg: "Erreur lors de la récupération du groupe de l'utilisateur : " + err,
+ });
}
};
diff --git a/backend/src/services/user.service.ts b/backend/src/services/user.service.ts
index 6737f05..a9c7a84 100644
--- a/backend/src/services/user.service.ts
+++ b/backend/src/services/user.service.ts
@@ -18,6 +18,7 @@ import { userInformationSchema } from '../schemas/Relational/userinformation.sch
import { addUserToRespondentStudentsList } from '../shared/integrations/billetweb';
import { generateEmailHtml, sendEmail } from './email.service';
import { email_from } from '../shared/secrets/secrets';
+import { MakerBattleAttributionSchema } from '../schemas/Relational/makerbattletribution.schema';
// Fonction pour récupérer un utilisateur par email
export const getUserByEmail = async (email: string) => {
@@ -206,8 +207,11 @@ export const getUsersAdmin = async () => {
contact: userSchema.contact,
permission: userSchema.permission,
discord_id: userSchema.discord_id,
+ maker_battle_table: MakerBattleAttributionSchema.table,
+ maker_battle_team: MakerBattleAttributionSchema.maker_team_id,
})
- .from(userSchema);
+ .from(userSchema)
+ .innerJoin(MakerBattleAttributionSchema, eq(userSchema.id, MakerBattleAttributionSchema.user_id));
return users;
} catch (err) {
console.error('Erreur lors de la récupération des utilisateurs ', err);
diff --git a/frontend/src/components/Admin/adminUser.tsx b/frontend/src/components/Admin/adminUser.tsx
index 1bbf1fd..d273c65 100644
--- a/frontend/src/components/Admin/adminUser.tsx
+++ b/frontend/src/components/Admin/adminUser.tsx
@@ -3,7 +3,7 @@ import Select from 'react-select';
import { type SingleValue } from 'react-select';
import Swal from 'sweetalert2';
-import type { User, UserContactInformation } from '../../interfaces/user.interface';
+import type { User, UserContactInformation, UserWithMakerBattle } from '../../interfaces/user.interface';
import { renewTokenUser, requestPasswordUser } from '../../services/requests/auth.service';
import {
createUserByAdmin,
@@ -53,7 +53,7 @@ type MajorOption = (typeof majeurOptions)[number];
export const AdminUser = () => {
const [users, setUsers] = useState([]);
const [selectedUser, setSelectedUser] = useState(null);
- const [formData, setFormData] = useState>({});
+ const [formData, setFormData] = useState>({});
const [contactInformation, setContactInformation] = useState>({});
useEffect(() => {
@@ -243,6 +243,18 @@ export const AdminUser = () => {
onChange={handleSelectChange('permission')}
isClearable
/>
+
+
Date: Fri, 28 Aug 2026 22:48:42 +0200
Subject: [PATCH 08/19] fix: faction_id not in db when generating teams for
more than 1 group
---
backend/src/services/maker_battle.service.ts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/backend/src/services/maker_battle.service.ts b/backend/src/services/maker_battle.service.ts
index 0a65ce8..36de93b 100644
--- a/backend/src/services/maker_battle.service.ts
+++ b/backend/src/services/maker_battle.service.ts
@@ -137,6 +137,8 @@ export const distributeGroups = async (group: string): Promise => {
set: {
maker_team_id: sql`excluded.maker_team_id`,
table: sql`excluded.table`,
+ faction_id: sql`excluded.faction_id`,
+ group: sql`excluded.group`,
},
});
}
From 914142709a5c853a984878c8757891f790784b0c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Poncin?=
Date: Sat, 29 Aug 2026 16:55:52 +0200
Subject: [PATCH 09/19] feat: json to csv utils + refactor bus and team members
export
---
.../src/controllers/im_export.controller.ts | 22 +++--
backend/src/routes/im_export.routes.ts | 4 +-
backend/src/services/im_export.service.ts | 75 ++++++---------
.../adminMakerBattleDownload.tsx | 46 ++--------
.../components/Admin/adminExportImport.tsx | 91 ++++++++++---------
frontend/src/utils/utils.ts | 50 ++++++++++
6 files changed, 145 insertions(+), 143 deletions(-)
diff --git a/backend/src/controllers/im_export.controller.ts b/backend/src/controllers/im_export.controller.ts
index 668c40f..23e0ed4 100644
--- a/backend/src/controllers/im_export.controller.ts
+++ b/backend/src/controllers/im_export.controller.ts
@@ -162,23 +162,29 @@ export const updatePlannings: AppRequestHandler = async (_req, res) => {
}
};
-export const exportUsersCSV: AppRequestHandler = async (_req, res) => {
+export const exportBus: AppRequestHandler = async (_req, res) => {
try {
- await export_service.exportUsersToCSV();
- Ok(res, { msg: 'CSV des bus généré' });
+ const exportData = await export_service.exportBus();
+ res.setHeader('Content-Type', 'application/json');
+ res.setHeader('Content-Disposition', `attachment; filename="bus_${Date.now()}.json"`);
+
+ return res.status(200).json(exportData);
} catch (error) {
console.error(error);
- Error(res, { msg: "Erreur lors de l'export CSV" });
+ return Error(res, { msg: "Erreur lors de l'exportation des memsbres des équipes : " + error });
}
};
-export const exportTeamMembersCSV: AppRequestHandler = async (_req, res) => {
+export const exportTeamMembers: AppRequestHandler = async (_req, res) => {
try {
- await export_service.exportTeamMembersToCSV();
- Ok(res, { msg: "CSV des membres de l'équipe généré" });
+ const exportData = await export_service.exportTeamMembers();
+ res.setHeader('Content-Type', 'application/json');
+ res.setHeader('Content-Disposition', `attachment; filename="team_members_${Date.now()}.json"`);
+
+ return res.status(200).json(exportData);
} catch (error) {
console.error(error);
- Error(res, { msg: "Erreur lors de l'export CSV" });
+ return Error(res, { msg: "Erreur lors de l'exportation des memsbres des équipes : " + error });
}
};
export const getUploadedDocumentStatus: AppRequestHandler = async (
diff --git a/backend/src/routes/im_export.routes.ts b/backend/src/routes/im_export.routes.ts
index 7dbb04a..71cfeec 100644
--- a/backend/src/routes/im_export.routes.ts
+++ b/backend/src/routes/im_export.routes.ts
@@ -15,8 +15,8 @@ imexportRouter.post(
);
imexportRouter.post('/admin/exportgsheet', checkRole('Admin', []), imexportController.exportAllDataToSheets);
-imexportRouter.get('/admin/exportbus', checkRole('Admin', []), imexportController.exportUsersCSV);
-imexportRouter.get('/admin/exportteammembers', checkRole('Admin', []), imexportController.exportTeamMembersCSV);
+imexportRouter.get('/admin/exportbus', checkRole('Admin', []), imexportController.exportBus);
+imexportRouter.get('/admin/exportteammembers', checkRole('Admin', []), imexportController.exportTeamMembers);
imexportRouter.get(
'/admin/document/:category/:item',
checkRole('Admin', []),
diff --git a/backend/src/services/im_export.service.ts b/backend/src/services/im_export.service.ts
index 8f46705..5a99f42 100644
--- a/backend/src/services/im_export.service.ts
+++ b/backend/src/services/im_export.service.ts
@@ -1,10 +1,29 @@
-import { existsSync, mkdirSync, writeFileSync } from 'fs';
import { google } from 'googleapis';
-import { parse } from 'json2csv';
import * as user_service from './user.service';
import path from 'path';
+export interface teamMemberUser {
+ prenom: string;
+ nom: string;
+ ce: boolean;
+ equipe: string | null;
+}
+
+export interface busUser {
+ id: number;
+ prenom: string;
+ nom: string;
+ mail: string;
+ telephone: string;
+ nouveau: boolean;
+ ce: boolean;
+ num_equipe: number | null;
+ benevole: boolean;
+ orga: boolean;
+ majeur: boolean;
+}
+
const keyFilePath = path.resolve(__dirname, '../utils/google_credentials.json');
// Crée une instance JWT en utilisant la clé du service account
@@ -36,7 +55,7 @@ export const writeToGoogleSheet = async (spreadsheetId: string, range: string, v
}
};
-export const exportUsersToCSV = async (): Promise => {
+export const exportBus = async (): Promise => {
const users = await user_service.getUsersAll();
const formattedUsers = users.map((u) => {
@@ -59,39 +78,13 @@ export const exportUsersToCSV = async (): Promise => {
};
});
- const csv = parse(formattedUsers, {
- fields: [
- 'id',
- 'prenom',
- 'nom',
- 'mail',
- 'telephone',
- 'nouveau',
- 'ce',
- 'num_equipe',
- 'benevole',
- 'orga',
- 'majeur',
- 'bus_manual',
- ],
- });
-
- const exportDir = path.join(__dirname, '../../exports/bus');
- const filePath = path.join(exportDir, 'bus.csv');
-
- if (!existsSync(exportDir)) {
- mkdirSync(exportDir, { recursive: true });
- }
-
- writeFileSync(filePath, csv);
-
- return filePath;
+ return formattedUsers;
};
-export const exportTeamMembersToCSV = async (): Promise => {
- const users = await user_service.getUsersAll();
+export const exportTeamMembers = async (): Promise => {
+ const usersInTeams = (await user_service.getUsersAll()).filter((u) => u.teamId !== null);
- const formattedUsers = users.map((u) => {
+ const formattedUsers = usersInTeams.map((u) => {
const isCE = u.permission === 'Student' && u.teamId !== null;
return {
prenom: u.first_name ?? '',
@@ -101,19 +94,5 @@ export const exportTeamMembersToCSV = async (): Promise => {
};
});
- const csv = parse(formattedUsers, {
- fields: ['prenom', 'nom', 'ce', 'equipe'],
- });
-
- const exportDir = path.join(__dirname, '../../exports/teammembers');
- const filePath = path.join(exportDir, 'teammembers.csv');
- console.log('Exporting team members to:', filePath);
-
- if (!existsSync(exportDir)) {
- mkdirSync(exportDir, { recursive: true });
- }
-
- writeFileSync(filePath, csv);
-
- return filePath;
+ return formattedUsers;
};
diff --git a/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx
index 43645ef..94204fa 100644
--- a/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx
+++ b/frontend/src/components/Admin/AdminMakerBattle/adminMakerBattleDownload.tsx
@@ -1,10 +1,10 @@
-// src/components/Admin/MakerBattle/download/AdminMakerBattleTeamDownload.tsx
import { useState } from 'react';
import Select from 'react-select';
import Swal from 'sweetalert2';
import { type MakerBattleGroupTypeOption } from '../../../interfaces/maker_battle.interface';
import { fetchExportData } from '../../../services/requests/maker_battle.service';
+import { downloadJsonAsCsv } from '../../../utils/utils';
import { Button } from '../../ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '../../ui/card';
@@ -14,6 +14,7 @@ type Props = {
export const AdminMakerBattleTeamDownload = ({ groupTypeOptions }: Props) => {
const [selectedGroupType, setSelectedGroupType] = useState(null);
+
const [isDownloading, setIsDownloading] = useState(false);
const handleDownloadGroup = async () => {
@@ -27,50 +28,14 @@ export const AdminMakerBattleTeamDownload = ({ groupTypeOptions }: Props) => {
}
setIsDownloading(true);
+
try {
const exportData = await fetchExportData(selectedGroupType);
- const headers = Object.keys(exportData[0] || {});
-
- const csvRows = [
- headers.join(','),
- ...exportData.map((row: { [x: string]: unknown }) =>
- headers
- .map((header) => {
- const value = row[header];
- if (value === null || value === undefined) return '';
- const stringValue = String(value);
- if (/[",\n\r]/.test(stringValue)) {
- return `"${stringValue.replace(/"/g, '""')}"`;
- }
-
- return stringValue;
- })
- .join(','),
- ),
- ];
-
- const csv = csvRows.join('\n');
-
- // Créer le fichier CSV
- const blob = new Blob([csv], {
- type: 'text/csv;charset=utf-8;',
- });
-
- // Créer un lien de téléchargement
- const url = window.URL.createObjectURL(blob);
- const link = document.createElement('a');
-
- link.href = url;
- link.download = `maker_battle_${selectedGroupType.value}_${Date.now()}.csv`;
- document.body.appendChild(link);
- link.click();
-
- // Nettoyer
- document.body.removeChild(link);
- window.URL.revokeObjectURL(url);
+ downloadJsonAsCsv(exportData, `maker_battle_${selectedGroupType.value}_${Date.now()}.csv`);
} catch (error) {
console.error('Erreur lors du téléchargement des groupes:', error);
+
Swal.fire({
icon: 'error',
title: 'Erreur',
@@ -103,6 +68,7 @@ export const AdminMakerBattleTeamDownload = ({ groupTypeOptions }: Props) => {
isDisabled={isDownloading}
/>
+
{
- const [loading, setLoading] = useState<{ db: boolean; bus: boolean; teamMembers: boolean }>({
+ const [loading, setLoading] = useState>({
db: false,
bus: false,
teamMembers: false,
});
+
const [error, setError] = useState(null);
const [message, setMessage] = useState('');
- const [showBusExport, setShowBusExport] = useState(false);
- const [showTeamMembersExport, setShowTeamMembersExport] = useState(false);
- const busUrl = `${import.meta.env.VITE_API_URL}/exports/bus/bus.csv`;
+ const handleExportDb = async () => {
+ setLoading((prev) => ({ ...prev, db: true }));
+ setError(null);
+ setMessage('');
- const teamMembersUrl = `${import.meta.env.VITE_API_URL}/exports/teammembers/teammembers.csv`;
+ try {
+ const response = await exportDb();
+ setMessage(response.message);
+ } catch (err) {
+ console.error('Erreur export db', err);
+ setError("Erreur lors de l'export vers Google Sheets.");
+ } finally {
+ setLoading((prev) => ({ ...prev, db: false }));
+ }
+ };
- const handleExport = async (type: 'db' | 'bus' | 'teamMembers', exportFn: () => Promise<{ message: string }>) => {
+ const handleExportCsv = async (
+ type: 'bus' | 'teamMembers',
+ exportFn: () => Promise[]>,
+ filename: string,
+ ) => {
setLoading((prev) => ({ ...prev, [type]: true }));
setError(null);
setMessage('');
+
try {
- const response = await exportFn();
- setMessage(response.message);
- if (type === 'bus') setShowBusExport(true);
- if (type === 'teamMembers') setShowTeamMembersExport(true);
+ const exportData = await exportFn();
+
+ downloadJsonAsCsv(exportData, `${filename}_${Date.now()}.csv`);
+
+ setMessage('Export terminé avec succès.');
} catch (err) {
console.error(`Erreur export ${type}`, err);
- setError(
- type === 'db' ? "Erreur lors de l'export vers Google Sheets." : "Erreur lors de l'export des bus.",
- );
+ setError("Erreur lors de l'export.");
} finally {
setLoading((prev) => ({ ...prev, [type]: false }));
}
@@ -46,60 +64,39 @@ export const AdminExportConnect = () => {
⚡ Exporter les données
+
+ {/* Export DB → Google Sheets */}
handleExport('db', exportDb)}
+ onClick={handleExportDb}
disabled={loading.db}
className="w-full sm:w-auto bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white py-2 px-6 rounded-xl shadow-md transition-all duration-200">
{loading.db ? '⏳ Export en cours...' : 'Exporter vers Google Sheets'}
+ {/* Export Bus → CSV */}
handleExport('bus', exportBus)}
+ onClick={() => handleExportCsv('bus', exportBus, 'bus_export')}
disabled={loading.bus}
className="w-full sm:w-auto bg-gradient-to-r from-green-600 to-green-700 hover:from-green-700 hover:to-green-800 text-white py-2 px-6 rounded-xl shadow-md transition-all duration-200">
{loading.bus ? '⏳ Export en cours...' : 'Exporter les bus'}
+
+ {/* Export Team Members → CSV */}
handleExport('teamMembers', exportTeamMembers)}
+ onClick={() => handleExportCsv('teamMembers', exportTeamMembers, 'team_members_export')}
+ disabled={loading.teamMembers}
className="w-full sm:w-auto bg-gradient-to-r from-green-600 to-green-700 hover:from-green-700 hover:to-green-800 text-white py-2 px-6 rounded-xl shadow-md transition-all duration-200">
{loading.teamMembers ? '⏳ Export en cours...' : 'Exporter les équipes'}
{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 = () => {
+
-
+
}
/>