Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fazilhussain's avatar

Relationship multiple foreign keys in pivot table

I have 3 tables services levels deadlines. Suggest me the way to define relationship with packages (pivot table) in this scenario or should I change my table structure to store this data?

Packages (Pivot Table):

service_id  | deadline_id | level_id | price 
------------+-------------+----------+---------
   1        |     1       |     2    |   25.00
   1        |     1       |     1    |   24.00
   2        |     1       |     1    |   23.00
0 likes
0 replies

Please or to participate in this conversation.