Add new activity logging code to replace audit log
This commit is contained in:
parent
c14c7b436e
commit
5bb66a00d8
11 changed files with 534 additions and 0 deletions
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateActivityLogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('activity_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('batch')->nullable();
|
||||
$table->string('event')->index();
|
||||
$table->text('description')->nullable();
|
||||
$table->nullableNumericMorphs('actor');
|
||||
$table->nullableNumericMorphs('subject');
|
||||
$table->json('properties')->nullable();
|
||||
$table->timestamp('timestamp')->useCurrent()->onUpdate(null);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('activity_logs');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue