Add new activity logging code to replace audit log

This commit is contained in:
DaneEveritt 2022-05-28 15:36:26 -04:00
parent c14c7b436e
commit 5bb66a00d8
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
11 changed files with 534 additions and 0 deletions

View file

@ -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');
}
}