-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements for Pivot Tables #11
Comments
Whatever is most common, I'm fine with. |
IMHO a primary key out of FK1 and FK2 would be best. |
Thanks to @vinkla for commiting. I've testet different cases: PRIMARY(user_id, group_id) will end up with: UNIQUE(user_id, group_id) results similar... Without checking the relation before inserting you will have two options:
so... If you want to avoid duplicates just add an UNIQUE key and try/catch everything |
In my opinion a Pivot requires the
$table->timestamps();
fields to support the->withTimestamps();
function.Also i would prefer an
id
field as primary key (First normal form).Additionally a combined index between the relational id's would be a benefit for performance.
Correct me if I'm wrong
The text was updated successfully, but these errors were encountered: