From 339c718b3251715c391d7812989a61c019d93b82 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 6 Aug 2024 11:41:02 -0500 Subject: [PATCH] fix: fix DELETE triggers for `meminfo`, `employees` whoops not sure how those got missed --- rattail_corepos/corepos/office/triggers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rattail_corepos/corepos/office/triggers.py b/rattail_corepos/corepos/office/triggers.py index b06be04..e0b16cf 100644 --- a/rattail_corepos/corepos/office/triggers.py +++ b/rattail_corepos/corepos/office/triggers.py @@ -222,7 +222,7 @@ class CoreTriggerHandler(GenericHandler): op_session.execute(sa.text(f""" CREATE TRIGGER record_meminfo_delete AFTER DELETE ON meminfo - FOR EACH ROW INSERT INTO {changes_table} (object_type, object_key, deleted) VALUES ('Member', CONVERT(OLD.card_no, CHAR)); + FOR EACH ROW INSERT INTO {changes_table} (object_type, object_key, deleted) VALUES ('Member', CONVERT(OLD.card_no, CHAR), 1); """)) def create_triggers_employees(self, op_session, changes_table): @@ -242,7 +242,7 @@ class CoreTriggerHandler(GenericHandler): op_session.execute(sa.text(f""" CREATE TRIGGER record_employees_delete AFTER DELETE ON employees - FOR EACH ROW INSERT INTO {changes_table} (object_type, object_key, deleted) VALUES ('Employee', CONVERT(OLD.emp_no, CHAR)); + FOR EACH ROW INSERT INTO {changes_table} (object_type, object_key, deleted) VALUES ('Employee', CONVERT(OLD.emp_no, CHAR), 1); """)) def create_triggers_departments(self, op_session, changes_table):