| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- return new class extends Migration
- {
- public function up(): void
- {
- Schema::create('permissions', function (Blueprint $table) {
- $table->id();
- $table->string('slug')->unique();
- $table->string('name');
- $table->text('description')->nullable();
- $table->string('module');
- $table->string('entity')->nullable();
- $table->string('field')->nullable();
- $table->string('action');
- $table->string('type')->default('action');
- $table->string('group')->nullable();
- $table->unsignedInteger('sort')->default(100);
- $table->boolean('is_system')->default(true);
- $table->timestamps();
- $table->index(['module', 'type']);
- $table->index(['module', 'field']);
- });
- }
- public function down(): void
- {
- Schema::dropIfExists('permissions');
- }
- };
|