KSDaemon/sails-hook-sequelize

Table schema changes are not updating

thephoenix-crypto opened this issue · 2 comments

I was trying to update the model, but after re-lifting the sails server, it is not getting updated in the database. Because it was trying to execute the create query instead of update schema even if the table exists also. Please try to suggest an immediate fix.

Please add a fix based on this merge for updating the schema alteration sequelize/sequelize#7230 to the following line in the library, which can solve the problem @KSDaemon

syncTasks.push(connections[connectionName].sync({ force: forceSync }));
currently if alter is enabled in model.js in sails, still it will delete the tables instead of altering it. because forceSync will be true.

But it should be to { force: false, alter: true}

Thanks.

seems to be fixed