2021_01_26_172905_create_roles_table.php
888 字节
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
class CreateRolesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('roles', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name')->nullable()->comment('角色名称');
$table->text('description')->nullable()->comment('角色描述');
$table->timestamps();
$table->softDeletes();
});
DB::statement("ALTER TABLE `roles` comment'角色表'"); // 表注释
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('roles');
}
}