comparison db_schema/stammdaten_schema.sql @ 1093:effef57f3f7e 2.3.0

Complement and correct data model and docs for queries.
author Tom Gottfried <tom@intevation.de>
date Fri, 14 Oct 2016 15:18:42 +0200
parents 299f4ba86090
children 186d602e031a
comparison
equal deleted inserted replaced
1092:b225875c68fe 1093:effef57f3f7e
293 CACHE 1; 293 CACHE 1;
294 294
295 CREATE TABLE query ( 295 CREATE TABLE query (
296 id integer PRIMARY KEY DEFAULT nextval('query_id_seq'::regclass), 296 id integer PRIMARY KEY DEFAULT nextval('query_id_seq'::regclass),
297 name character varying(80) NOT NULL, 297 name character varying(80) NOT NULL,
298 type character varying(30) NOT NULL, 298 type character varying(30) NOT NULL
299 CHECK(type IN('probe', 'messung', 'messprogramm', 'ort',
300 'probenehmer', 'datensatzerzeuger', 'messprogrammkategorie')),
299 sql character varying(1500) NOT NULL, 301 sql character varying(1500) NOT NULL,
300 description character varying(100) 302 description character varying(100),
303 UNIQUE (name, type)
301 ); 304 );
302 305
303 ALTER SEQUENCE query_id_seq OWNED BY query.id; 306 ALTER SEQUENCE query_id_seq OWNED BY query.id;
304 307
305 308
328 331
329 CREATE TABLE filter ( 332 CREATE TABLE filter (
330 id integer PRIMARY KEY DEFAULT nextval('filter_id_seq'::regclass), 333 id integer PRIMARY KEY DEFAULT nextval('filter_id_seq'::regclass),
331 query_id integer NOT NULL REFERENCES query ON DELETE CASCADE, 334 query_id integer NOT NULL REFERENCES query ON DELETE CASCADE,
332 data_index character varying(50) NOT NULL, 335 data_index character varying(50) NOT NULL,
333 type character varying(10) NOT NULL, 336 type character varying(10) NOT NULL
337 CHECK(type IN('liststatus', 'listmst', 'listnetz', 'listumw', 'text')),
334 label character varying(50) NOT NULL, 338 label character varying(50) NOT NULL,
335 multiselect boolean 339 multiselect boolean
336 ); 340 );
337 341
338 ALTER SEQUENCE filter_id_seq OWNED BY filter.id; 342 ALTER SEQUENCE filter_id_seq OWNED BY filter.id;
623 query_id integer NOT NULL REFERENCES query ON DELETE CASCADE, 627 query_id integer NOT NULL REFERENCES query ON DELETE CASCADE,
624 data_index character varying(50) NOT NULL, 628 data_index character varying(50) NOT NULL,
625 header character varying(50) NOT NULL, 629 header character varying(50) NOT NULL,
626 width integer, 630 width integer,
627 flex boolean, 631 flex boolean,
628 index integer, 632 index integer NOT NULL,
633 UNIQUE (query_id, index),
629 UNIQUE (query_id, data_index) 634 UNIQUE (query_id, data_index)
630 ); 635 );
631 636
632 ALTER SEQUENCE result_id_seq OWNED BY result.id; 637 ALTER SEQUENCE result_id_seq OWNED BY result.id;
633 638
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)