From: Kaj-Michael Lang Date: Sun, 22 Jul 2007 11:17:28 +0000 (+0300) Subject: Make some tiny changes to tables. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=407a12f3abbd1ddfaf6c7f35c6cf715c498166e9;p=mapper Make some tiny changes to tables. Remove unused tables. Create some more indexes. --- diff --git a/docs/osm-indexes.sql b/docs/osm-indexes.sql index c38c776..893573f 100644 --- a/docs/osm-indexes.sql +++ b/docs/osm-indexes.sql @@ -1,9 +1,11 @@ CREATE UNIQUE INDEX poi_lat_lon_idx on poi (lat, lon, cat_id); CREATE INDEX poi_priority on poi (priority); -CREATE INDEX node_ll_idx on nodes (lat,lon); +CREATE INDEX node_lat_idx on nodes (lat); +CREATE INDEX node_lon_idx on nodes (lon); -CREATE INDEX name_idx on way_names (name); +CREATE INDEX way_name_idx on way_names (name); +CREATE INDEX way_ref_idx on way_ref (ref); CREATE INDEX way_seg_wsid_idx on way_seg (wsid); CREATE INDEX way_seg_node_idx on way_seg (node); diff --git a/docs/osm-tables.sql b/docs/osm-tables.sql index 89eebff..26f368a 100644 --- a/docs/osm-tables.sql +++ b/docs/osm-tables.sql @@ -6,40 +6,35 @@ create table nodes ( ); create table way ( - wid int primary key, + wid int primary key, type int not null, nodes int not null, flags int not null, - len real + len real ); create table way_seg ( wsid int not null, - num int not null, + num int not null, node int not null ); create table area ( waid int not null, - num int not null, - lat int not null, - lon int not null -); - -create table way_type ( - wtid int not null, - type int not null + num int not null, + lat int not null, + lon int not null ); create table way_names ( - wid int not null, + wid int not null, name varchar(256), isin varchar(256) ); create table way_ref ( - rid int primary key, - ref varchar(32), + rid int primary key, + ref varchar(32), int_ref varchar(32) ); @@ -51,12 +46,13 @@ create table places ( ); create table poi ( - poi_id integer PRIMARY KEY, - lat real not null, - lon real not null, + poi_id integer PRIMARY KEY, + lat real not null, + lon real not null, elev real default 0.0, label text, desc text, + url text, public integer default 1, source integer default 0, cat_id integer, @@ -65,13 +61,13 @@ create table poi ( ); create table category ( - cat_id integer PRIMARY KEY, - pcat_id int, - priority int, - label text, - desc text, - color char(6), - icon varchar(32), - enabled integer + cat_id integer PRIMARY KEY, + pcat_id integer, + priority integer not null default 2, + label text, + desc text, + color char(6) not null default '#AAAA40', + icon varchar(32), + enabled integer not null default 1 );