Rename aliases in undo queries

This commit is contained in:
Mathieu Jaumotte 2023-03-08 23:43:47 +01:00
parent 5a6daae5a4
commit 5f78276762

View File

@ -301,22 +301,22 @@ INSERT INTO chill_person_household_to_addresses (household_id, address_id) SELEC
-- --
-- Undo 44. -- 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. -- 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)); 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)); SELECT setval('chill_person_household_id_seq', (SELECT max(id) FROM chill_person_household));
-- Undo 42. -- 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)); 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 postcode_id;
ALTER TABLE import.personnes DROP column address_id; ALTER TABLE import.personnes DROP column address_id;
-- Undo 41. -- 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)); SELECT setval('chill_person_person_id_seq', (SELECT max(id) FROM chill_person_person));
-- Undo 40. -- Undo 40.