diff options
author | Jochen Topf <jochen@topf.org> | 2010-10-04 18:41:53 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2010-10-04 18:41:53 +0200 |
commit | 9918c2c4c266a29848ce39fe2496876c66c3a48e (patch) | |
tree | b49fe450d33dcb3c30b37f7bff68fbb475ecec66 /sources/wiki/post.sql | |
download | taginfo-9918c2c4c266a29848ce39fe2496876c66c3a48e.tar taginfo-9918c2c4c266a29848ce39fe2496876c66c3a48e.tar.gz |
first commit
Diffstat (limited to 'sources/wiki/post.sql')
-rw-r--r-- | sources/wiki/post.sql | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sources/wiki/post.sql b/sources/wiki/post.sql new file mode 100644 index 0000000..28e5673 --- /dev/null +++ b/sources/wiki/post.sql @@ -0,0 +1,28 @@ +-- +-- Taginfo source: Wiki +-- +-- post.sql +-- + +.bail ON + +UPDATE wikipages SET status='r' WHERE type='redirect'; +UPDATE wikipages SET status='p' WHERE type='page' AND has_templ='false'; +UPDATE wikipages SET status='t' WHERE type='page' AND has_templ='true' AND parsed=1; +UPDATE wikipages SET status='e' WHERE type='page' AND has_templ='true' AND parsed=0; + +CREATE INDEX wikipages_key_value_idx ON wikipages(key, value); + +INSERT INTO wikipages_keys (key, langs) SELECT key, group_concat(lang || ' ' || status) FROM wikipages WHERE value IS NULL GROUP BY key; +INSERT INTO wikipages_tags (key, value, langs) SELECT key, value, group_concat(lang || ' ' || status) FROM wikipages WHERE value IS NOT NULL GROUP BY key, value; + +INSERT INTO wiki_languages (language, count_pages) SELECT lang, count(*) FROM wikipages GROUP BY lang; + +INSERT INTO stats (key, value) SELECT 'wikipages_keys', count(*) FROM wikipages_keys; +INSERT INTO stats (key, value) SELECT 'wikipages_tags', count(*) FROM wikipages_tags; +INSERT INTO stats (key, value) SELECT 'wikipages_languages', count(*) FROM wiki_languages; + +ANALYZE; + +UPDATE meta SET update_end=datetime('now'); + |