runbot/runbot_merge/migrations/17.0.1.16/pre-migrations.py
Xavier Morel abf1298b1d [IMP] runbot_merge: add optional statuses on PRs
If a status is defined as `optional`, then the PR is considered valid
if the status is never sent, but *if* the status is sent then it
becomes required.

Note that as ever this is a per-commit requirement, so it's mostly
useful for conditional statuses.

Fixes #1062
2025-02-25 09:50:45 +01:00

13 lines
283 B
Python

def migrate(cr, _version):
cr.execute("""
ALTER TABLE runbot_merge_repository_status
ALTER COLUMN prs TYPE varchar;
UPDATE runbot_merge_repository_status
SET prs =
CASE prs
WHEN 'true' THEN 'required'
ELSE 'ignored'
END;
""")