sequelize undo last migration
// You can use db:migrate:undo, this command will revert most recent migration.
npx sequelize-cli db:migrate:undo
sequelize undo last migration
// You can use db:migrate:undo, this command will revert most recent migration.
npx sequelize-cli db:migrate:undo
force delete and restore in sequelize
// Example showing the instance `restore` method
// We create a post, soft-delete it and then restore it back
const post = await Post.create({ title: 'test' });
console.log(post instanceof Post); // true
await post.destroy();
console.log('soft-deleted!');
await post.restore();
console.log('restored!');
// Example showing the static `restore` method.
// Restoring every soft-deleted post with more than 100 likes
await Post.restore({
where: {
likes: {
[Op.gt]: 100
}
}
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us