hoadv / employee-mgmt-laravel5.4-adminlte

The project is using laravel 5.4 and adminlte
MIT License
140 stars 183 forks source link

php artisan migrate has an error #1

Closed emilas44 closed 7 years ago

emilas44 commented 7 years ago

On initial migrate I get an error complaining about "can't add foreign key"


  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL  
  : alter table `employees` add constraint `employees_city_id_foreign` foreig  
  n key (`city_id`) references `city` (`id`))                                  

  [PDOException]                                                          
  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint 
emilas44 commented 7 years ago

You have made a big mistake...You can't assign a foreign key from a table that doesn't exist! Your migrations files are not ordered properly. Try to clone your project from github and make a new database and try to migrate and you will see!

maufel commented 7 years ago

I fixed the error.

migrations.zip

emilas44 commented 7 years ago

Push the changes you have made to your github project

maufel commented 7 years ago

do it

2017-06-25 9:52 GMT+02:00 emilas44 notifications@github.com:

Push the changes you have made to your github project

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hoadv/employee-mgmt-laravel5.4-adminlte/issues/1#issuecomment-310888549, or mute the thread https://github.com/notifications/unsubscribe-auth/AHdSSrz8I5HWUiHR5F0ebC5i9Fbd25fWks5sHhHHgaJpZM4NzGdY .

emilas44 commented 7 years ago

I can't push to your git repository! It works though. You need to push it!

maufel commented 7 years ago

How to do i t ?

Il 25/giu/2017 1:15 PM, "emilas44" notifications@github.com ha scritto:

I can't push to your git repository! It works though. You need to push it!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hoadv/employee-mgmt-laravel5.4-adminlte/issues/1#issuecomment-310896756, or mute the thread https://github.com/notifications/unsubscribe-auth/AHdSSkNAFQACWjo-oAWkxLzvR6ZJQmrQks5sHkE8gaJpZM4NzGdY .

emilas44 commented 7 years ago

How did you push it at the first place? How did you put your code on github?

emilas44 commented 7 years ago

Or maybe this is not your code? That whole application?

maufel commented 7 years ago

I fix only some problemi. It's noto mine

Il 25/giu/2017 6:49 PM, "emilas44" notifications@github.com ha scritto:

Or maybe this is not your code? That whole application?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hoadv/employee-mgmt-laravel5.4-adminlte/issues/1#issuecomment-310913835, or mute the thread https://github.com/notifications/unsubscribe-auth/AHdSSs_u5AJ1b0u7u8dxm5hSLug2CthVks5sHo99gaJpZM4NzGdY .

emilas44 commented 7 years ago

OK, i get it this is a forked repository... you just pulled it to your git hub profile.... am I right?

maufel commented 7 years ago

try this : https://github.com/maufel/employee-mgmt-laravel5.4-adminlte

best regards

2017-06-25 21:09 GMT+02:00 emilas44 notifications@github.com:

OK, i get it this is a forked repository... you just pulled it to your git hub profile.... am I right?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hoadv/employee-mgmt-laravel5.4-adminlte/issues/1#issuecomment-310921723, or mute the thread https://github.com/notifications/unsubscribe-auth/AHdSSjtdO9pXNwuds_-pU-JIz1h1RmtIks5sHrBzgaJpZM4NzGdY .

hoadv commented 7 years ago

Hello @emilas44 , have you see my video? I did this step by step without error.

emilas44 commented 7 years ago

No, I haven't seen the video...can you post the link here please.

hoadv commented 7 years ago

https://www.youtube.com/watch?v=Jbt5bEgv_QM

emilas44 commented 7 years ago

OK very nice, thank you