Skip to content
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

WithSchemaPlugin does not work with references() #134

Closed
rubenferreira97 opened this issue Aug 9, 2022 · 0 comments
Closed

WithSchemaPlugin does not work with references() #134

rubenferreira97 opened this issue Aug 9, 2022 · 0 comments
Labels
bug Something isn't working built-in plugin Related to a built-in plugin postgres Related to PostgreSQL

Comments

@rubenferreira97
Copy link

rubenferreira97 commented Aug 9, 2022

When I execute the following:

db.withPlugin(new WithSchemaPlugin('schema'))
  .schema
  .createTable('Accounts')
  .addColumn('userId', 'integer', (col) => col.references('Users.id'));

It compiles this sql:
create table "schema"."Accounts" ("userId" integer references "Users" ("id"));

Which correctly produces the following error: relation "Users" does not exist

Is it possible to add the schema like "schema"."Users" ("id");?

Don't know if this happens with db.schema.withSchema('schema').createTable(...) as well.

@igalklebanov igalklebanov added api Related to library's API enhancement New feature or request postgres Related to PostgreSQL bug Something isn't working built-in plugin Related to a built-in plugin and removed enhancement New feature or request api Related to library's API labels Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working built-in plugin Related to a built-in plugin postgres Related to PostgreSQL
Projects
None yet
Development

No branches or pull requests

2 participants