Take away gem.

From TNG_Wiki
Jump to navigation Jump to search

For Dutch users who copy a lot from genlias. This query changes the format of the place names to standard TNG placenames. This query is intended if you already have everything set to the standard but you import a gedcom which are still formatted according to that genlias standard or have users who enter places according that standard, for instance Nieuw-Buinen Gem. Borger. In case you want to change the whole database you will have to replace the DELETE FROM `tng_places` WHERE `place` like "% gem.%"; statement with UPDATE tng_places REPLACE (place, ' gem.',','); in the first set of queries and to UPDATE tng_places REPLACE (place, ' Gem.',','); in the second set and so on. If people uses brackets in for instance Nieuw-Buinen (Gem. Borger). you will have to change that accordingly. Believe me, it's worth the effort and much less work.


Copy and paste the text between the lines into the MySQL section of your MySQL admin, IMPORTANT: Make a backup before you try anything and use this at your own risk!


UPDATE tng_families SET marrplace = REPLACE(marrplace,' gem.',',');
UPDATE tng_families SET divplace = REPLACE(divplace,' gem.',',');
UPDATE tng_people SET birthplace = REPLACE(birthplace,' gem.',',');
UPDATE tng_people SET altbirthplace = REPLACE(altbirthplace,' gem.',',');
UPDATE tng_people SET deathplace = REPLACE(deathplace,' gem.',',');
UPDATE tng_people SET burialplace = REPLACE(burialplace,' gem.',',');
UPDATE tng_events SET eventplace = REPLACE(eventplace,' gem.',',');
DELETE FROM `tng_places` WHERE `place` like "% gem.%";
DELETE FROM `tng_places` WHERE `place` like "% (%";

UPDATE tng_families SET marrplace = REPLACE(marrplace,' Gem.',',');
UPDATE tng_families SET divplace = REPLACE(divplace,' Gem.',',');
UPDATE tng_people SET birthplace = REPLACE(birthplace,' Gem.',',');
UPDATE tng_people SET altbirthplace = REPLACE(altbirthplace,' Gem.',',');
UPDATE tng_people SET deathplace = REPLACE(deathplace,' Gem.',',');
UPDATE tng_people SET burialplace = REPLACE(burialplace,' Gem.',',');
UPDATE tng_events SET eventplace = REPLACE(eventplace,' Gem.',',');
DELETE FROM `tng_places` WHERE `place` like "% Gem.%";


UPDATE tng_families SET marrplace = REPLACE(marrplace,' gem ',',');
UPDATE tng_families SET divplace = REPLACE(divplace,' gem ',',');
UPDATE tng_people SET birthplace = REPLACE(birthplace,' gem ',',');
UPDATE tng_people SET altbirthplace = REPLACE(altbirthplace,' gem ',',');
UPDATE tng_people SET deathplace = REPLACE(deathplace,' gem ',',');
UPDATE tng_people SET burialplace = REPLACE(burialplace,' gem ',',');
UPDATE tng_events SET eventplace = REPLACE(eventplace,' gem ',',');
DELETE FROM `tng_places` WHERE `place` like "% gem %";