-
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: Remove
crates.downloads
column
- Loading branch information
Showing
4 changed files
with
11 additions
and
7 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
migrations/2024-03-04-144536_remove-downloads-column/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 @@ | ||
alter table crates | ||
add column downloads integer not null default 0; | ||
|
||
-- The following query can take a couple of seconds so it should be run manually | ||
-- outside of the migration to prevent the server from taking a long time to | ||
-- start up while waiting for the migration to complete. | ||
|
||
-- update crates | ||
-- set downloads = (select downloads from crate_downloads where crate_downloads.crate_id = crates.id); |
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,2 @@ | ||
alter table crates | ||
drop column downloads; |
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
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