aboutsummaryrefslogtreecommitdiff
path: root/sources/master
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-24 15:33:11 +0100
committerJochen Topf <jochen@topf.org>2013-01-24 15:33:11 +0100
commit55550a88ff517d48ca6e56f720c4080fdb569ac9 (patch)
tree321e30c5f49533849cd3802641a7e86d23f79a5e /sources/master
parent62e3e5509f05385eb1414172c53f5be9255bc520 (diff)
downloadtaginfo-55550a88ff517d48ca6e56f720c4080fdb569ac9.tar
taginfo-55550a88ff517d48ca6e56f720c4080fdb569ac9.tar.gz
Add in_wiki and in_wiki_en columns to tags and selected_tags table
Diffstat (limited to 'sources/master')
-rw-r--r--sources/master/master.sql8
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/master/master.sql b/sources/master/master.sql
index c55185a..1167d3a 100644
--- a/sources/master/master.sql
+++ b/sources/master/master.sql
@@ -63,9 +63,17 @@ UPDATE db.keys SET in_josm=1 WHERE key IN (SELECT distinct k FROM josm.josm
-- potlatch XXX
UPDATE db.keys SET in_merkaartor=1 WHERE key IN (SELECT key FROM merkaartor.keys);
+-- ============================================================================
+
-- too slow, so we drop it for now
-- INSERT INTO db.tags (key, value) SELECT DISTINCT key, value FROM wiki.wikipages WHERE key || '=XX=' || value NOT IN (SELECT key || '=XX=' || value FROM db.tags);
+UPDATE db.tags SET in_wiki=1 WHERE key IN (SELECT distinct key FROM wiki.wikipages WHERE value IS NOT NULL AND value != '*') AND key || '=' || value IN (SELECT distinct tag FROM wiki.wikipages WHERE value IS NOT NULL AND value != '*');
+UPDATE db.tags SET in_wiki_en=1 WHERE key IN (SELECT distinct key FROM wiki.wikipages WHERE value IS NOT NULL AND value != '*' AND lang='en') AND key || '=' || value IN (SELECT distinct tag FROM wiki.wikipages WHERE value IS NOT NULL AND value != '*' AND lang='en');
+
+UPDATE db.selected_tags SET in_wiki=1 WHERE skey || '=' || svalue IN (SELECT distinct tag FROM wiki.wikipages WHERE value IS NOT NULL AND value != '*');
+UPDATE db.selected_tags SET in_wiki_en=1 WHERE skey || '=' || svalue IN (SELECT distinct tag FROM wiki.wikipages WHERE value IS NOT NULL AND value != '*' AND lang='en');
+
-- ============================================================================
DROP TABLE IF EXISTS popular_keys;