diff --git a/database/migrations/2018_09_08_192152_create_items_table.php b/database/migrations/2018_09_08_192152_create_items_table.php index 294d932..d1b83e3 100644 --- a/database/migrations/2018_09_08_192152_create_items_table.php +++ b/database/migrations/2018_09_08_192152_create_items_table.php @@ -21,6 +21,13 @@ class CreateItemsTable extends Migration $table->integer('waiting_user_id')->nullable(); $table->timestamps(); }); + + Schema::create('item_user', function (Blueprint $table) { + $table->increments('id'); + $table->integer('item_id'); + $table->integer('user_id'); + $table->primary(['item_id', 'user_id']); + }); } /** @@ -31,5 +38,6 @@ class CreateItemsTable extends Migration public function down() { Schema::dropIfExists('items'); + Schema::dropIfExists('item_user'); } } diff --git a/database/migrations/2018_09_10_233609_item_user.php b/database/migrations/2018_09_10_233609_item_user.php deleted file mode 100644 index 3308188..0000000 --- a/database/migrations/2018_09_10_233609_item_user.php +++ /dev/null @@ -1,33 +0,0 @@ -increments('id'); - $table->integer('item_id'); - $table->integer('user_id'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('item_user'); - } -}