Skip to content

Commit

Permalink
Fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mzparacha committed Oct 16, 2024
1 parent af89214 commit 7fcc815
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
module.exports = {
up: async (queryInterface, Sequelize) => {
return queryInterface.sequelize.transaction(async (t) => {
await queryInterface.removeConstraint(
'GroupPermissions',
'GroupPermissions_pkey',
{ transaction: t },
);

await queryInterface.removeConstraint(
'GroupPermissions',
'GroupPermissions_group_id_fkey',
Expand Down Expand Up @@ -38,9 +44,9 @@ module.exports = {
);

await queryInterface.addConstraint('GroupPermissions', {
type: 'unique',
type: 'primary key',
fields: ['group_id', 'topic_id'],
name: 'GroupPermissions_unique_composite_constraint',
name: 'GroupPermissions_pkey',
transaction: t,
});
});
Expand Down

0 comments on commit 7fcc815

Please sign in to comment.