This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the patch moved between Patchwork projects during the time it's being tested, it gets stuck in the pending patch table. Since patch IDs are unique per instance (and don't depend on the project), change the pending patch table to contain Patchwork instance's base URL in addition to ID of (base URL, patch ID) pair. This solves the problem with patch removal from pending table, while keeps the original information needed for proper testing. Also introduce a way to migrate the database after upgrades since it's needed for this change. Fixes #57 Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
- Loading branch information
Showing
4 changed files
with
48 additions
and
23 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
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,14 @@ | ||
CREATE TABLE pendingpatches_new(id INTEGER, pdate TEXT, patchsource_id INTEGER, | ||
timestamp INTEGER, baseurl TEXT, | ||
PRIMARY KEY (id, baseurl), | ||
FOREIGN KEY(patchsource_id) | ||
REFERENCES patchsource(id)); | ||
|
||
INSERT INTO pendingpatches_new(id, pdate, patchsource_id, timestamp, baseurl) | ||
SELECT pendingpatches.id, pendingpatches.pdate, patchsource.id, | ||
pendingpatches.timestamp, patchsource.baseurl | ||
FROM pendingpatches, patchsource | ||
WHERE pendingpatches.patchsource_id = patchsource.id; | ||
|
||
DROP TABLE pendingpatches; | ||
ALTER TABLE pendingpatches_new RENAME TO pendingpatches; |
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