0

I am facing an issue in sequelize sync when alter: true with MySQL connection

node :- 14.X
mssql :- 2018
sequalize : v6

Case:

model: userAuthSettings has a default value and I have started the app a second time sequalize migration is alter:true

Error:

Executing (default): ALTER TABLE [userAuthSettings] ALTER COLUMN [loginRetryLimit] INTEGER DEFAULT 0;

node-app | /home/node/app/node_modules/sequelize/lib/dialects/mssql/query.js:314
node-app | return new sequelizeErrors.DatabaseError(err);
node-app | ^
node-app |
node-app | DatabaseError [SequelizeDatabaseError]: Incorrect syntax near the keyword 'DEFAULT'.

NOTE: I know it is sequelize issue but does anyone have a solution?

I need a solution in sequalize orm, how to solve this issue?

bhavesh
  • 453
  • 3
  • 11
  • Covered in [Changing default value with changeColumn does not work in SQL Server #7403](https://github.com/sequelize/sequelize/issues/7403) which references [Modify Default value in SQL Server](https://stackoverflow.com/a/15547375/390122) and [How do you drop a default value or similar constraint in T-SQL?](https://stackoverflow.com/a/1124357/390122) The fix is to remove the existing constraint and then add a replacement. – AlwaysLearning Dec 09 '21 at 00:16
  • @AlwaysLearning this error is generated by sequalize orm , i know the right query but is there any solution to get out from this because it is SEQUALIZE ORM issue – bhavesh Dec 13 '21 at 10:14

0 Answers0