2023-07-09 04:21:12 +00:00
|
|
|
create trigger if not exists update_last_updated_users
|
|
|
|
after update on users
|
2023-04-27 22:22:49 +00:00
|
|
|
when OLD.last_updated = NEW.last_updated or OLD.last_updated is null
|
|
|
|
BEGIN
|
2023-07-09 04:21:12 +00:00
|
|
|
update users set last_updated = (select unixepoch()) where id=NEW.id;
|
2023-04-27 22:22:49 +00:00
|
|
|
END;
|
|
|
|
|
|
|
|
create trigger if not exists update_last_updated_watches
|
|
|
|
after update on watches
|
|
|
|
when OLD.last_updated = NEW.last_updated or OLD.last_updated is null
|
|
|
|
BEGIN
|
|
|
|
update watches set last_updated = (select unixepoch()) where id=NEW.id;
|
|
|
|
END;
|
|
|
|
|
2023-07-09 05:00:26 +00:00
|
|
|
create trigger if not exists update_last_updated_watch_quests
|
|
|
|
after update on watch_quests
|
2023-04-27 22:22:49 +00:00
|
|
|
when OLD.last_updated = NEW.last_updated or OLD.last_updated is null
|
|
|
|
BEGIN
|
2023-07-09 05:00:26 +00:00
|
|
|
update watch_quests set last_updated = (select unixepoch()) where id=NEW.id;
|
2023-04-27 22:22:49 +00:00
|
|
|
END;
|
|
|
|
|
2023-07-09 05:00:26 +00:00
|
|
|
create trigger if not exists update_last_updated_follows
|
|
|
|
after update on follows
|
2023-04-27 22:22:49 +00:00
|
|
|
when OLD.last_updated = NEW.last_updated or OLD.last_updated is null
|
|
|
|
BEGIN
|
2023-07-09 05:00:26 +00:00
|
|
|
update follows set last_updated = (select unixepoch()) where id=NEW.id;
|
2023-04-27 22:22:49 +00:00
|
|
|
END;
|
|
|
|
|
|
|
|
create trigger if not exists update_last_updated_watch_notes
|
|
|
|
after update on watch_notes
|
|
|
|
when OLD.last_updated = NEW.last_updated or OLD.last_updated is null
|
|
|
|
BEGIN
|
|
|
|
update watch_notes set last_updated = (select unixepoch()) where id=NEW.id;
|
|
|
|
END;
|