qwat-data-model
qwat-data-model copied to clipboard
Restoring "data_only" dumps in raw 1.3.3 structure fails because of sigip customisazion
Hi, I'm initializing a 1.3.3 structure with the init scripts and then I restore the data only dump. It fails because the dump contains tables of the sigip module, which one only exists in travis tests :
Set baseline...OK
*** QWAT was successfuly initialized! ***
----- starting qwat demo data restore --------------
pg_restore: [programme d'archivage (db)] Erreur pendant le traitement de la TOC (« PROCESSING TOC ») :
pg_restore: [programme d'archivage (db)] Erreur à partir de l'entrée TOC 4957 ; 0 46811 TABLE DATA damage postgres
pg_restore: [programme d'archivage (db)] could not execute query: ERROR: relation "qwat_od.damage" does not exist
La commande était : ALTER TABLE qwat_od.damage DISABLE TRIGGER ALL;
pg_restore: [programme d'archivage (db)] could not execute query: ERROR: relation "damage" does not exist
La commande était : COPY damage (id, fk_cause, fk_pipe, widespread_damage, detection_date, repair_date, _repaired, address, pipe_replaced, descr...
pg_restore: [programme d'archivage (db)] could not execute query: ERROR: relation "qwat_od.damage" does not exist
La commande était : ALTER TABLE qwat_od.damage ENABLE TRIGGER ALL;
pg_restore: [programme d'archivage (db)] Erreur à partir de l'entrée TOC 5070 ; 0 0 SEQUENCE SET damage_id_seq postgres
pg_restore: [programme d'archivage (db)] could not execute query: ERROR: relation "damage_id_seq" does not exist
LIGNE 1 : SELECT pg_catalog.setval('damage_id_seq', 1, false);
^
La commande était : SELECT pg_catalog.setval('damage_id_seq', 1, false);
pg_restore: [programme d'archivage (db)] Erreur pendant le traitement de la TOC (« PROCESSING TOC ») :
pg_restore: [programme d'archivage (db)] Erreur à partir de l'entrée TOC 4927 ; 0 18265 TABLE DATA network_element postgres
pg_restore: [programme d'archivage (db)] could not execute query: ERROR: column "qwat_ext_ch_vd_sire_etat_exploitation" of relation "network_element" does not exist
La commande était : COPY network_element (id, identification, fk_distributor, fk_status, fk_folder, fk_locationtype, fk_precision, fk_precisiona...
pg_restore: [programme d'archivage (db)] Erreur pendant le traitement de la TOC (« PROCESSING TOC ») :
pg_restore: [programme d'archivage (db)] Erreur à partir de l'entrée TOC 4931 ; 0 18291 TABLE DATA pipe postgres
pg_restore: [programme d'archivage (db)] could not execute query: ERROR: column "qwat_ext_ch_vd_sire_etat_exploitation" of relation "pipe" does not exist
La commande était : COPY pipe (id, fk_parent, fk_function, fk_installmethod, fk_material, fk_distributor, fk_precision, fk_bedding, fk_protectio...
pg_restore: [programme d'archivage (db)] Erreur à partir de l'entrée TOC 4951 ; 0 18382 TABLE DATA valve postgres
pg_restore: [programme d'archivage (db)] could not execute query: ERROR: column "qwat_ext_ch_vd_sire_etat_exploitation" of relation "valve" does not exist
La commande était : COPY valve (id, fk_valve_type, fk_valve_function, fk_valve_actuation, fk_pipe, fk_handle_precision, fk_handle_precisionalti,...
ATTENTION : erreurs ignorées lors de la restauration : 12
The travis deploy logic shouldn't dump the qwat_sigip schema any opinion @elemoine @lbartoletti ?
Drop before dump or alter dump procedure indeed.
I suggest creating a script that removes customization to restore the database to a "standard" state. This will call for drop_views.sql and a modification of qwat_od.damage.
Are you OK with that?
@lbartoletti I let you decide with @haubourg and @elemoine what is the best way to proceed. I'm OK with any correction that makes the dump reliable for users.
@lbartoletti +1
I updated the dumps based on the model without the extensions.
installing 1.3.6 leads me to the same error. After using the plain SQL file to restore the model, running drop_views.sql fails because of the sigip views.
sigip views are yet not more referencing production views.