Skip to content

Commit

Permalink
chore: index notifications table (#1275)
Browse files Browse the repository at this point in the history
* chore: index notifications table

* fix: await addindex separately
  • Loading branch information
alexanderleegs authored Apr 8, 2024
1 parent 5d29051 commit 771c572
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/database/migrations/20240405132731-add-notification-indexes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addIndex(
"notifications", // name of Source model
["site_id", "user_id"]
)
await queryInterface.addIndex(
"notifications", // name of Source model
["user_id"]
)
},

async down(queryInterface, Sequelize) {
await queryInterface.removeIndex(
"notifications", // name of Source model
["site_id", "user_id"]
)
await queryInterface.removeIndex(
"notifications", // name of Source model
["user_id"]
)
},
}

0 comments on commit 771c572

Please sign in to comment.