Avoid erroring when processing emails again
These changes allow processing emails again, and just creating job and branch entries where data is missing.
This commit is contained in:
parent
712dd377a1
commit
9e80bda4f9
7 changed files with 84 additions and 5 deletions
|
|
@ -0,0 +1,25 @@
|
|||
-- Deploy guix-data-service:remove_duplicate_load_new_guix_revision_jobs to pg
|
||||
|
||||
BEGIN;
|
||||
|
||||
DELETE FROM load_new_guix_revision_job_events WHERE job_id NOT IN (
|
||||
SELECT MIN(id) FROM load_new_guix_revision_jobs
|
||||
GROUP BY commit, git_repository_id
|
||||
);
|
||||
|
||||
DELETE FROM load_new_guix_revision_job_logs WHERE job_id NOT IN (
|
||||
SELECT MIN(id) FROM load_new_guix_revision_jobs
|
||||
GROUP BY commit, git_repository_id
|
||||
);
|
||||
|
||||
DELETE FROM load_new_guix_revision_jobs WHERE id NOT IN (
|
||||
SELECT MIN(id) FROM load_new_guix_revision_jobs
|
||||
GROUP BY commit, git_repository_id
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX ON load_new_guix_revision_jobs (
|
||||
commit,
|
||||
git_repository_id
|
||||
);
|
||||
|
||||
COMMIT;
|
||||
Loading…
Add table
Add a link
Reference in a new issue