[Lada-commits] [PATCH 02 of 10] Added filter and query type table

Wald Commits scm-commit at wald.intevation.org
Fri Jul 8 15:35:33 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1467634722 -7200
# Branch schema-update
# Node ID 042437ce8f51dc1f9d251767e2f6f565cbfda31a
# Parent  f51a9cf1d52c2bd201138d55d64fa9e7506f2508
Added filter and query type table.

diff -r f51a9cf1d52c -r 042437ce8f51 db_schema/stammdaten_schema.sql
--- 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,


More information about the Lada-commits mailing list