You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a schema which includes a foreign key, if you forget to add the "unsigned" option to the key, you will get a mysql error when you try to run the migration.
For instance, the README has an example regarding foreign keys, but before we use it, we need to setup the users table, so I'll do a dumb one here:
Since I've not done a PR before, and don't have the time at this very moment to learn, I'll leave this up to someone else to do unless (a) it's not fixed quickly, (b) I get annoyed enough by it and (c) I get the time to learn how to do PRs. :)
Hopefully this is helpful and will spark a change.
Cheers.
The text was updated successfully, but these errors were encountered:
Hi guys - I know this is very very old, but do you guys still use this package? If so, let me know if this is still an issue, and something that is fixable. We're trying to close all issues&PRs and get v2 out the door soon #170 so this would be a great time to have this settled.
Yes @tabacitu We are still using the package. and a it is mentioned above, most of foreign keys are based in id.. this will simplify the work so much...
When creating a schema which includes a foreign key, if you forget to add the "unsigned" option to the key, you will get a mysql error when you try to run the migration.
For instance, the README has an example regarding foreign keys, but before we use it, we need to setup the users table, so I'll do a dumb one here:
This generates:
Fine and dandy. (Note, the "increments" above creates an unsigned integer field in mysql. This is important).
So, now we move on to the example given in the docs for making a schema which relates to this new users table...
Which generates the following:
Running this migration, you will find it will bark at you saying
To solve the problem on the fly, just go into the create_posts_table migration file and change one line:
Since I've not done a PR before, and don't have the time at this very moment to learn, I'll leave this up to someone else to do unless (a) it's not fixed quickly, (b) I get annoyed enough by it and (c) I get the time to learn how to do PRs. :)
Hopefully this is helpful and will spark a change.
Cheers.
The text was updated successfully, but these errors were encountered: