Files
hyperf-micro-svc/migrations/2025_09_11_175013_create_admin_role_table.php
2025-09-12 15:23:08 +08:00

36 lines
1.1 KiB
PHP

<?php
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('admin_role', function (Blueprint $table) {
$table->comment('后台角色信息表');
$table->bigIncrements('id')->comment('主键');
$table->string('name', 30)->comment('角色名称');
$table->string('code', 100)->comment('角色代码')->unique();
$table->tinyInteger('status')->comment('状态:1=正常,2=停用')->default(1);
$table->smallInteger('sort')->comment('排序')->default(0);
$table->unsignedBigInteger('created_by')->default(0)->comment('创建人ID');
$table->unsignedBigInteger('updated_by')->default(0)->comment('更新人ID');
$table->datetimes();
$table->string('remark')->comment('备注')->default('');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('admin_role');
}
};