commit
e8d311a17d
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCourseTypeIdToCalendarsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('calendars', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('course_type_id')->nullable()->after('id')->comment('课程类型ID');
|
||||
$table->index('course_type_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('calendars', function (Blueprint $table) {
|
||||
$table->dropIndex(['course_type_id']);
|
||||
$table->dropColumn('course_type_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue