P
P
Pavel2017-09-13 14:33:25
Laravel
Pavel, 2017-09-13 14:33:25

Is it ok to make a table without a foreign key?

Hello. I'm trying to implement Many To Many Polymorphic Relations in an application . I came across the fact that, in theory, in a pivot table, one of the columns should have a foreign key to several tables. As far as I know, this is impossible. Actually a question from here, whether it is normal to do such relation without foreign keys?97ec830fd7324bd587689397c9fd9c75.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Gerasimov, 2017-09-13
@Palych_tw

I didn’t understand the question, in taggable_type we will have Post or Video, which will determine which entity the taggable_id belongs to

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question