Closed basuregami closed 6 years ago
Illuminate\Database\QueryException Cannot add foreign key constraint (SQL
: alter table read_wishlist_item_feedbacks
add constraint read_wishlist_ item_feedbacks_wishlist_id_foreign
foreign key (wishlist_id
) references
wishlists
(id
))
An error with foreign keys in CreateReadWishlistItemFeedbacksTable migration. Migration must look like this on:
Schema::create('read_wishlist_item_feedbacks', function (Blueprint $table) {
$table->increments('id');
$table->string('wishlist_item_feedback_id');
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users');
$table->string('wishlist_id');
$table->foreign('wishlist_id')->references('id')->on('wishlists');
$table->string('appliance_id');
$table->foreign('appliance_id')->references('id')->on('appliances');
$table->boolean('dislike');
$table->timestamps();
});
Thanks @stas727 . Fixed.
Before you create an issue make sure that:
Be explicit
Try to be as explicit as you can when you ask anything.
What version?
Please when it's necessary, provide the version of your copy of the boilerplate. You can find the version number in the original README.md.