musonza / groups

A Laravel 5 user groups package
MIT License
68 stars 15 forks source link

Groups table migration #15

Closed mehdithemaker closed 5 years ago

mehdithemaker commented 5 years ago

Any solution for that problem please? Migrating: 2019_05_26_125854_create_groups_tables

Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1005 Can't create table groupsystem.#sql-2678_21 (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table groups add constraint groups_user_id_foreign foreign key (user_id) references users (id) on delete cascade)

oliuz commented 5 years ago

what version are you using?

markoman78 commented 5 years ago

I'm using 5.8 and this fixed for me.

I changed all user_id integers which are pointed as foreign keys to unsignedBigIntegers. All other columns which are pointed as foreign keys to unsignedIntegers.

mehdithemaker commented 5 years ago

I changed the types to increments and it's working fine thank you for the great work

On Sun, 7 Jul 2019 at 12:42, markoman78 notifications@github.com wrote:

I'm using 5.8 and this fixed for me.

I changed all user_id integers which are pointed as foreign keys to unsignedBigIntegers. All other columns which are pointed as foreign keys to unsignedIntegers.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/musonza/groups/issues/15?email_source=notifications&email_token=AH7GLM5MGMIEVBI6IW4DMMLP6HJA5A5CNFSM4HPWU32KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLJ2JI#issuecomment-508992805, or mute the thread https://github.com/notifications/unsubscribe-auth/AH7GLM3CLG63YN2B4EJZQWTP6HJA5ANCNFSM4HPWU32A .

musonza commented 5 years ago

https://github.com/musonza/groups/releases/tag/v1.2.0