From 5f78276762661b308b25b1bec145332cccd24ead Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 8 Mar 2023 23:43:47 +0100 Subject: [PATCH] Rename aliases in undo queries --- sql/import.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/import.sql b/sql/import.sql index 3c36358..85ddbb8 100644 --- a/sql/import.sql +++ b/sql/import.sql @@ -301,22 +301,22 @@ INSERT INTO chill_person_household_to_addresses (household_id, address_id) SELEC -- -- Undo 44. -DELETE FROM chill_person_household_to_addresses cphta USING import.personnes ic WHERE cphta.household_id = ic.person_id ; +DELETE FROM chill_person_household_to_addresses hhaddr USING import.personnes ip WHERE hhaddr.household_id = ip.person_id ; -- Undo 43. -DELETE FROM chill_person_household_members cphm USING import.personnes ic WHERE cphm.person_id = ic.person_id; +DELETE FROM chill_person_household_members memb USING import.personnes ip WHERE memb.person_id = ip.person_id; SELECT setval('chill_person_household_members_id_seq', (SELECT max(id) FROM chill_person_household_members)); -DELETE FROM chill_person_household cph USING import.personnes ip WHERE cph.id = ip.person_id; +DELETE FROM chill_person_household hh USING import.personnes ip WHERE hh.id = ip.person_id; SELECT setval('chill_person_household_id_seq', (SELECT max(id) FROM chill_person_household)); -- Undo 42. -DELETE FROM chill_main_address cma USING import.personnes ip WHERE cma.id = ip.address_id; +DELETE FROM chill_main_address addr USING import.personnes ip WHERE addr.id = ip.address_id; SELECT setval('chill_main_address_id_seq', (SELECT max(id) FROM chill_main_address)); ALTER TABLE import.personnes DROP column postcode_id; ALTER TABLE import.personnes DROP column address_id; -- Undo 41. -DELETE FROM chill_person_person cpp USING import.personnes ip WHERE cpp.id = ip.person_id; +DELETE FROM chill_person_person p USING import.personnes ip WHERE p.id = ip.person_id; SELECT setval('chill_person_person_id_seq', (SELECT max(id) FROM chill_person_person)); -- Undo 40.