-
Notifications
You must be signed in to change notification settings - Fork 11
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
Pivot Tables #7
Comments
hmm, doesnt seem to handle foreign keys well. I ended up having a custom pivot table model for one of mine using:
and that ended working the first time, but if you run migrate:auto again when you make other new models/migrations, i ended up getting the following error:
Here is a decent package for helping with creating some pivot table migration files though: |
yeah its cause of the way it creates the indexes when creating the temporary table to diff with best bet is to use traditional migration files for complex pivots like this |
Should i just create vanilla laravel migration tables for pivot tables or is there a way to handle it with this library? Lets say I have a Post model and a Category model and I want to be able to associate multiple Categories to a Post (belongsToMany).
The text was updated successfully, but these errors were encountered: