ufutx.dma/database/migrations/2024_03_22_164549_change_table_comments.php
2026-03-04 14:42:40 +08:00

35 lines
832 B
PHP

<?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('comments', function (Blueprint $table) {
$table->integer("type_id")->nullable()->comment("备注类型id")->after("user_id");
$table->string("type_name")->nullable()->comment("备注类型名")->after("type_id");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('comments', function (Blueprint $table) {
$table->dropColumn('type_id');
$table->dropColumn('type_name');
});
}
};