changeset 4718:92640ae5be07

Backed out changeset 9279fdb7a422 There are already UNIQUE constraints that include staging_done to allow updating of stretches and sections.
author Tom Gottfried <tom@intevation.de>
date Thu, 17 Oct 2019 13:08:49 +0200
parents 9279fdb7a422
children 07e8436ef4de
files schema/gemma.sql schema/updates/1307/01.unique_names.sql schema/version.sql
diffstat 3 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/schema/gemma.sql	Thu Oct 17 12:55:13 2019 +0200
+++ b/schema/gemma.sql	Thu Oct 17 13:08:49 2019 +0200
@@ -407,7 +407,7 @@
 CREATE SCHEMA users
     CREATE TABLE stretches (
         id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
-        name varchar UNIQUE NOT NULL,
+        name varchar NOT NULL,
         stretch isrsrange NOT NULL,
         area geography(MULTIPOLYGON, 4326) NOT NULL
             CHECK(ST_IsValid(CAST(area AS geometry))),
@@ -582,7 +582,7 @@
     -- Like stretches without the countries
     CREATE TABLE sections (
         id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
-        name varchar UNIQUE NOT NULL,
+        name varchar NOT NULL,
         section isrsrange NOT NULL,
         area geography(MULTIPOLYGON, 4326) NOT NULL
             CHECK(ST_IsValid(CAST(area AS geometry))),
--- a/schema/updates/1307/01.unique_names.sql	Thu Oct 17 12:55:13 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-ALTER TABLE users.stretches ADD UNIQUE (name);
-
-ALTER TABLE waterway.sections ADD UNIQUE (name);
--- a/schema/version.sql	Thu Oct 17 12:55:13 2019 +0200
+++ b/schema/version.sql	Thu Oct 17 13:08:49 2019 +0200
@@ -1,1 +1,1 @@
-INSERT INTO gemma_schema_version(version) VALUES (1307);
+INSERT INTO gemma_schema_version(version) VALUES (1306);