comparison flys-backend/doc/schema/postgresql.sql @ 171:4a83e14f40f9

Added entity and id annotations. flys-backend/trunk@1463 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 14 Mar 2011 14:52:58 +0000
parents 88c14d5d45be
children 8e2f2ddc507f
comparison
equal deleted inserted replaced
170:88c14d5d45be 171:4a83e14f40f9
132 132
133 UNIQUE (table_id, q, w) 133 UNIQUE (table_id, q, w)
134 ); 134 );
135 135
136 -- WST files 136 -- WST files
137 CREATE SEQUENCE WST_ID_SEQ; 137 CREATE SEQUENCE WSTS_ID_SEQ;
138 138
139 CREATE TABLE wst ( 139 CREATE TABLE wsts (
140 id int PRIMARY KEY NOT NULL, 140 id int PRIMARY KEY NOT NULL,
141 river_id int NOT NULL REFERENCES rivers(id), 141 river_id int NOT NULL REFERENCES rivers(id),
142 description VARCHAR(256) NOT NULL, 142 description VARCHAR(256) NOT NULL,
143 -- TODO: more meta infos 143 -- TODO: more meta infos
144 UNIQUE (river_id, description) 144 UNIQUE (river_id, description)
145 ); 145 );
146 146
147 -- columns of WST files 147 -- columns of WST files
148 CREATE SEQUENCE WST_COLUMN_ID_SEQ; 148 CREATE SEQUENCE WST_COLUMNS_ID_SEQ;
149 149
150 CREATE TABLE wst_column ( 150 CREATE TABLE wst_columns (
151 id int PRIMARY KEY NOT NULL, 151 id int PRIMARY KEY NOT NULL,
152 wst_id int NOT NULL REFERENCES wst(id), 152 wst_id int NOT NULL REFERENCES wst(id),
153 name VARCHAR(256) NOT NULL, 153 name VARCHAR(256) NOT NULL,
154 description VARCHAR, 154 description VARCHAR,
155 155
161 -- w values in WST file column 161 -- w values in WST file column
162 CREATE SEQUENCE WST_COLUMN_VALUES_ID_SEQ; 162 CREATE SEQUENCE WST_COLUMN_VALUES_ID_SEQ;
163 163
164 CREATE TABLE wst_column_values ( 164 CREATE TABLE wst_column_values (
165 id int PRIMARY KEY NOT NULL, 165 id int PRIMARY KEY NOT NULL,
166 wst_column_id int NOT NULL REFERENCES wst_column(id), 166 wst_column_id int NOT NULL REFERENCES wst_columns(id),
167 position NUMERIC NOT NULL, 167 position NUMERIC NOT NULL,
168 w NUMERIC NOT NULL, 168 w NUMERIC NOT NULL,
169 169
170 UNIQUE (position, wst_column_id), 170 UNIQUE (position, wst_column_id),
171 UNIQUE (position, wst_column_id, w) 171 UNIQUE (position, wst_column_id, w)

http://dive4elements.wald.intevation.org