fc-common: add database migration for extended build status codes

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0c13eda985d634e63189ba6907e488ae6a6a6964
This commit is contained in:
raf 2026-02-16 12:58:28 +03:00
commit f4772036ce
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF

View file

@ -0,0 +1,26 @@
-- Extended build status codes to match Hydra
-- Update the builds table CHECK constraint to include all new statuses
ALTER TABLE builds DROP CONSTRAINT builds_status_check;
ALTER TABLE builds ADD CONSTRAINT builds_status_check CHECK (
status IN (
'pending',
'running',
'succeeded',
'failed',
'dependency_failed',
'aborted',
'cancelled',
'failed_with_output',
'timeout',
'cached_failure',
'unsupported_system',
'log_limit_exceeded',
'nar_size_limit_exceeded',
'non_deterministic'
)
);
-- Add index on status for faster filtering
CREATE INDEX IF NOT EXISTS idx_builds_status ON builds(status);