laracasts / Laravel-5-Generators-Extended

This package extends the core file generators that are included with Laravel 5
https://laracasts.com/lessons/faster-workflow-with-generators
MIT License
2.45k stars 347 forks source link

Foreign key doesn't work correctly with id #144

Closed isztldav closed 4 years ago

isztldav commented 6 years ago

Description:

I tried several times but laravel cannot migrate without these fixes

Steps To Reproduce:

After public function up() add Schema::enableForeignKeyConstraints();

To the foreign column add ->unsigned() $table->integer('shopCategories_id'); -> $table->integer('shopCategories_id')->unsigned();

In the attached picture you can see the result before and after my additions

screen shot 2017-12-09 at 12 37 13
tabacitu commented 6 years ago

Hi @trakons ,

Soo... Id columns should be unsigned if artisan is configured to add foreign key constraints. Do I understand you suggestion correctly?

Cheers!

tabacitu commented 4 years ago

PR #165 got merged inside the v2 branch. So that in Laravel 5.8+ we're always using unsignedBigIntegers just like the Laravel default. So I'm going to close this. Let me know if this still doesn't fix the issue and we'll reopen it.

Cheers!