-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
database: Simplify
before update
trigger for the crates
table
We no longer need to filter out updates to the `downloads` columns since that column is no longer being written to and will be removed in a follow-up commit.
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
migrations/2024-03-04-144026_change-crates-updated-at-trigger/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
drop trigger trigger_crates_set_updated_at | ||
on crates; | ||
|
||
create trigger trigger_crates_set_updated_at | ||
before update | ||
on crates | ||
for each row | ||
execute procedure set_updated_at_ignore_downloads(); | ||
|
8 changes: 8 additions & 0 deletions
8
migrations/2024-03-04-144026_change-crates-updated-at-trigger/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
drop trigger trigger_crates_set_updated_at | ||
on crates; | ||
|
||
create trigger trigger_crates_set_updated_at | ||
before update | ||
on crates | ||
for each row | ||
execute procedure set_updated_at(); |