Skip to content

Commit

Permalink
Update forge/db/migrations/20241209-01-remove-dead-instance-notificat…
Browse files Browse the repository at this point in the history
…ions.js

Co-authored-by: Nick O'Leary <[email protected]>
  • Loading branch information
hardillb and knolleary authored Dec 13, 2024
1 parent 3f983e4 commit 3344565
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ module.exports = {
deleteNotification(notification.id)
} else {
if (!foundProjects.includes(projectId)) {
const projectQuery = `SELECT count(*) from "Projects" WHERE "id" = '${projectId}' LIMIT 1;`
const [projectExits] = await context.sequelize.query(projectQuery)
if (projectExits[0] === 0) {
const projectQuery = `SELECT count(*) as c from "Projects" WHERE "id" = '${projectId}' LIMIT 1;`
const [[projectCount]] = await context.sequelize.query(projectQuery)
const count = parseInt(projectCount.c)
if (count === 0) {
// delete notification
deletedProjects.push(projectId)
deleteNotification(notification.id)
Expand Down

0 comments on commit 3344565

Please sign in to comment.