parent
0cd2ee4cc1
commit
14b0594b85
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('history_courses', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('calendar_id')->nullable()->after('id')->comment('日历ID');
|
||||
$table->index('calendar_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('history_courses', function (Blueprint $table) {
|
||||
$table->dropIndex(['calendar_id']);
|
||||
$table->dropColumn('calendar_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('calendars', function (Blueprint $table) {
|
||||
$table->tinyInteger('is_count_days')->default(1)->comment('是否统计天数 0否 1是');
|
||||
$table->tinyInteger('is_count_people')->default(1)->comment('是否统计人数 0否 1是');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('calendars', function (Blueprint $table) {
|
||||
$table->dropColumn(['is_count_days', 'is_count_people']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
Reference in new issue