cli
cli copied to clipboard
feat: add ERROR detail to output of migration
Pull Request check-list
- [x] Does
npm run testpass with this change (including linting)? - [x] Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
- [ ] Have you added new tests to prevent regressions?
- [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
Description of change
close https://github.com/sequelize/cli/issues/1138
This PR adds additional error output. Currently the error output may be insufficient to hone in on the problem.
https://www.postgresql.org/docs/current/plpgsql-errors-and-messages.html
Desired behaviour -
ERROR: SequelizeForeignKeyConstraintError: insert or update on table "my_table" violates foreign key constraint "...."
ERROR DETAIL: Key (my_column)=(1) is not present in table "my_table"
Alternatives
Behind a debug flag. My initial hunch is to consider this a helpful feature that users get out of the box. Happy to put behind a debug flag though!
Hi! Thanks for the PR! I haven't given the alternative more thought yet, but can you add one or more tests for this? More tests is especially preferred if on some cases more information is given that might be considered confidential
@WikiRik Gave a quick look around and not seeing a good extension point for this test. Do you happen to know of a place?
The changes just returning void and hard to test, maybe to test the detail property existence? @WikiRik
@snewcomer sorry for not responding before, I took a look as well and we do not really have any tests to check our error behaviour. We'll add that in a later stage. For now, this is fine
Thanks for the PR!
:tada: This PR is included in version 6.5.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket: