-
Notifications
You must be signed in to change notification settings - Fork 207
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
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
.sqlx/query-23c1c88674c09e208738ebdd705db4c30d6dba6e24ca6c7c7fbf06d49d40994f.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
.sqlx/query-682dd9adacb3841d81633bb918bcfffb0d87d017a75e82b070ea493023a8d0f6.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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