m&tra
m&tra
DTDrizzle Team
Created by m&tra on 1/20/2024 in #help
Creating triggers with SQLite
How is everyone handling trigger statements at the moment? I've tried adding something like:
CREATE TRIGGER `new_user` AFTER INSERT ON `users` BEGIN
INSERT INTO `user_org` (`user_id`, `org_id`) VALUES (NEW.id, last_insert_rowid ());
END;
CREATE TRIGGER `new_user` AFTER INSERT ON `users` BEGIN
INSERT INTO `user_org` (`user_id`, `org_id`) VALUES (NEW.id, last_insert_rowid ());
END;
to the generated migration file, but it never ended up working properly. Are we supposed to just make transaction or batch functions instead?
10 replies