Probably don't need to index the comment count

This commit is contained in:
Your Name 2024-09-27 12:52:55 -04:00
parent 19a35e6060
commit db3478a473
1 changed files with 0 additions and 18 deletions

View File

@ -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) {