<?php

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

class CreateSpecialtyTrainsTable extends Migration {

	public function up()
	{
		Schema::create('specialty_trains', function(Blueprint $table) {
			$table->increments('id');
			$table->double('cost_one');
			$table->double('Trainner_percentage');

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


            $table->bigInteger('user_id')->unsigned()->nullable();
            $table->foreign('user_id')->references('id')->on('users');

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

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