Skip to content

Commit

Permalink
fintech-fab#17 Миграция таблицы dinner_menu_users
Browse files Browse the repository at this point in the history
  • Loading branch information
kmarenov committed Sep 2, 2014
1 parent d2c73a2 commit 8f49d39
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateDinnerMenuUsersTable extends Migration
{

/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('dinner_menu_users', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->integer('dinner_menu_item_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users');
$table->foreign('dinner_menu_item_id')->references('id')->on('dinner_menu_items');
$table->integer('count')->unsigned()->default(1);
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('dinner_menu_users');
}

}

0 comments on commit 8f49d39

Please sign in to comment.