diff backend/doc/schema/oracle.sql @ 6632:97145ec4e33c double-precision

Schema changes: fixed typos, syntax errors and missing or obsolete statements in Oracle schema
author Tom Gottfried <tom@intevation.de>
date Mon, 22 Jul 2013 18:06:23 +0200
parents 3b93f439e954
children b1fa193fa5db
line wrap: on
line diff
--- a/backend/doc/schema/oracle.sql	Mon Jul 22 16:57:56 2013 +0200
+++ b/backend/doc/schema/oracle.sql	Mon Jul 22 18:06:23 2013 +0200
@@ -53,7 +53,7 @@
     x                       NUMBER(38,2) NOT NULL,
     y                       NUMBER(38,2) NOT NULL,
     cross_section_line_id   NUMBER(38,0) NOT NULL,
-    PRIMARY KEY             (id),
+    PRIMARY KEY             (id)
 );
 
 
@@ -94,7 +94,7 @@
     id                  NUMBER(38,0) NOT NULL,
     description         VARCHAR2(255) NOT NULL,
     bfg_id              VARCHAR2(50),
-    kind                NUMBER(38,0) NOT NULL DEFAULT 0,
+    kind                NUMBER(38,0) DEFAULT 0 NOT NULL,
     gauge_id            NUMBER(38,0) NOT NULL,
     time_interval_id    NUMBER(38,0),
     PRIMARY KEY         (id),
@@ -215,8 +215,6 @@
     gauge_id            NUMBER(38,0) NOT NULL,
     named_value_id      NUMBER(38,0) NOT NULL,
     time_interval_id    NUMBER(38,0),
-
-    -- TODO: better checks
     UNIQUE (gauge_id, named_value_id, time_interval_id),
     PRIMARY KEY         (id)
 );
@@ -263,7 +261,7 @@
 CREATE TABLE rivers (
     id                  NUMBER(38,0) NOT NULL,
     official_number     NUMBER(38,0),
-    km_up               NUMBER(38,0) NOT NULL DEFAULT 0,
+    km_up               NUMBER(38,0) DEFAULT 0 NOT NULL,
     name                VARCHAR2(255) NOT NULL UNIQUE,
     wst_unit_id         NUMBER(38,0) NOT NULL,
     PRIMARY KEY         (id)
@@ -326,7 +324,7 @@
     description         VARCHAR2(255),
     name                VARCHAR2(255) NOT NULL,
     source              VARCHAR(256),
-    position            NUMBER(38,0) NOT NULL DEFAULT 0,
+    position            NUMBER(38,0) DEFAULT 0 NOT NULL,
     time_interval_id    NUMBER(38,0),
     wst_id              NUMBER(38,0) NOT NULL,
     UNIQUE (wst_id, name),
@@ -417,7 +415,7 @@
 ALTER TABLE wst_column_q_ranges ADD CONSTRAINT cWstColumnQRangesWstQRanges FOREIGN KEY (wst_q_range_id) REFERENCES wst_q_ranges ON DELETE CASCADE;
 ALTER TABLE wst_columns ADD CONSTRAINT cWstColumnsWsts FOREIGN KEY (wst_id) REFERENCES wsts ON DELETE CASCADE;
 ALTER TABLE wst_column_values ADD CONSTRAINT cWstColumnValuesWstColumns FOREIGN KEY (wst_column_id) REFERENCES wst_columns ON DELETE CASCADE;
-ALTER TABLE wst_q_ranges ADD CONSTRAINT cWstQRangesRanges FOREIGN KEY (range_id) REFERENCES RANGES ON LETE CASCADE;
+ALTER TABLE wst_q_ranges ADD CONSTRAINT cWstQRangesRanges FOREIGN KEY (range_id) REFERENCES RANGES ON DELETE CASCADE;
 ALTER TABLE wsts ADD CONSTRAINT cWstsRivers FOREIGN KEY (river_id) REFERENCES rivers ON DELETE CASCADE;
 ALTER TABLE wsts ADD CONSTRAINT cWstsWstKinds FOREIGN KEY (kind) REFERENCES wst_kinds;
 

http://dive4elements.wald.intevation.org