- Notifications
You must be signed in to change notification settings - Fork 182
Closed
Description
Foreign Key Constraint in Postgres connector
Similar to the MySQL data connector, it would be great if the Postgres connector supported Foreign Key Constraints defined in LoopBack models. This would enforce referenced object to exist before adding relationship, and prevent deletion if the object is being referenced.
The foreignKeys
would be the same top level property for models compatible with MySQL
{ "name": "Project", "relations": { "account": { "type": "belongsTo", "model": "Account", "foreignKey": "accountId", "primaryKey": "id" } }, "foreignKeys": { "accountId": { "name": "accountId", "foreignKey": "accountId", "entityKey": "id", "entity": "Account" } } }
Additional information
For related MySQL issue see: loopbackio/loopback-connector-mysql#294
shehanrangana
Metadata
Metadata
Assignees
Labels
No labels