我使用 sqlite3 作为我的数据库并使用“sequelize”库来处理它。我有一个模块,想在截断它后重置 autoIncrement 主键。
var logModule = db.logModule()
logModule.destroy({
where:{},
truncate: true
})
Run Code Online (Sandbox Code Playgroud)
但我发现这种方式只是清除我表中的所有记录,并没有将 autoIncrement promary key 重置为零。
清除表中的所有记录后,有没有办法重置主键?