pipe-dream / laravel-create

Create Laravel projects really fast
1.31k stars 109 forks source link

Foreign Key relationship issue with bigIncrements #4

Closed dannypritchard closed 5 years ago

dannypritchard commented 5 years ago

On creating a project with the default settings, I noticed that the users table was created with a bigIncrements index (as per laravel 5.8 standard) but the cars table user_id column that references the bigInt was created with just an unsignedInteger, meaning that migration failed.

Suggest to either default to increments for id columns or make sure foreign key relationships have the correct type.

Brill project btw already planning on using it on a new site build

ajthinking commented 5 years ago

Thanks @dannyrevenant, good catch! That slipped right through when using sqlite. In release v0.0.36 foreign key default datatype is changed to unsignedBigInteger. Example:

$table->unsignedBigInteger('user_id')->nullable();

Hope that fixes it, let me know if there are any more problems while using 😄