-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] runbot: improve min version management
- Loading branch information
Showing
3 changed files
with
74 additions
and
5 deletions.
There are no files selected for viewing
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,21 @@ | ||
def migrate(cr, version): | ||
cr.execute(""" | ||
WITH helper AS | ||
( | ||
SELECT v.id, | ||
( | ||
SELECT v2.id | ||
FROM runbot_version v2 | ||
WHERE Coalesce(v2.SEQUENCE, 9999) <= Coalesce(v.SEQUENCE, 9999) | ||
AND v2.number < v.number | ||
ORDER BY v2.SEQUENCE DESC, | ||
v2.number DESC limit 1 ) AS v_excluded | ||
FROM runbot_version v | ||
ORDER BY v.SEQUENCE DESC, | ||
v.NUMBER DESC ) | ||
UPDATE runbot_build_error | ||
SET tags_min_version_excluded_id = h.v_excluded | ||
FROM helper h | ||
WHERE h.id = tags_min_version_id; | ||
""") | ||
cr.execute("""ALTER TABLE runbot_build_error DROP COLUMN tags_min_version_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
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