# HG changeset patch # User Tom Gottfried # Date 1362140925 -3600 # Node ID a9658d43b62121a793d89cf85467f65a350f417a # Parent 6b19902baf3130d7fe684dcedda421b04f3812b6 added missing constraints in schema (mostly for Oracle) diff -r 6b19902baf31 -r a9658d43b621 flys-backend/doc/schema/oracle-spatial.sql --- a/flys-backend/doc/schema/oracle-spatial.sql Fri Mar 01 12:40:15 2013 +0100 +++ b/flys-backend/doc/schema/oracle-spatial.sql Fri Mar 01 13:28:45 2013 +0100 @@ -150,7 +150,7 @@ border_break NUMBER(1) DEFAULT 0 NOT NULL, resolution VARCHAR(16), description VARCHAR(256), - path VARCHAR(256) NOT NULL + path VARCHAR(256) NOT NULL UNIQUE ); CREATE OR REPLACE TRIGGER dem_trigger BEFORE INSERT ON dem FOR each ROW BEGIN diff -r 6b19902baf31 -r a9658d43b621 flys-backend/doc/schema/oracle.sql --- a/flys-backend/doc/schema/oracle.sql Fri Mar 01 12:40:15 2013 +0100 +++ b/flys-backend/doc/schema/oracle.sql Fri Mar 01 13:28:45 2013 +0100 @@ -238,7 +238,7 @@ CREATE TABLE ranges ( id NUMBER(38,0) NOT NULL, - a NUMBER(38,10), + a NUMBER(38,10) NOT NULL, b NUMBER(38,10), river_id NUMBER(38,0), PRIMARY KEY (id) @@ -261,11 +261,12 @@ -- TIME_INTERVALS CREATE SEQUENCE TIME_INTERVALS_ID_SEQ; -CREATE TABLE time_intervals ( +CREATE TABLE time_intervals_ ( id NUMBER(38,0) NOT NULL, - start_time TIMESTAMP, + start_time TIMESTAMP NOT NULL, stop_time TIMESTAMP, - PRIMARY KEY (id) + PRIMARY KEY (id), + CHECK (start_time <= stop_time) ); diff -r 6b19902baf31 -r a9658d43b621 flys-backend/doc/schema/postgresql-spatial.sql --- a/flys-backend/doc/schema/postgresql-spatial.sql Fri Mar 01 12:40:15 2013 +0100 +++ b/flys-backend/doc/schema/postgresql-spatial.sql Fri Mar 01 13:28:45 2013 +0100 @@ -107,7 +107,7 @@ border_break BOOLEAN NOT NULL DEFAULT FALSE, resolution VARCHAR(16), description VARCHAR(256), - path VARCHAR(256) NOT NULL + path VARCHAR(256) NOT NULL UNIQUE ); ALTER TABLE dem ALTER COLUMN id SET DEFAULT NEXTVAL('DEM_ID_SEQ');