Skip to content

Commit

Permalink
Probably don't need to index the comment count
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Sep 27, 2024
1 parent 19a35e6 commit db3478a
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions server/core/initializers/migrations/0870-video-comment-count.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,6 @@ async function up (utils: {
defaultValue: 0
}, { transaction })
}

{
// 5. Create the index - check if we are inside a transaction
const isInTransaction = !!transaction;
if (isInTransaction) {
// Create the index without 'concurrently' if in a transaction
await utils.queryInterface.addIndex('videoComment', ['videoId'], {
name: 'comments_video_id_idx',
transaction
});
} else {
// Create the index concurrently if no transaction
await utils.queryInterface.addIndex('videoComment', ['videoId'], {
concurrently: true,
name: 'comments_video_id_idx'
});
}
}
}

function down (options) {
Expand Down

0 comments on commit db3478a

Please sign in to comment.