diff db_schema/stammdaten_schema.sql @ 1029:b29098d201c2 schema-update

Moved referenced tables.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 08 Jul 2016 15:34:33 +0200
parents 8e5dcf7156c5
children 330dec7ee0bb
line wrap: on
line diff
--- a/db_schema/stammdaten_schema.sql	Fri Jul 08 15:32:36 2016 +0200
+++ b/db_schema/stammdaten_schema.sql	Fri Jul 08 15:34:33 2016 +0200
@@ -276,18 +276,10 @@
 );
 
 
-CREATE TABLE query (
-    id serial PRIMARY KEY,
-    name character varying(80) 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');
@@ -297,6 +289,15 @@
 INSERT INTO query_type VALUES(6, 'messprogrammkategorie');
 
 
+CREATE TABLE query (
+    id serial PRIMARY KEY,
+    name character varying(80) NOT NULL,
+    type integer NOT NULL REFERENCES query_type,
+    sql character varying(1500) NOT NULL,
+    description character varying(100)
+);
+
+
 CREATE TABLE favorite (
     id serial PRIMARY KEY,
     user_id integer NOT NULL REFERENCES lada_user,
@@ -304,6 +305,18 @@
 );
 
 
+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(1, 'listmst');
+INSERT INTO filter_type VALUES(2, 'listnetz');
+INSERT INTO filter_type VALUES(3, 'listumw');
+INSERT INTO filter_type VALUES(4, 'liststatus');
+INSERT INTO filter_type VALUES(5, 'number');
+
+
 CREATE TABLE filter (
     id serial PRIMARY KEY,
     query_id integer NOT NULL REFERENCES query ON DELETE CASCADE,
@@ -314,17 +327,6 @@
 );
 
 
-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(1, 'listmst');
-INSERT INTO filter_type VALUES(2, 'listnetz');
-INSERT INTO filter_type VALUES(3, 'listumw');
-INSERT INTO filter_type VALUES(4, '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)