Great post, I didn't know that it was so easy! I am running into a problem with my foreign keys:
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `groups` add constraint `groups_user_id_foreign` foreign key (`user_id`) references `users` (`id`) on delete cascade)
Any idea on what I'm doing wrong?
Check that both groups.user_id and users.id have same type definition e.g if users.id is UNSIGNED Integer, groups.user_id should be same
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great post, I didn't know that it was so easy! I am running into a problem with my foreign keys:
Any idea on what I'm doing wrong?
Check that both groups.user_id and users.id have same type definition e.g if users.id is UNSIGNED Integer, groups.user_id should be same