-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backend - Ajoute les compétences banatics
- Loading branch information
1 parent
ee7563e
commit aa65f6c
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
backend/src/collectivites/models/collectivite-banatic-competence.table.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { integer, pgTable } from 'drizzle-orm/pg-core'; | ||
import { collectiviteTable } from './collectivite.table'; | ||
import { primaryKey } from 'drizzle-orm/pg-core/index'; | ||
import { banaticCompetenceTable } from '../../taxonomie/models/banatic-competence.table'; | ||
|
||
export const collectiviteBanaticCompetenceTable = pgTable( | ||
'collectivite_banatic_competence', | ||
{ | ||
collectiviteId: integer('collectivite_id') | ||
.notNull() | ||
.references(() => collectiviteTable.id), | ||
competenceCode: integer('competence_code') | ||
.notNull() | ||
.references(() => banaticCompetenceTable.code), | ||
}, | ||
(table) => { | ||
return { | ||
collectiviteBanaticCompetencePkey: primaryKey({ | ||
columns: [table.collectiviteId, table.competenceCode], | ||
name: 'collectivite_banatic_competence_pkey', | ||
}), | ||
}; | ||
}, | ||
); |
24 changes: 24 additions & 0 deletions
24
backend/src/panier/models/action-impact-banatic-competence.table.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { integer, pgTable } from 'drizzle-orm/pg-core'; | ||
import { primaryKey } from 'drizzle-orm/pg-core/index'; | ||
import { actionImpactTable } from './action-impact.table'; | ||
import { banaticCompetenceTable } from '../../taxonomie/models/banatic-competence.table'; | ||
|
||
export const actionImpactBanaticCompetenceTable = pgTable( | ||
'action_impact_banatic_competence', | ||
{ | ||
actionImpactId: integer('action_impact_id') | ||
.notNull() | ||
.references(() => actionImpactTable.id), | ||
competenceCode: integer('competence_code') | ||
.notNull() | ||
.references(() => banaticCompetenceTable.code), | ||
}, | ||
(table) => { | ||
return { | ||
action_impact_banatic_competence_pkey: primaryKey({ | ||
columns: [table.actionImpactId, table.competenceCode], | ||
name: 'action_impact_banatic_competence_pkey', | ||
}), | ||
}; | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { integer, pgTable, text } from 'drizzle-orm/pg-core'; | ||
|
||
export const banaticCompetenceTable = pgTable('banatic_competence', { | ||
code: integer('code').primaryKey().notNull(), | ||
nom: text('nom').notNull(), | ||
}); |