forked from fintech-fab/fintech-fab.ru
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fintech-fab#17 Миграция таблицы dinner_menu_users
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
app/database/migrations/2014_09_02_234512_create_dinner_menu_users_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
|
||
} |