Skip to content

Commit

Permalink
Backend - Ajoute les compétences banatics
Browse files Browse the repository at this point in the history
  • Loading branch information
amandinejacquelin committed Oct 1, 2024
1 parent ee7563e commit aa65f6c
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
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',
}),
};
},
);
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',
}),
};
},
);
6 changes: 6 additions & 0 deletions backend/src/taxonomie/models/banatic-competence.table.ts
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(),
});

0 comments on commit aa65f6c

Please sign in to comment.