Mercurial > gemma
changeset 4717:9279fdb7a422
Ensure unique names of sections and stretches
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 17 Oct 2019 12:55:13 +0200 |
parents | 310f5a5e2ea2 |
children | 92640ae5be07 |
files | schema/gemma.sql schema/updates/1307/01.unique_names.sql schema/version.sql |
diffstat | 3 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/schema/gemma.sql Thu Oct 17 12:47:17 2019 +0200 +++ b/schema/gemma.sql Thu Oct 17 12:55:13 2019 +0200 @@ -407,7 +407,7 @@ CREATE SCHEMA users CREATE TABLE stretches ( id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, - name varchar NOT NULL, + name varchar UNIQUE 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 NOT NULL, + name varchar UNIQUE NOT NULL, section isrsrange NOT NULL, area geography(MULTIPOLYGON, 4326) NOT NULL CHECK(ST_IsValid(CAST(area AS geometry))),