@@ -3,50 +3,51 @@ import { Client } from "pg";
33import { postgres_user , postgres_db , postgres_host , postgres_password , postgres_port } from '../utils/secret' ;
44
55// ✅ Import de tous tes schémas ici
6- import * as user from '../schemas/Basic/user.schema' ;
7- import * as team from '../schemas/Basic/team.schema' ;
8- import * as perm from '../schemas/Basic/permanence.schema' ;
9- import * as event from '../schemas/Basic/event.schema' ;
10- import * as faction from '../schemas/Basic/faction.schema' ;
11- import * as role from '../schemas/Basic/role.schema' ;
12- import * as challenge from '../schemas/Basic/challenge.schema' ;
13- import * as permanence from '../schemas/Basic/permanence.schema' ;
14-
15- import * as userTeam from '../schemas/Relational/userteams.schema' ;
16- import * as teamFaction from '../schemas/Relational/teamfaction.schema' ;
17- import * as teamShotgun from '../schemas/Relational/teamshotgun.schema' ;
18- import * as userPermanence from '../schemas/Relational/userpermanences.schema' ;
19- import * as userRole from '../schemas/Relational/userroles.schema' ;
20- import * as challengValidation from '../schemas/Relational/challengevalidation.schema' ;
21- import * as busattribution from "../schemas/Relational/busattribution.schema" ;
22- import * as registration from "../schemas/Relational/registration.schema" ;
23-
6+ import * as user from '../schemas/Basic/user.schema' ;
7+ import * as team from '../schemas/Basic/team.schema' ;
8+ import * as perm from '../schemas/Basic/permanence.schema' ;
9+ import * as event from '../schemas/Basic/event.schema' ;
10+ import * as faction from '../schemas/Basic/faction.schema' ;
11+ import * as role from '../schemas/Basic/role.schema' ;
12+ import * as challenge from '../schemas/Basic/challenge.schema' ;
13+ import * as permanence from '../schemas/Basic/permanence.schema' ;
14+ import * as userTeam from '../schemas/Relational/userteams.schema' ;
15+ import * as teamFaction from '../schemas/Relational/teamfaction.schema' ;
16+ import * as teamShotgun from '../schemas/Relational/teamshotgun.schema' ;
17+ import * as userPermanence from '../schemas/Relational/userpermanences.schema' ;
18+ import * as userRole from '../schemas/Relational/userroles.schema' ;
19+ import * as challengValidation from '../schemas/Relational/challengevalidation.schema' ;
20+ import * as busattribution from "../schemas/Relational/busattribution.schema" ;
21+ import * as registration from "../schemas/Relational/registration.schema" ;
22+ import * as tent from "../schemas/Relational/usertent.schema" ;
23+ import * as rolepoints from "../schemas/Relational/rolepoints.schema" ;
24+
25+
26+ const schema = {
27+ ...user ,
28+ ...team ,
29+ ...perm ,
30+ ...event ,
31+ ...faction ,
32+ ...role ,
33+ ...challenge ,
34+ ...permanence ,
35+ ...userTeam ,
36+ ...teamFaction ,
37+ ...teamShotgun ,
38+ ...userPermanence ,
39+ ...userRole ,
40+ ...challengValidation ,
41+ ...busattribution ,
42+ ...registration ,
43+ ...tent ,
44+ ...rolepoints
45+ } ;
2446
2547const client = new Client ( {
2648 connectionString : `postgresql://${ postgres_user } :${ postgres_password } @${ postgres_host } :${ postgres_port } /${ postgres_db } ` ,
2749} ) ;
2850
2951client . connect ( ) ;
3052
31- export const db = drizzle ( client , {
32- schema : {
33- ...user ,
34- ...team ,
35- ...event ,
36- ...faction ,
37- ...role ,
38- ...perm ,
39- ...challenge ,
40- ...permanence ,
41-
42- ...userTeam ,
43- ...teamFaction ,
44- ...teamShotgun ,
45- ...userPermanence ,
46- ...userRole ,
47- ...challengValidation ,
48- ...busattribution ,
49- ...registration
50-
51- } ,
52- } ) ;
53+ export const db = drizzle ( client , { schema : schema } ) ;
0 commit comments