Skip to content

database: Simplify trigger_versions_set_updated_at trigger on the versions table #3993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- remove the new trigger
DROP TRIGGER trigger_versions_set_updated_at ON versions;

-- add the old trigger again
CREATE TRIGGER trigger_versions_set_updated_at
BEFORE UPDATE
ON versions
FOR EACH ROW
EXECUTE PROCEDURE set_updated_at_ignore_downloads();
9 changes: 9 additions & 0 deletions migrations/2021-10-08-113656_simplify_versions_trigger/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- remove the old trigger
DROP TRIGGER trigger_versions_set_updated_at ON versions;

-- add the new trigger only for the `yanked` column
CREATE TRIGGER trigger_versions_set_updated_at
BEFORE UPDATE OF yanked
ON versions
FOR EACH ROW
EXECUTE PROCEDURE set_updated_at();