-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for long crate-names & versions, fix reverse migration & com…
…ment it
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
migrations/20240519141105_crate-version-name-field-length.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 |
---|---|---|
@@ -1,2 +1,10 @@ | ||
-- this reverse migration might fail when we have other records | ||
-- referencing releases with longer names or versions. | ||
-- If this has to be reverted we probably would have to manually run | ||
-- db::delete::delete_crate and db::delete::delete_version for the releases | ||
-- and crates. | ||
DELETE FROM crates WHERE LENGTH(name) > 255; | ||
DELETE FROM releases WHERE LENGTH(version) > 100; | ||
|
||
ALTER TABLE crates ALTER COLUMN name TYPE VARCHAR(255); | ||
ALTER TABLE releases ALTER COLUMN version TYPE VARCHAR(100); |
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