Skip to content
Advertisement

Tag: constraints

Remove constraints in sequelize migration

I’m adding a unique constraint in a migration via the migrations.changeColumn function. Adding the constraint works, but since you need to provide a “backwards migration“, removing it the same way does not. It doesn’t give any errors when migrating backwards, but again applying the forward migration results in Possibly unhandled SequelizeDatabaseError: relation “myAttribute_unique_idx” already exists. (The used database is postgres)

Advertisement