00__recreate_triggers.sql 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. DROP TRIGGER IF EXISTS `trigger_update_user_modification_time`;
  2. CREATE TRIGGER IF NOT EXISTS `trigger_update_user_modification_time`
  3. AFTER
  4. UPDATE
  5. ON `user` FOR EACH ROW BEGIN
  6. UPDATE
  7. `user`
  8. SET
  9. updated_ts = (strftime('%s', 'now'))
  10. WHERE
  11. rowid = old.rowid;
  12. END;
  13. DROP TRIGGER IF EXISTS `trigger_update_memo_modification_time`;
  14. CREATE TRIGGER IF NOT EXISTS `trigger_update_memo_modification_time`
  15. AFTER
  16. UPDATE
  17. ON `memo` FOR EACH ROW BEGIN
  18. UPDATE
  19. `memo`
  20. SET
  21. updated_ts = (strftime('%s', 'now'))
  22. WHERE
  23. rowid = old.rowid;
  24. END;
  25. DROP TRIGGER IF EXISTS `trigger_update_shortcut_modification_time`;
  26. CREATE TRIGGER IF NOT EXISTS `trigger_update_shortcut_modification_time`
  27. AFTER
  28. UPDATE
  29. ON `shortcut` FOR EACH ROW BEGIN
  30. UPDATE
  31. `shortcut`
  32. SET
  33. updated_ts = (strftime('%s', 'now'))
  34. WHERE
  35. rowid = old.rowid;
  36. END;
  37. DROP TRIGGER IF EXISTS `trigger_update_resource_modification_time`;
  38. CREATE TRIGGER IF NOT EXISTS `trigger_update_resource_modification_time`
  39. AFTER
  40. UPDATE
  41. ON `resource` FOR EACH ROW BEGIN
  42. UPDATE
  43. `resource`
  44. SET
  45. updated_ts = (strftime('%s', 'now'))
  46. WHERE
  47. rowid = old.rowid;
  48. END;