master
lion 1 week ago
parent 73cc701ad9
commit 3f7d684233

@ -1,25 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('admin_roles', function (Blueprint $table) {
$table->boolean('full_access')->default(false)->after('is_system');
});
DB::table('admin_roles')->where('slug', 'super_admin')->update(['full_access' => true]);
}
public function down(): void
{
Schema::table('admin_roles', function (Blueprint $table) {
$table->dropColumn('full_access');
});
}
};

@ -14,6 +14,7 @@ return new class extends Migration
$table->string('slug', 50)->unique();
$table->string('name', 100);
$table->boolean('is_system')->default(false);
$table->boolean('full_access')->default(false)->after('is_system');
$table->unsignedInteger('sort')->default(0);
$table->timestamps();
});
@ -24,6 +25,7 @@ return new class extends Migration
'slug' => 'super_admin',
'name' => '超级管理员',
'is_system' => true,
'full_access' => true,
'sort' => 1,
'created_at' => $now,
'updated_at' => $now,
@ -32,6 +34,7 @@ return new class extends Migration
'slug' => 'venue_admin',
'name' => '场馆管理员',
'is_system' => true,
'full_access' => false,
'sort' => 2,
'created_at' => $now,
'updated_at' => $now,

Loading…
Cancel
Save