annotate schema/updates/1001/01.simplify-get_schema_version.sql @ 5560:f2204f91d286

Join the log lines of imports to the log exports to recover data from them. Used in SR export to extract information that where in the meta json but now are only found in the log.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 09 Feb 2022 18:34:40 +0100
parents a2921151b193
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3996
a2921151b193 Schema: Use SQL instead of PLPGSQL for get_schema_version().
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
1 CREATE OR REPLACE FUNCTION get_schema_version() RETURNS int
a2921151b193 Schema: Use SQL instead of PLPGSQL for get_schema_version().
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
2 LANGUAGE sql
a2921151b193 Schema: Use SQL instead of PLPGSQL for get_schema_version().
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
3 AS $$
a2921151b193 Schema: Use SQL instead of PLPGSQL for get_schema_version().
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
4 SELECT max(version) FROM gemma_schema_version;
a2921151b193 Schema: Use SQL instead of PLPGSQL for get_schema_version().
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
5 $$;