-- @tag: remove_obsolete_trigger
-- @description: Entfernt veraltete Trigger check_inventory
--- @depends: release_3_2_0
--- @encoding: utf-8
-- drop triggers
DROP TRIGGER IF EXISTS check_inventory ON oe;
-- @tag: taxzone_id_in_oe_delivery_orders
-- @description: Werte für Inland in Spalte taxzone_id in Tabellen oe und delivery_orders in Foreign Key zu tax_zones konvertieren; NULL-Werte in ap/ar verhindern; Spalten NOT NULL setzen
--- @depends: change_taxzone_id_0
+-- @depends: change_taxzone_id_0 remove_obsolete_trigger
UPDATE oe SET taxzone_id = (SELECT id FROM tax_zones WHERE description = 'Inland') WHERE (taxzone_id = 0) OR (taxzone_id IS NULL);
UPDATE delivery_orders SET taxzone_id = (SELECT id FROM tax_zones WHERE description = 'Inland') WHERE (taxzone_id = 0) OR (taxzone_id IS NULL);