Add all files
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
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('ext_compliance_deletion_requests', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(User::class)->constrained()->cascadeOnDelete();
|
||||
$table->string('status')->default('pending');
|
||||
$table->text('reason')->nullable();
|
||||
$table->text('admin_notes')->nullable();
|
||||
$table->foreignId('processed_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamp('processed_at')->nullable();
|
||||
$table->json('snapshot')->nullable();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ext_compliance_deletion_requests');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
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('ext_compliance_support_pins', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(User::class)->constrained()->cascadeOnDelete();
|
||||
$table->string('pin_hash');
|
||||
$table->string('pin_lookup', 64)->unique();
|
||||
$table->timestamp('expires_at');
|
||||
$table->timestamp('revoked_at')->nullable();
|
||||
$table->timestamp('last_validated_at')->nullable();
|
||||
$table->string('created_ip', 45)->nullable();
|
||||
$table->string('created_user_agent')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ext_compliance_support_pins');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
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('ext_compliance_audit_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('category');
|
||||
$table->string('event');
|
||||
$table->foreignIdFor(User::class, 'subject_user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->nullableMorphs('actor');
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->json('context')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['category', 'event']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ext_compliance_audit_logs');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user