strongloop / strong-arc

StrongLoop Arc has been replaced by API Connect. We recommend Arc users move to the Essentials edition of API Connect. If you have questions, please email reachsl@us.ibm.com.
http://strongloop.com/
Other
114 stars 36 forks source link

Arc doesn't create Relations after model discovery from Postgres #776

Open lee-40square opened 9 years ago

lee-40square commented 9 years ago

Using Strong Studio to discover models from a Postgres database, Studio is not adding the relations to the Loopback models.

Here's the dump

db_dump | uploaded via ZenHub

raymondfeng commented 9 years ago

The runtime does allow discovery to follow PK/FK (if options.relations === true). See https://github.com/strongloop/loopback-datasource-juggler/blob/master/lib/datasource.js#L1199.

strong-arc UI needs to provide a checkbox for the flag. After discovery, it should also allow developers to refine relation types. PK/FK doesn't provide enough information to tell if it's belongsTo, hasOne, or hasMany.