Make jobs unique by commit
Given that a commit, regardless of what repository it comes from should contain the same exactly the same data, just track jobs by commit.
This commit is contained in:
parent
f980b6c2ac
commit
b30904e1af
4 changed files with 46 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
-- Deploy guix-data-service:load_new_guix_revision_jobs_make_commits_unique to pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP INDEX load_new_guix_revision_jobs_commit_git_repository_id_idx;
|
||||
|
||||
DELETE FROM load_new_guix_revision_job_events
|
||||
WHERE job_id NOT IN (
|
||||
SELECT DISTINCT ON (commit) id
|
||||
FROM load_new_guix_revision_jobs
|
||||
ORDER BY commit, succeeded_at ASC NULLS LAST, created_at ASC
|
||||
)
|
||||
|
||||
DELETE FROM load_new_guix_revision_job_logs
|
||||
WHERE job_id NOT IN (
|
||||
SELECT DISTINCT ON (commit) id
|
||||
FROM load_new_guix_revision_jobs
|
||||
ORDER BY commit, succeeded_at ASC NULLS LAST, created_at ASC
|
||||
);
|
||||
|
||||
DELETE FROM load_new_guix_revision_jobs
|
||||
WHERE id NOT IN (
|
||||
SELECT DISTINCT ON (commit) id
|
||||
FROM load_new_guix_revision_jobs
|
||||
ORDER BY commit, succeeded_at ASC NULLS LAST, created_at ASC
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX load_new_guix_revision_jobs_commit_idx
|
||||
ON load_new_guix_revision_jobs (commit);
|
||||
|
||||
COMMIT;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
-- Revert guix-data-service:load_new_guix_revision_jobs_make_commits_unique from pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
-- XXX Add DDLs here.
|
||||
|
||||
COMMIT;
|
||||
|
|
@ -55,3 +55,4 @@ make_some_constraints_deferrable 2020-02-16T10:54:22Z Christopher Baines <mail@c
|
|||
guix_revision_system_test_derivations_add_system 2020-03-19T21:30:33Z Christopher Baines <mail@cbaines.net> # Add a system column to the guix_revision_system_test_derivations table
|
||||
drop_package_versions_by_guix_revision_range 2020-03-24T20:40:38Z Christopher Baines <mail@cbaines.net> # Drop package_versions_by_guix_revision_range
|
||||
create_narinfo_fetch_records_index 2020-03-25T19:07:28Z Christopher Baines <mail@cbaines.net> # Create an index on narinfo_fetch_records
|
||||
load_new_guix_revision_jobs_make_commits_unique 2020-03-27T21:38:42Z Christopher Baines <mail@cbaines.net> # Make load_new_guix_revision_jobs commits unique
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
-- Verify guix-data-service:load_new_guix_revision_jobs_make_commits_unique on pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
-- XXX Add verifications here.
|
||||
|
||||
ROLLBACK;
|
||||
Loading…
Add table
Add a link
Reference in a new issue