0

簡単にするために、顧客 1 -- * 注文があります。

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)

顧客モデルに注文を取り込む方法はありますか?

4

1 に答える 1