Shouldn't the pivot table have model_id and model_type instead of just photo_id ?
PK
Povilas Korop
✓ Link copied!
It's not photo_id, it's photoable_id
A
amauro
✓ Link copied!
shouldn't there be a unique constraint or index for all three fields (photo_id, photoable_it and photoable_type) to avoid multiple assignements of one photo to a user?
Shouldn't the pivot table have
model_idandmodel_typeinstead of justphoto_id?It's not photo_id, it's photoable_id