In Sequelize, I am using this function model.destory({ truncate: true }), it delete all data in table. But the issue is that it does not reset the primary key sequence in table which should be set to Zero. I am using Mysql. Some said that Mysql automatically reset the primary key sequence, but it is not happening in my case.
Here is my code:
db.Booking.destroy({ truncate: { cascade: false } })
.then(() => {
res.json({ status: true });
}, (err) => {
console.log('truncate: ', err);
res.json(err);
});