You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, i found 3 problems on the new demo.
On the posts tables, the author_id is not defined as unsigned so when the migration tries to create the foreign key fails public function up() { Schema::table('posts', function (Blueprint $table) { $table->integer('author_id')->nullable(); $table->foreign('author_id')->references('id')->on('authors')->onDelete('cascade'); }); }
it can be solved just changing the function to public function up() { Schema::table('posts', function (Blueprint $table) { $table->integer('author_id')->unsigned()->nullable(); $table->foreign('author_id')->references('id')->on('authors')->onDelete('cascade'); }); }
Same error on articles with relationships table, with the field author_id
The last one is articles_with_relationships_tags table, the foreign key name is too long (max is 64 characteres).
This one can be solved just passing the key name as a second parameter to the foreign method
The text was updated successfully, but these errors were encountered:
Hello, i found 3 problems on the new demo.
On the posts tables, the author_id is not defined as unsigned so when the migration tries to create the foreign key fails
public function up() { Schema::table('posts', function (Blueprint $table) { $table->integer('author_id')->nullable(); $table->foreign('author_id')->references('id')->on('authors')->onDelete('cascade'); }); }
it can be solved just changing the function to
public function up() { Schema::table('posts', function (Blueprint $table) { $table->integer('author_id')->unsigned()->nullable(); $table->foreign('author_id')->references('id')->on('authors')->onDelete('cascade'); }); }
Same error on articles with relationships table, with the field author_id
The last one is articles_with_relationships_tags table, the foreign key name is too long (max is 64 characteres).
This one can be solved just passing the key name as a second parameter to the foreign method
The text was updated successfully, but these errors were encountered: