# HG changeset patch # User Tom Gottfried # Date 1536937032 -7200 # Node ID 9ef2f80a4645cd8effb8756f69ace9b496136169 # Parent 014ee3beb3292ba7d95c0b9c399d66a9a661ebd1 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. diff -r 014ee3beb329 -r 9ef2f80a4645 schema/gemma.sql --- 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 )