From f3849fc506499928f67ff894fef46e72402da7df Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 16 Jan 2024 15:25:14 +0200 Subject: [PATCH] 429: Add migrations for coalitions and federations (#442) * 429: Add migrations for coalitions and federations * add name as abbreviation for those without --------- Co-authored-by: Andrew Radulescu --- ...1705397153690-FederationsCoalitionsSeed.ts | 36 +++++ .../src/migrations/seed/coalitions.seed.ts | 145 ++---------------- .../src/migrations/seed/federations.seed.ts | 141 +++-------------- 3 files changed, 67 insertions(+), 255 deletions(-) create mode 100644 backend/src/migrations/1705397153690-FederationsCoalitionsSeed.ts diff --git a/backend/src/migrations/1705397153690-FederationsCoalitionsSeed.ts b/backend/src/migrations/1705397153690-FederationsCoalitionsSeed.ts new file mode 100644 index 000000000..585d60030 --- /dev/null +++ b/backend/src/migrations/1705397153690-FederationsCoalitionsSeed.ts @@ -0,0 +1,36 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; +import { FEDERATIONS } from './seed/federations.seed'; +import { COALITIONS } from './seed/coalitions.seed'; +import { Federation, Coalition } from 'src/shared/entities'; + +export class FederationsCoalitionsSeed1705397153690 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.manager + .createQueryBuilder() + .insert() + .into(Federation) + .values(FEDERATIONS) + .execute(); + + await queryRunner.manager + .createQueryBuilder() + .insert() + .into(Coalition) + .values(COALITIONS) + .execute(); + } + + public async down(queryRunner: QueryRunner): Promise { + + await queryRunner.manager + .createQueryBuilder() + .delete() + .from(Coalition) + .execute(); + await queryRunner.manager + .createQueryBuilder() + .delete() + .from(Federation) + .execute(); + } +} diff --git a/backend/src/migrations/seed/coalitions.seed.ts b/backend/src/migrations/seed/coalitions.seed.ts index c8c209163..9136f77c5 100644 --- a/backend/src/migrations/seed/coalitions.seed.ts +++ b/backend/src/migrations/seed/coalitions.seed.ts @@ -1,152 +1,27 @@ export const COALITIONS = [ { id: 1, - name: 'Linked Alliance', - abbreviation: 'LKAL', + name: 'Coaliția pentru Drepturile Migranților și Refugiaților', + abbreviation: 'Coaliția pentru Drepturile Migranților și Refugiaților', }, { id: 2, - name: 'Existential Crisis', + name: 'Coaliţia Organizaţiilor Pacienţilor cu Afecţiuni Cronice din România', abbreviation: 'EXCR', }, { id: 3, - name: 'Credito', - abbreviation: 'CRD', + name: 'Coaliția Anti Discriminare', + abbreviation: 'Coaliția Anti Discriminare', }, { id: 4, - name: 'Bitter Alliance', - abbreviation: 'BTAL', + name: 'Coaliția pentru Egalitate de Gen', + abbreviation: 'Coaliția pentru Egalitate de Gen', }, { id: 5, - name: 'United Legion', - abbreviation: 'UTLG', - }, - { - id: 6, - name: 'Alliance of Choice', - abbreviation: 'ALOC', - }, - { - id: 7, - name: 'Pacifist', - abbreviation: 'PCF', - }, - { - id: 8, - name: 'Coalition League', - abbreviation: 'CTLG', - }, - { - id: 9, - name: 'Red Star Alliance', - abbreviation: 'RSAL', - }, - { - id: 10, - name: 'Vigo', - abbreviation: 'VIGO', - }, - { - id: 11, - name: 'Avant Garde', - abbreviation: 'AVG', - }, - { - id: 12, - name: 'Conveni', - abbreviation: 'CNV', - }, - { - id: 13, - name: 'Slayer', - abbreviation: 'SLY', - }, - { - id: 14, - name: 'Artecrios', - abbreviation: 'ATC', - }, - { - id: 15, - name: 'Burda', - abbreviation: 'BURDA', - }, - { - id: 16, - name: 'Teamworks', - abbreviation: 'TMWK', - }, - { - id: 17, - name: 'Krita', - abbreviation: 'KRT', - }, - { - id: 18, - name: 'New Pact', - abbreviation: 'NPC', - }, - { - id: 19, - name: 'Cross Force', - abbreviation: 'CSR', - }, - { - id: 20, - name: 'Rooftag', - abbreviation: 'RFT', - }, - { - id: 21, - name: 'Godfrey', - abbreviation: 'GDF', - }, - { - id: 22, - name: 'Enclave', - abbreviation: 'ENL', - }, - { - id: 23, - name: 'The Masons', - abbreviation: 'TMS', - }, - { - id: 24, - name: 'Crossbar', - abbreviation: 'CSB', - }, - { - id: 25, - name: 'Uptight Unity', - abbreviation: 'UPU', - }, - { - id: 26, - name: 'Within Temptation', - abbreviation: 'WHTP', - }, - { - id: 27, - name: 'Toggether', - abbreviation: 'TGG', - }, - { - id: 28, - name: 'Aldermen', - abbreviation: 'ADM', - }, - { - id: 29, - name: 'Eunyra', - abbreviation: 'ENY', - }, - { - id: 30, - name: 'The Illuminati', - abbreviation: 'TIL', - }, + name: 'Coaliția România Sustenabilă', + abbreviation: 'Coaliția România Sustenabilă', + } ]; diff --git a/backend/src/migrations/seed/federations.seed.ts b/backend/src/migrations/seed/federations.seed.ts index 1740fed02..1d79e9505 100644 --- a/backend/src/migrations/seed/federations.seed.ts +++ b/backend/src/migrations/seed/federations.seed.ts @@ -1,152 +1,53 @@ export const FEDERATIONS = [ { id: 1, - name: 'Federational', - abbreviation: 'FDTL', + name: 'Federația Fundațiilor Comunitare din România', + abbreviation: 'FFCR', }, { id: 2, - name: 'Federo', - abbreviation: 'FDR', + name: 'Federația Organizațiilor Neguvernamentale pentru Copii', + abbreviation: 'FONPC', }, { id: 3, - name: 'Activosa', - abbreviation: 'ATV', + name: 'Federația Organizațiilor Neguvernamentale pentru Servicii Sociale', + abbreviation: 'FONSS', }, { id: 4, - name: 'Block Federation', - abbreviation: 'BLFD', + name: 'Federația ONG pentru Dezvoltare', + abbreviation: 'FOND', }, { id: 5, - name: 'League Fusion', - abbreviation: 'LGFS', + name: 'Federația Coaliția pentru Educație', + abbreviation: 'Federația Coaliția pentru Educație', }, { id: 6, - name: 'Amigo Networks', - abbreviation: 'AGNT', + name: 'Federația Asociațiilor Studenților în Medicină din România', + abbreviation: 'FASMR', }, { id: 7, - name: 'United Federation', - abbreviation: 'UTFD', + name: 'Federația Coaliția Natura 2000 România', + abbreviation: 'Federația Coaliția Natura 2000 România', }, { id: 8, - name: 'Alliance Exchange', - abbreviation: 'ALEX', + name: 'Federația Asociațiilor Studenților Farmaciști din România', + abbreviation: 'FASFR', }, { id: 9, - name: 'Freeflow', - abbreviation: 'FFL', + name: 'Federația Consiliul Tineretului din România', + abbreviation: 'Federația Consiliul Tineretului din România', }, { id: 10, - name: 'Diaspora', - abbreviation: 'DSP', - }, - { - id: 11, - name: 'Agrifederation', - abbreviation: 'AGFD', - }, - { - id: 12, - name: 'Conclave', - abbreviation: 'CCL', - }, - { - id: 13, - name: 'Connectr', - abbreviation: 'CNN', - }, - { - id: 14, - name: 'Veridical', - abbreviation: 'VRDL', - }, - { - id: 15, - name: 'Ufomate', - abbreviation: 'UFO', - }, - { - id: 16, - name: 'Viscount', - abbreviation: 'VSC', - }, - { - id: 17, - name: 'Bistro', - abbreviation: 'BST', - }, - { - id: 18, - name: 'Transunion', - abbreviation: 'TRS', - }, - { - id: 19, - name: 'Trump Federation', - abbreviation: 'TMFD', - }, - { - id: 20, - name: 'Utopia Alliance', - abbreviation: 'UPLL', - }, - { - id: 21, - name: 'Commize', - abbreviation: 'CMZ', - }, - { - id: 22, - name: 'Confectus', - abbreviation: 'CFC', - }, - { - id: 23, - name: 'Astralis', - abbreviation: 'AST', - }, - { - id: 24, - name: 'Zorgon', - abbreviation: 'ZRG', - }, - { - id: 25, - name: 'Amicus', - abbreviation: 'AMC', - }, - { - id: 26, - name: 'Bibliometria', - abbreviation: 'BBLM', - }, - { - id: 27, - name: 'Crescendo', - abbreviation: 'CRSC', - }, - { - id: 28, - name: 'Alla Federation', - abbreviation: 'ALFD', - }, - { - id: 29, - name: 'Interserv', - abbreviation: 'INRS', - }, - { - id: 30, - name: 'Federation Force', - abbreviation: 'FDFR', + name: 'Federația Asociațiilor Studenților la Psihologie și Științele Educației din România', + abbreviation: 'Cognosis', }, ]; +