update migrations 3

This commit is contained in:
Flatlogic Bot 2026-04-13 06:00:45 +00:00
parent 2790d7cba4
commit e9d86caf3e

View File

@ -1,3 +1,5 @@
ALTER TABLE `committees` ADD COLUMN `created_by` INT DEFAULT NULL;
ALTER TABLE `committees` ADD CONSTRAINT `fk_committees_created_by` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL;
CREATE TRIGGER `before_insert_accounting_accounts` BEFORE INSERT ON `accounting_accounts` FOR EACH ROW BEGIN IF @app_user_id IS NOT NULL THEN SET NEW.created_by = @app_user_id; SET NEW.updated_by = @app_user_id; END IF; END;
CREATE TRIGGER `before_update_accounting_accounts` BEFORE UPDATE ON `accounting_accounts` FOR EACH ROW BEGIN IF @app_user_id IS NOT NULL THEN SET NEW.updated_by = @app_user_id; END IF; END;
CREATE TRIGGER `before_insert_accounting_journal` BEFORE INSERT ON `accounting_journal` FOR EACH ROW BEGIN IF @app_user_id IS NOT NULL THEN SET NEW.created_by = @app_user_id; SET NEW.updated_by = @app_user_id; END IF; END;