I have a table called invoice_item. This table has a composite foreign key of "entity_id" and "table_name". In MySQL, and most other relational databases, you can create a foreign key to reference a composite primary key like so…
I have been looking for this information all over the place but it was right under my nose all along. I would like to document the rest of this process for anyone in the future that runs into this same scenario.
Just like the API docs said, I successfully created the composite foreign key. Using the previous example, it would look like this…