Skip to content

discoverSchema problems #65

@jmls

Description

@jmls

Using the discoverSchema api on a postgres database has a couple of issues

  1. relations: true does not work in the options object. You have to use associations: true instead
  2. association discovery only seems to work with belongsTo relations. The associated hasMany is not generated.

if my db has

Artist has a pk of ArtistID
Album has a fk of ArtistID

then I get

"relations": { "artist": { "model": "Artist", "type": "belongsTo", "foreignKey": "artistid" }

in my Album model, but

``relations: {}` in my Artist model

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions