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
Postgres needs Schema Name with Table Name when defining FK Constraints #9029
Comments
Are you sure you are using v4, |
I realized that the other day; the boilerplate was created by |
I think this is related to, if not the same issue as, #2464? |
…e table statements (sequelize#9029) (sequelize#2464)
What are you doing?
Trying to create a table in a particular schema. The table contains an FK referencing another table in that schema.
Source Table
Batch Table
Loader
What do you expect to happen?
When the DDL for each table is generated, the names of other tables ought to be prefixed with the schema name. In most places where table names appear, this is true. For example, Sources is generated properly:
What is actually happening?
When Batches is generated, the referential portion of the definition of
sourceLMS
, the column that is an FK on Sources, does not prefix the table name with the schema name. The result is that the DBMS throws an error. This is the DDL that is generated for Batches:Output, either JSON or SQL
Shell output:
Dialect: postgres
Dialect version: 9.5.2
Database version: 9.5.2
Sequelize version: 4.32.3
Tested with latest release: yes
The text was updated successfully, but these errors were encountered: