Mercurial > gemma
changeset 656:9ef2f80a4645
Fix syntax error in schema script
serial is a data type, just like int, and only one can
be given. In passing use the standard conforming way to specify
the auto-generated column and make it the real primary key.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 14 Sep 2018 16:57:12 +0200 |
parents | 014ee3beb329 |
children | 40d3b697ea15 |
files | schema/gemma.sql |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/schema/gemma.sql Fri Sep 14 16:31:07 2018 +0200 +++ b/schema/gemma.sql Fri Sep 14 16:57:12 2018 +0200 @@ -370,10 +370,10 @@ ) CREATE TABLE sounding_results ( - id int serial NOT NULL UNIQUE, + id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, bottleneck_id varchar NOT NULL REFERENCES bottlenecks, date_info date NOT NULL, - PRIMARY KEY (bottleneck_id, date_info), + UNIQUE (bottleneck_id, date_info), area geography(POLYGON, 4326), surtyp varchar REFERENCES survey_types, coverage varchar REFERENCES coverage_types, @@ -385,7 +385,7 @@ ) CREATE TABLE meshes ( - sounding_result_id int NOT NULL REFERENCES sounding_results(id), + sounding_result_id int NOT NULL REFERENCES sounding_results, geom geometry(polygonz) NOT NULL )