You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Postgres: Schema does not default to current schema for references when model is set only on parent model #11276
dialect: postgresFor issues and PRs. Things that involve PostgreSQL (and do not involve all dialects).releasedtype: bugDEPRECATED: replace with the "bug" issue type
I need to switch schemas dynamically for multi tenancy in an application and when I change the schema for a model, I would like sequalize to default to that schema also for references and indexes. This is not the case yet and I would consider this a bug as it's the only sensible default behaviour.
The main point where this happens is when I call sync({ schema: 'archive' }) on a model,
What do you expect to happen?
Sequalize to default to the schema of the model I'm using.
What is actually happening?
If I sync a model into a schema for example (I have used sync({ schema: 'archive' }) on the models before), for references the current schema is not applied but no schema prefix at all.
Environment
Dialect:
mysql
postgres
sqlite
mssql
any
Dialect library version: XXX
Database version: XXX
Sequelize version: XXX
Node Version: XXX
OS: XXX
If TypeScript related: TypeScript version: XXX
Tested with latest release:
v5.18.2 Regression partially reverts previous fix #11274 for me. This seems not to be covered by the test I have introduced. The problem is that schemas are not attached for implicit joins now.
What shall we do? Should I propose a new test for this? Or can we revert to my solution?
dialect: postgresFor issues and PRs. Things that involve PostgreSQL (and do not involve all dialects).releasedtype: bugDEPRECATED: replace with the "bug" issue type
Activity
sushantdhiman commentedon Aug 31, 2019
🎉 This issue has been resolved in version 5.18.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
vanthome commentedon Aug 31, 2019
thx!
vanthome commentedon Sep 11, 2019
@sushantdhiman
v5.18.2 Regression partially reverts previous fix #11274 for me. This seems not to be covered by the test I have introduced. The problem is that schemas are not attached for implicit joins now.
What shall we do? Should I propose a new test for this? Or can we revert to my solution?
sushantdhiman commentedon Sep 12, 2019
New PR with tests will do