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
MySQL foreign key referencing a big_increments field #612
Comments
You can't have 2 increments on the same table I don't think. Increments is mainly for primary keys This line: table.big_increments('user_context_id', length=20).unsigned().nullable() Should be like: table.big_integer('user_context_id', length=20).unsigned().nullable() |
Thank you :) I tried your solution but it also doesn't work with the same error. Do you have any other idea what I can try? |
Hello, i have the same error reported on the issue, the problem seems to be that using |
hm ok I'll fix this. |
Thank you! :) |
This is fixed in latest 2.5.0 version of Masonite ORM |
Thank you! 🎉 |
Hi all! I am trying to create a foreign key referencing a big_increments field, but I get
(1215, 'Cannot add foreign key constraint')
error. I think it is because I can't create a field that is the same type as big_increments (unsigned non nullable auto incrementing big integer with length of 20) because when I tried creatingbig integer
withunsigned()
modifier, its length got shortened to 10.Example of my code:
Can you please check if it is possible to create foreign key referencing a big_increments field?
Desktop (please complete the following information):
What database are you using?
The text was updated successfully, but these errors were encountered: