<?php

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

class CreateSystemFoodsTable extends Migration {

	public function up()
	{
		Schema::create('system_foods', function(Blueprint $table) {
			$table->increments('id');
			$table->string('name', 250);
			$table->string('code', 250);

			$table->integer('specialty_id')->unsigned()->nullable();
			$table->foreign('specialty_id')->references('id')->on('specialties');

            $table->softDeletes();
            $table->timestamps();
            $table->engine = 'InnoDB';
		});
	}

	public function down()
	{
		Schema::drop('system_foods');
	}
}