<?php

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

class CreateStudentCoursesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('student_courses', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('student_id')->nullable()->comment('学员ID');
            $table->unsignedInteger('course_id')->nullable()->comment('课程ID');
            $table->string('number', 200)->nullable()->comment('合同编号');
            $table->date('apply_date')->nullable()->comment('报名日期');
            $table->string('duration', 200)->nullable()->comment('课程持续时间');
            $table->tinyInteger('assign_teacher')->nullable()->default(1)->comment('讲师分配：1全部；2指定');
            $table->timestamps();
        });
    }

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