modifica migrations
This commit is contained in:
@@ -14,28 +14,32 @@ return new class extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
Schema::create('activity_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->onDelete('cascade');
|
||||
$table->string('action');
|
||||
$table->string('module');
|
||||
$table->string('description')->nullable();
|
||||
$table->json('details')->nullable();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
if (!Schema::hasTable('activity_logs')) {
|
||||
Schema::create('activity_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->onDelete('cascade');
|
||||
$table->string('action');
|
||||
$table->string('module');
|
||||
$table->string('description')->nullable();
|
||||
$table->json('details')->nullable();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
|
||||
$table->index(['user_id', 'module']);
|
||||
$table->index(['created_at']);
|
||||
$table->index(['action']);
|
||||
});
|
||||
}
|
||||
|
||||
$table->index(['user_id', 'module']);
|
||||
$table->index(['created_at']);
|
||||
$table->index(['action']);
|
||||
});
|
||||
|
||||
Schema::create('role_presets', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name', 50)->unique();
|
||||
$table->string('description')->nullable();
|
||||
$table->json('permissions');
|
||||
$table->timestamps();
|
||||
});
|
||||
if (!Schema::hasTable('role_presets')) {
|
||||
Schema::create('role_presets', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name', 50)->unique();
|
||||
$table->string('description')->nullable();
|
||||
$table->json('permissions');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
|
||||
Reference in New Issue
Block a user