-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hel 495/auth interaction helios (#336)
* (hel-426) Fix taux de caf si pas de données (#330) * (hel-495) Interconnexion Helios correction script migration typeORM * (hel-495) Interconnexion Helios Modification migration ajout colonne inst_code_geo dans la table institution * Revert "(hel-495) Interconnexion Helios" This reverts commit 59474ad. * (hel-495) Interconnexion Helios Ajout de la colonne institution.inst_code_geo * (hel-495) Interconnexion Helios insertion des institution DNUM (SCN), CAT-AMANIA, et TEST * (hel-495) modification du gitignore ajout des clefs de chiffrement et du repertoire de conf vscode * (hel-495) Interconnexion Helios suppression de la contrainte d'unicité sur la colonne inst_code_geo
- Loading branch information
1 parent
756f6d0
commit bdffbcf
Showing
3 changed files
with
60 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,8 @@ reports | |
!**/.yarn/sdks | ||
!**/.yarn/versions | ||
**/.pnp.* | ||
dnum_ssh_key | ||
sftp_local | ||
sftp_local.pub | ||
ssh_key | ||
**/.vscode/* |
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
52 changes: 52 additions & 0 deletions
52
database/migrations/1688376404752-ModificationTableInstitution.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,52 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
|
||
export class ModificationTableInstitution1688376404752 implements MigrationInterface { | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
ALTER TABLE public.institution DROP CONSTRAINT institution_inst_code_key | ||
`); | ||
await queryRunner.query(` | ||
ALTER TABLE public.institution RENAME COLUMN inst_code TO inst_code_geo; | ||
`); | ||
await queryRunner.query(` | ||
ALTER TABLE public.institution ADD COLUMN inst_code character varying(10); | ||
`); | ||
await queryRunner.query(` | ||
ALTER TABLE public.institution ADD CONSTRAINT inst_code_key UNIQUE(inst_code); | ||
`); | ||
|
||
await queryRunner.query("update public.institution set inst_code=CONCAT ('ARS_',inst_code_geo);"); | ||
|
||
await queryRunner.query(` | ||
ALTER TABLE public.institution ALTER COLUMN inst_code_geo set NOT NULL; | ||
`); | ||
|
||
await queryRunner.query("insert into public.institution(inst_code, inst_libelle, inst_code_geo) values('SCN', 'DNUM (SCN)', '00');"); | ||
await queryRunner.query("insert into public.institution(inst_code, inst_libelle, inst_code_geo) values('CAT', 'CAT-AMANIA', '75');"); | ||
await queryRunner.query("insert into public.institution(inst_code, inst_libelle, inst_code_geo) values('TEST', 'TEST', '44');"); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
ALTER TABLE public.institution DROP CONSTRAINT inst_code_key | ||
`); | ||
|
||
await queryRunner.query(` | ||
ALTER TABLE public.institution DROP COLUMN inst_code; | ||
`); | ||
|
||
await queryRunner.query(` | ||
ALTER TABLE public.institution RENAME COLUMN inst_code_geo TO inst_code; | ||
`); | ||
|
||
await queryRunner.query(` | ||
ALTER TABLE public.institution ADD CONSTRAINT institution_inst_code_key UNIQUE(inst_code); | ||
`); | ||
|
||
await queryRunner.query(` | ||
ALTER TABLE public.institution ALTER COLUMN inst_code set NOT NULL; | ||
`); | ||
} | ||
|
||
} |