Mercurial > gemma
annotate schema/updates/0000/01.add_schema_version.sql @ 4734:56bd9ba0354c stack-polygons
Removed ST_MakeValid() call from storing iso areas in SR import, too.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 18 Oct 2019 09:37:53 +0200 |
parents | 7b7c324b318f |
children |
rev | line source |
---|---|
3978
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
1 CREATE TABLE gemma_schema_version ( |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
2 version int PRIMARY KEY, |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
3 update_date timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
4 ); |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
5 |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
6 CREATE OR REPLACE FUNCTION get_schema_version() RETURNS int |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
7 LANGUAGE plpgsql |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
8 AS $$ |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
9 BEGIN |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
10 RETURN ( SELECT max(version) FROM gemma_schema_version ); |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
11 END; |
7b7c324b318f
Added database schema versioning and db update script.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
12 $$; |