-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Synchronisation de données des dossiers (#11)
* Premier jet récupération localisation * Départements et communes dans la base de données * Rajout de la localisation dans le front-end * Amélioration de l'expérience autour du lien de partage de la saisie espèces * Simplification query graphQL vers DS * Gestion des déposants de dossier * Left join plutôt que join pour garder tous les dossiers * Ajout du champ demandeur * Ajout des régions (et un peu de style sur le tableau) * Vue d'un seul dossier
- Loading branch information
1 parent
0801ade
commit 18bcf1b
Showing
27 changed files
with
1,046 additions
and
336 deletions.
There are no files selected for viewing
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
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,20 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function up(knex) { | ||
return knex.schema.alterTable('dossier', (table) => { | ||
table.json('départements'); | ||
table.json('communes'); | ||
}); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function down(knex) { | ||
return knex.schema.alterTable('dossier', (table) => { | ||
table.dropColumns('départements', 'communes'); | ||
}); | ||
}; |
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,20 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function up(knex) { | ||
return knex.schema.alterTable('dossier', (table) => { | ||
table.integer('déposant').unsigned().index() | ||
table.foreign('déposant').references('id').inTable('personne') | ||
}); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function down(knex) { | ||
return knex.schema.alterTable('dossier', (table) => { | ||
table.dropColumn('déposant'); | ||
}); | ||
}; |
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,37 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export async function up(knex) { | ||
await knex.schema.createTable('entreprise', (table) => { | ||
table.string('siret', 14).primary(); | ||
table.string('raison_sociale'); | ||
table.string('adresse'); | ||
}); | ||
|
||
return knex.schema.alterTable('dossier', (table) => { | ||
table.integer('demandeur_personne_physique').unsigned().index() | ||
table.foreign('demandeur_personne_physique').references('id').inTable('personne') | ||
table.string('demandeur_personne_morale', 14).index() | ||
table.foreign('demandeur_personne_morale').references('siret').inTable('entreprise') | ||
|
||
table.dropColumn('identité_petitionnaire') | ||
}); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export async function down(knex) { | ||
await knex.schema.dropTable('entreprise'); | ||
|
||
return knex.schema.alterTable('dossier', (table) => { | ||
table.dropColumn('demandeur_personne_physique'); | ||
table.dropColumn('demandeur_personne_morale'); | ||
|
||
// Ça recréé la colonne, mais les données sont perdues | ||
// et ce n'est pas grave, cette colonne était pensée comme temporaire depuis le début | ||
table.string('identité_petitionnaire'); | ||
}); | ||
}; |
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,19 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function up(knex) { | ||
return knex.schema.alterTable('dossier', (table) => { | ||
table.json('régions'); | ||
}); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function down(knex) { | ||
return knex.schema.alterTable('dossier', (table) => { | ||
table.dropColumn('régions'); | ||
}); | ||
}; |
Oops, something went wrong.