mpociot / teamwork

User to Team associations with invitation system for the Laravel 5 Framework
MIT License
1.07k stars 170 forks source link

Migration Errors #35

Closed reddinan closed 8 years ago

reddinan commented 8 years ago

When attempting to run the included migrations the following error happens:

  [Illuminate\Database\QueryException]                                                           
  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `tea  
  m_invites` add constraint `team_invites_team_id_foreign` foreign key (`team_id`) references `  
  teams` (`id`) on delete cascade)    

Config file is the default config file.

Environment is Laravel-Homestead-7 Laravel version is "laravel/framework": "5.2.*",

reddinan commented 8 years ago

Added a PR to fix this issue. Strange that no one else has experienced this problem.

tobischulz commented 8 years ago

Got the same error. Thanks for your help, have changed the migration order and it worked.