changeset 5121:e4cc9aebfcf1 dami

sensible constraints for dem-table
author Tom Gottfried <tom@intevation.de>
date Wed, 27 Feb 2013 19:44:08 +0100
parents d49b3baa30d0
children 5ba502e78e05
files flys-backend/doc/schema/oracle-spatial.sql flys-backend/doc/schema/postgresql-migrate-dami.sql flys-backend/doc/schema/postgresql-spatial.sql
diffstat 3 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-spatial.sql	Wed Feb 27 17:35:17 2013 +0100
+++ b/flys-backend/doc/schema/oracle-spatial.sql	Wed Feb 27 19:44:08 2013 +0100
@@ -141,7 +141,7 @@
     border_break    NUMBER(1) DEFAULT 0 NOT NULL,
     resolution      VARCHAR(16),
     description     VARCHAR(256),
-    path            VARCHAR(256)
+    path            VARCHAR(256) NOT NULL
 );
 CREATE OR REPLACE TRIGGER dem_trigger BEFORE INSERT ON dem FOR each ROW
     BEGIN
--- a/flys-backend/doc/schema/postgresql-migrate-dami.sql	Wed Feb 27 17:35:17 2013 +0100
+++ b/flys-backend/doc/schema/postgresql-migrate-dami.sql	Wed Feb 27 19:44:08 2013 +0100
@@ -118,6 +118,10 @@
 ALTER TABLE hydr_boundaries ADD COLUMN sobek INT REFERENCES sobek_kinds(id);
 ALTER TABLE hydr_boundaries ADD FOREIGN KEY (kind) REFERENCES boundary_kinds(id);
 ALTER TABLE dem ADD COLUMN srid INT NOT NULL;
+ALTER TABLE dem ALTER COLUMN year_from DROP NOT NULL;
+ALTER TABLE dem ALTER COLUMN year_to DROP NOT NULL;
+ALTER TABLE dem ALTER COLUMN projection DROP NOT NULL;
+ALTER TABLE dem ALTER COLUMN path SET NOT NULL;
 
 COMMIT;
 
--- a/flys-backend/doc/schema/postgresql-spatial.sql	Wed Feb 27 17:35:17 2013 +0100
+++ b/flys-backend/doc/schema/postgresql-spatial.sql	Wed Feb 27 19:44:08 2013 +0100
@@ -90,16 +90,16 @@
     name            VARCHAR(64),
     lower           FLOAT8,
     upper           FLOAT8,
-    year_from       VARCHAR(32) NOT NULL,
-    year_to         VARCHAR(32) NOT NULL,
-    projection      VARCHAR(32) NOT NULL,
+    year_from       VARCHAR(32),
+    year_to         VARCHAR(32),
+    projection      VARCHAR(32),
     srid	    int NOT NULL,
     elevation_state VARCHAR(32),
     format          VARCHAR(32),
     border_break    BOOLEAN NOT NULL DEFAULT FALSE,
     resolution      VARCHAR(16),
     description     VARCHAR(256),
-    path            VARCHAR(256)
+    path            VARCHAR(256) NOT NULL
 );
 ALTER TABLE dem ALTER COLUMN id SET DEFAULT NEXTVAL('DEM_ID_SEQ');
 

http://dive4elements.wald.intevation.org