This will hopefully provide a less expensive way of finding out if a scheduled build is probably blocked by other builds failing or being canceled. By working this out when the build events are recieved, it should be more feasible to include information about whether builds are likely blocked or not in various places (e.g. revision comparisons).
19 lines
703 B
PL/PgSQL
19 lines
703 B
PL/PgSQL
-- Deploy guix-data-service:blocked_builds to pg
|
|
|
|
BEGIN;
|
|
|
|
CREATE TABLE blocked_builds (
|
|
build_server_id integer NOT NULL REFERENCES build_servers (id),
|
|
blocked_derivation_output_details_set_id integer NOT NULL REFERENCES derivation_output_details_sets (id),
|
|
blocking_derivation_output_details_set_id integer NOT NULL REFERENCES derivation_output_details_sets (id),
|
|
PRIMARY KEY (
|
|
build_server_id,
|
|
blocked_derivation_output_details_set_id,
|
|
blocking_derivation_output_details_set_id
|
|
)
|
|
) PARTITION BY LIST (build_server_id);
|
|
|
|
CREATE INDEX blocked_builds_blocked_derivation_output_details_set_id
|
|
ON blocked_builds (build_server_id, blocked_derivation_output_details_set_id);
|
|
|
|
COMMIT;
|