aboutsummaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-14 19:50:29 +0100
committerJochen Topf <jochen@topf.org>2013-01-14 19:50:29 +0100
commit4298e373d2c7ebbd8e2c82dda6cff54f6c3995b0 (patch)
treeda73fe3574a3302c7453d2bc771971e3b0f00f5e /sources
parent8f00c3b0b3f92b2c184d66f32a0da938c4bb05bf (diff)
downloadtaginfo-4298e373d2c7ebbd8e2c82dda6cff54f6c3995b0.tar
taginfo-4298e373d2c7ebbd8e2c82dda6cff54f6c3995b0.tar.gz
Add data on all relation types to relation_types table
Diffstat (limited to 'sources')
-rw-r--r--sources/db/post.sql2
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/db/post.sql b/sources/db/post.sql
index afe5f66..ddcc80e 100644
--- a/sources/db/post.sql
+++ b/sources/db/post.sql
@@ -85,6 +85,8 @@ INSERT INTO prevalent_values (key, value, count, fraction)
CREATE INDEX prevalent_values_key_idx ON prevalent_values (key);
+INSERT INTO relation_types (rtype, count) SELECT value, count_relations FROM tags WHERE key='type' AND count_relations > 0 AND value NOT IN (SELECT rtype FROM relation_types);
+
INSERT INTO prevalent_roles (rtype, role, count, fraction)
SELECT t.rtype, r.role, r.count_all, round(CAST(r.count_all AS REAL) / CAST(t.members_all AS REAL), 4) FROM relation_types t, relation_roles r
WHERE t.rtype = r.rtype