不要怂,就是干,撸起袖子干!

Commit a6f5a86e by Jan Aagaard Meier

Merge pull request #3984 from pranavrajs/master

[ci skip] 📝 Fixed errors in query
2 parents 377587a8 07867486
Showing with 3 additions and 3 deletions
...@@ -21,7 +21,7 @@ Post.findAll({ ...@@ -21,7 +21,7 @@ Post.findAll({
status: active status: active
} }
}); });
// SELECT * FROM post WHERE authorId = 12 // SELECT * FROM post WHERE authorId = 12 AND status = 'active';
Post.destroy({ Post.destroy({
where: { where: {
...@@ -31,7 +31,7 @@ Post.destroy({ ...@@ -31,7 +31,7 @@ Post.destroy({
// DELETE FROM post WHERE status = 'inactive'; // DELETE FROM post WHERE status = 'inactive';
Post.update({ Post.update({
deletedAt: null, updatedAt: null,
}, { }, {
where: { where: {
deletedAt: { deletedAt: {
...@@ -39,7 +39,7 @@ Post.update({ ...@@ -39,7 +39,7 @@ Post.update({
} }
} }
}); });
// UPDATE post SET updatedAt = null WHERE updatedAt NOT NULL; // UPDATE post SET updatedAt = null WHERE deletedAt NOT NULL;
``` ```
### Operators ### Operators
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!