Skip to content

Commit

Permalink
feat: add migration files for index (#2282)
Browse files Browse the repository at this point in the history
Co-authored-by: KishenKumarrrrr <[email protected]>
  • Loading branch information
KishenKumarrrrr and KishenKumarrrrr authored Nov 4, 2024
1 parent 2cc4ccb commit 9af25fe
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.addIndex('email_messages', {
name: 'email_messages_campaign_id_status_error_code',
fields: ['campaign_id', 'status', 'error_code'],
concurrently: true,
})
},

down: async (queryInterface, Sequelize) => {
await queryInterface.removeIndex('email_messages', 'email_messages_campaign_id_status_error_code')
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.removeIndex('email_messages', 'email_messages_campaign_id')
},

down: async (queryInterface, Sequelize) => {
await queryInterface.addIndex('email_messages', {
name: 'email_messages_campaign_id',
fields: ['campaign_id'],
concurrently: true,
})
}
};

0 comments on commit 9af25fe

Please sign in to comment.