Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrations: add migrations for module compatibility sorting
Add the "incompatible" column to both the modules and module_version_states tables in order to sort modules by compatibility whenever they are being displayed or processed. Updates golang/go#37714 Change-Id: I1f7b5dd55563b38af5c54a692b5e70512ef24c0e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/247404 Run-TryBot: Julie Qiu <julie@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
- Loading branch information
Miguel Acero
committed
Aug 10, 2020
1 parent
6ff8945
commit 7c159f5
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
migrations/000025_add_module_incomapatible_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,10 @@ | ||
-- Copyright 2020 The Go Authors. All rights reserved. | ||
-- Use of this source code is governed by a BSD-style | ||
-- license that can be found in the LICENSE file. | ||
|
||
BEGIN; | ||
|
||
ALTER TABLE modules DROP COLUMN incompatible; | ||
ALTER TABLE module_version_states DROP COLUMN incompatible; | ||
|
||
END; |
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,23 @@ | ||
-- Copyright 2020 The Go Authors. All rights reserved. | ||
-- Use of this source code is governed by a BSD-style | ||
-- license that can be found in the LICENSE file. | ||
|
||
BEGIN; | ||
|
||
ALTER TABLE modules ADD COLUMN incompatible boolean; | ||
ALTER TABLE module_version_states ADD COLUMN incompatible boolean; | ||
|
||
COMMENT ON COLUMN modules.incompatible IS | ||
'COLUMN incompatible defines whether the the version for the given module is incompatible'; | ||
COMMENT ON COLUMN module_version_states.incompatible IS | ||
'COLUMN incompatible defines whether the the version for the given module is incompatible'; | ||
|
||
CREATE INDEX idx_modules_incompatible on modules (incompatible); | ||
COMMENT ON INDEX idx_modules_incompatible IS | ||
'INDEX idx_modules_incompatible is used to sort versions if they are incompatible'; | ||
|
||
CREATE INDEX idx_module_version_states_incompatible on module_version_states (incompatible); | ||
COMMENT ON INDEX idx_module_version_states_incompatible IS | ||
'INDEX idx_module_version_states_incompatible is used to sort versions if they are incompatible'; | ||
|
||
END; |