unepwcmc/SAPI — pull request #383 by agnessa (2014-09-18 10:35:02+00:00)
Title: fix for French country names appearing randomly in S+ 

The fix requires changes to the listing changes mviews. When deploying run these ahead of the overnight scripts:

ALTER TABLE cites_listing_changes_mview ADD column party_full_name_en text;
ALTER TABLE cites_listing_changes_mview ADD column party_full_name_es text;
ALTER TABLE cites_listing_changes_mview ADD column party_full_name_fr text;
ALTER TABLE eu_listing_changes_mview ADD column party_full_name_en text;
ALTER TABLE eu_listing_changes_mview ADD column party_full_name_es text;
ALTER TABLE eu_listing_changes_mview ADD column party_full_name_fr text;
ALTER TABLE cms_listing_changes_mview ADD column party_full_name_en text;
ALTER TABLE cms_listing_changes_mview ADD column party_full_name_es text;
ALTER TABLE cms_listing_changes_mview ADD column party_full_name_fr text;

UPDATE cites_listing_changes_mview lc
SET party_full_name_en = parties.name_en, party_full_name_es = parties.name_es, party_full_name_fr = parties.name_fr
FROM geo_entities parties
WHERE parties.id = lc.party_id;

UPDATE eu_listing_changes_mview lc
SET party_full_name_en = parties.name_en, party_full_name_es = parties.name_es, party_full_name_fr = parties.name_fr
FROM geo_entities parties
WHERE parties.id = lc.party_id;

UPDATE cms_listing_changes_mview lc
SET party_full_name_en = parties.name_en, party_full_name_es = parties.name_es, party_full_name_fr = parties.name_fr
FROM geo_entities parties
WHERE parties.id = lc.party_id;