Mercurial > gemma
diff schema/gemma.sql @ 4043:fbd7c012f10c historization_ng
Merged
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Wed, 24 Jul 2019 11:16:38 +0200 |
parents | 3fcb95a07948 4f2f34f5d14d |
children | f42f7f7eb81f |
line wrap: on
line diff
--- a/schema/gemma.sql Tue Jul 23 13:12:35 2019 +0200 +++ b/schema/gemma.sql Wed Jul 24 11:16:38 2019 +0200 @@ -902,6 +902,7 @@ CREATE TABLE track_imports ( import_id int NOT NULL REFERENCES imports(id) ON DELETE CASCADE, + deletion bool NOT NULL DEFAULT false, relation regclass NOT NULL, key int NOT NULL, UNIQUE (relation, key) @@ -914,7 +915,7 @@ tmp RECORD; BEGIN FOR tmp IN - SELECT * FROM import.track_imports WHERE import_id = imp_id + SELECT * FROM import.track_imports WHERE import_id = imp_id AND NOT deletion LOOP EXECUTE format('DELETE FROM %s WHERE id = $1', tmp.relation) USING tmp.key; END LOOP; @@ -922,15 +923,6 @@ $$ LANGUAGE plpgsql; -CREATE FUNCTION import.del_import() RETURNS trigger AS -$$ -BEGIN - EXECUTE format('DELETE FROM %s WHERE id = $1', OLD.relation) USING OLD.key; - RETURN NULL; -END; -$$ -LANGUAGE plpgsql; - CREATE SCHEMA caching CREATE TABLE sounding_differences (