I have data spread across two tables shipments
and shipment_data
. Currently I have the standard auto increment primary key id
for shipments
and a manually assigned unique primary key id
for shipment_data
. The primary key on shipment_data
is also a foreign key referencing id on shipments
.
In my mind this seems more efficient than making shipment_data.id
auto increment and adding a shipment_data.shipment_id
foreign key, since they will, as long as everything works correctly, have the same value as both will be created at the same time.
But I have a creeping feeling that there might be something I'm overlooking.