Unify migration script Koji 1.31 -> 1.32

Fixes: https://pagure.io/koji/issue/3696
This commit is contained in:
Jana Cupova 2023-02-17 22:23:44 +01:00
parent 6fb0922c71
commit 4721facaa1
2 changed files with 5 additions and 13 deletions

View file

@ -1,13 +0,0 @@
-- upgrade script to migrate the Koji database schema
-- from version 1.31 to 1.32
BEGIN;
-- fix duplicate extension in archivetypes
UPDATE archivetypes SET extensions = 'vhdx.gz vhdx.xz' WHERE name = 'vhdx-compressed';
-- for tag if session is closed or not
ALTER TABLE sessions ADD COLUMN closed BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE sessions ADD CONSTRAINT no_closed_exclusive CHECK (closed IS FALSE OR "exclusive" IS NULL);
ALTER TABLE sessions DROP CONSTRAINT exclusive_expired_sane;
COMMIT;

View file

@ -6,6 +6,11 @@ BEGIN;
-- fix duplicate extension in archivetypes
UPDATE archivetypes SET extensions = 'vhdx.gz vhdx.xz' WHERE name = 'vhdx-compressed';
-- for tag if session is closed or not
ALTER TABLE sessions ADD COLUMN closed BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE sessions ADD CONSTRAINT no_closed_exclusive CHECK (closed IS FALSE OR "exclusive" IS NULL);
ALTER TABLE sessions DROP CONSTRAINT exclusive_expired_sane;
-- track checksum of rpms
CREATE TABLE rpm_checksum (
rpm_id INTEGER NOT NULL REFERENCES rpminfo(id),