New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(postgres): use schema set in sequelize config by default #14634
fix(postgres): use schema set in sequelize config by default #14634
Conversation
@mike-usa this might be interesting for you |
Hi @nholmes3, thanks for the PR! Could you add some tests for this? Where you test the normal 'public' schema but also a custom schema |
This comment was marked as outdated.
This comment was marked as outdated.
This change does not exclusively impact postgres. I think these files would be better places to add the tests to: https://github.com/sequelize/sequelize/tree/main/test/unit/sql. I would say add at test in: The test should use a custom sequelize instance which sets a default schema, and ensure the generated SQL uses that schema. This test also impacts describeTable, so a similar test should be added in https://github.com/sequelize/sequelize/blob/main/test/integration/query-interface/describeTable.test.js |
@ephys I have added tests to add-column and remove-column, and I have also added a unit test covering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The describeTable
integration test can be skipped because we already have an integration test that checks the query that includes schemas is valid, so the unit test you added is sufficient :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
@WikiRik if it's ok for you too, we can merge
Here we go :) |
We can make a new alpha release of v7 if you want, but if you want this in v6 we would like to ask you to make a new PR for that. |
@WikiRik I would prefer to get this in v6. I checked the documentation for contributing and I don't see any explicit instructions for how to create a pull request for a release. Can you please provide additional guidance? |
Just make a new branch from |
🎉 This PR is included in version 7.0.0-alpha.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request Checklist
Please make sure to review and check all of these items:
yarn test
oryarn test-DIALECT
pass with this change (including linting)?Description Of Change
This is an attempt at fixing a bug where the Postgres Query Generator does not respect a custom schema name if it is provided.
This comment on Issue #248 of sequelize/cli describes the problem in detail.