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

Commit 4903041f by Mousset Axel

Update query.js

Regex does not match the following error: ```Sql
Cannot add or update a child row: a foreign key constraint fails (`database`.`Table`, CONSTRAINT `Table_ibfk_1` FOREIGN KEY (`ForeignKey`) REFERENCES `OtherTable` (`id`) ON DELETE SET NULL ON UPDATE CASCADE)
```
Addionnal text like "ON DELETE SET NULL ON UPDATE CASCADE" was not handled by the regex.
1 parent c55127b2
Showing with 1 additions and 1 deletions
...@@ -72,7 +72,7 @@ module.exports = (function() { ...@@ -72,7 +72,7 @@ module.exports = (function() {
}); });
case 1452: case 1452:
match = err.message.match(/FOREIGN KEY \(`(.*)`\) REFERENCES `(.*)` \(`(.*)`\)\)$/); match = err.message.match(/FOREIGN KEY \(`(.*)`\) REFERENCES `(.*)` \(`(.*)`\)(.*)\)$/);
return new sequelizeErrors.ForeignKeyConstraintError({ return new sequelizeErrors.ForeignKeyConstraintError({
fields: null, fields: null,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!