2023-03-20 13:04:22 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
2023-08-08 11:51:36 +02:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
2023-03-20 13:04:22 +01:00
|
|
|
|
|
|
|
class CreateActivityLogTable extends Migration
|
|
|
|
{
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) {
|
2023-05-25 13:23:42 +02:00
|
|
|
$table->id();
|
2023-03-20 13:04:22 +01:00
|
|
|
$table->string('log_name')->nullable();
|
|
|
|
$table->text('description');
|
|
|
|
$table->nullableMorphs('subject', 'subject');
|
|
|
|
$table->nullableMorphs('causer', 'causer');
|
|
|
|
$table->json('properties')->nullable();
|
|
|
|
$table->timestamps();
|
|
|
|
$table->index('log_name');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name'));
|
|
|
|
}
|
|
|
|
}
|