josecelano / ddd-laravel-sample

A Laravel DDD sample application using CQRS and persisting entities serialized without ORM
276 stars 59 forks source link

Migration Issue #1

Closed basuregami closed 6 years ago

basuregami commented 6 years ago

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.

basuregami commented 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))

stas727 commented 6 years ago

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();
        });
josecelano commented 6 years ago

Thanks @stas727 . Fixed.