Skip to content

autoupdate with postgresql connector no longer creates tables before foreign keys #175

@ewrayjohnson

Description

@ewrayjohnson

Steps to reproduce

upgrade from "4.10.2" to "4.11.0"

On an empty database using a schema with many relations, from server.js call
app.datasources.pg.autoupdate();

The problem is foreign keys to tables are attempting to be added before the tables are created. I have never seen this before. For example, after the accesstoken table
is successfully created I get: [UnhandledPromiseRejectionWarning: error: relation "public.user" does not exist] because the connector is trying to add to accesstoken, a the foreign key to user which does not yet exist.

Expected Behavior

I expect tables to be created before the foreign key constraints that reference them.

Additional information

I did not explicitly upgrade, the upgrade likely came as a dependency (e.g. to loopback-datasource-juggler).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions