Revision a34e8502
Von Moritz Bunkus vor fast 10 Jahren hinzugefügt
sql/Pg-upgrade2/custom_variables_delete_via_trigger_requirement_specs.sql | ||
---|---|---|
1 |
-- @tag: custom_variables_delete_via_trigger_requirement_specs |
|
2 |
-- @description: Benutzerdefinierte Variablen von Pflichtenheften via Trigger löschen |
|
3 |
-- @depends: custom_variables_delete_via_trigger requirement_specs |
|
4 |
CREATE OR REPLACE FUNCTION delete_requirement_spec_custom_variables_trigger() RETURNS trigger AS $$ |
|
5 |
BEGIN |
|
6 |
DELETE FROM custom_variables WHERE (sub_module = '' OR sub_module IS NULL) |
|
7 |
AND trans_id = OLD.id |
|
8 |
AND (SELECT module FROM custom_variable_configs WHERE id = config_id) = 'RequirementSpecs'; |
|
9 |
|
|
10 |
RETURN OLD; |
|
11 |
END; |
|
12 |
$$ LANGUAGE plpgsql; |
|
13 |
|
|
14 |
DROP TRIGGER IF EXISTS delete_requirement_spec_custom_variables ON requirement_specs; |
|
15 |
|
|
16 |
CREATE TRIGGER delete_requirement_spec_custom_variables |
|
17 |
BEFORE DELETE ON requirement_specs |
|
18 |
FOR EACH ROW EXECUTE PROCEDURE delete_requirement_spec_custom_variables_trigger(); |
Auch abrufbar als: Unified diff
Pflichtenhefte: bendef. Var. beim Löschen des Pflichtenheftes via Trigger löschen