user_update.sql 205 B

123456789
  1. DROP TRIGGER IF EXISTS `user_update`;
  2. CREATE TRIGGER `user_update`
  3. BEFORE UPDATE ON `users`
  4. FOR EACH ROW BEGIN
  5. SET new.date_modified = NOW();
  6. UPDATE sessions
  7. SET u_id = new.id
  8. WHERE u_id = old.id;
  9. END;