Skip to content

Commit

Permalink
Adds insights cleanup for missing projects
Browse files Browse the repository at this point in the history
  • Loading branch information
bomoko committed Jan 9, 2024
1 parent 013fc11 commit 367a1af
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ exports.up = function(knex) {
DELETE ef
FROM environment_fact ef
LEFT JOIN environment e ON ef.environment = e.id
WHERE e.id IS NULL OR e.deleted != '0000-00-00 00:00:00'
WHERE e.id IS NULL OR e.deleted != '0000-00-00 00:00:00' OR e.project not in (select id from project)
`),
knex.schema.raw(`
DELETE ep
FROM environment_problem ep
LEFT JOIN environment e ON ep.environment = e.id
WHERE e.id IS NULL OR e.deleted != '0000-00-00 00:00:00'
WHERE e.id IS NULL OR e.deleted != '0000-00-00 00:00:00' OR e.project not in (select id from project)
`),
]);
]);
};

/**
Expand Down

0 comments on commit 367a1af

Please sign in to comment.