0

To keep it simple I have a Customer 1 -- * Orders

Create table customers (
customer_id int,
offset_id int,
name text,
CONSTRAINT pk_customer_id PRIMARY KEY ( customer_id, offset_id )) 

Create table orders (
id int,
offset_id int,
name text,
customer_id int,
CONSTRAINT pk_order_id PRIMARY KEY ( id, offset_id ),
CONSTRAINT fk_orders_customerid FOREIGN KEY (customer_id, offset_id ) REFERENCES customer (customer_id, offset_id)

Is there any way to pull orders in to the customer model?

Kevin Hussey
  • 1,582
  • 1
  • 10
  • 17

1 Answers1

0

See:

How to create loopback 4 model, repository and controller without specifying an ID

To summarize: Loopback4 does not support composite keys out of the box according to their documentation.

Vikram Khemlani
  • 555
  • 6
  • 17