changeset 1022:042437ce8f51 schema-update

Added filter and query type table.
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 04 Jul 2016 14:18:42 +0200
parents f51a9cf1d52c
children 5fdc6feabedb
files db_schema/stammdaten_schema.sql
diffstat 1 files changed, 25 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/db_schema/stammdaten_schema.sql	Mon Jul 04 14:11:00 2016 +0200
+++ b/db_schema/stammdaten_schema.sql	Mon Jul 04 14:18:42 2016 +0200
@@ -271,11 +271,23 @@
 CREATE TABLE query (
     id serial PRIMARY KEY,
     name character varying(80) NOT NULL,
-    type character varying(30) NOT NULL,
+    type integer NOT NULL REFERENCES query_type,
     sql character varying(1500) NOT NULL,
     description character varying(100)
 );
 
+CREATE TABLE query_type (
+    id serial PRIMARY KEY,
+    type character varying(30) NOT NULL
+):
+INSERT INTO query_type VALUES(0, 'probe');
+INSERT INTO query_type VALUES(1, 'messung');
+INSERT INTO query_type VALUES(2, 'messprogramm');
+INSERT INTO query_type VALUES(3, 'ort');
+INSERT INTO query_type VALUES(4, 'probenehmer');
+INSERT INTO query_type VALUES(5, 'datensatz_erzeuger');
+INSERT INTO query_type VALUES(6, 'messprogramm_kategorie');
+
 
 CREATE TABLE favorite (
     id serial PRIMARY KEY,
@@ -288,12 +300,23 @@
     id serial PRIMARY KEY,
     query_id integer NOT NULL REFERENCES query ON DELETE CASCADE,
     data_index character varying(50) NOT NULL,
-    type character varying(10) NOT NULL,
+    type integer NOT NULL REFERENCES filter_type,
     label character varying(50) NOT NULL,
     multiselect boolean
 );
 
 
+CREATE TABLE filter_type (
+    id serial PRIMARY KEY,
+    type character varying(10) NOT NULL
+)
+INSERT INTO filter_type VALUES(0, 'text');
+INSERT INTO filter_type VALUES(0, 'listmst');
+INSERT INTO filter_type VALUES(0, 'listnetz');
+INSERT INTO filter_type VALUES(0, 'listumw');
+INSERT INTO filter_type VALUES(0, 'liststatus');
+
+
 CREATE TABLE filter_value (
     id serial PRIMARY KEY,
     user_id integer NOT NULL REFERENCES lada_user,
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)