Implement compliance exports and retention overrides
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('retention_overrides', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('scope', 20);
|
||||
$table->foreignId('tenant_id')->nullable()->constrained()->nullOnDelete();
|
||||
$table->foreignId('event_id')->nullable()->constrained()->nullOnDelete();
|
||||
$table->string('reason', 200);
|
||||
$table->text('note')->nullable();
|
||||
$table->foreignId('created_by_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->foreignId('released_by_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamp('released_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['scope', 'released_at']);
|
||||
$table->index(['tenant_id', 'released_at']);
|
||||
$table->index(['event_id', 'released_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('retention_overrides');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('data_exports', function (Blueprint $table) {
|
||||
$table->string('scope', 20)->default('user')->after('tenant_id');
|
||||
$table->foreignId('event_id')->nullable()->after('scope')->constrained()->nullOnDelete();
|
||||
$table->boolean('include_media')->default(false)->after('event_id');
|
||||
|
||||
$table->index(['scope']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('data_exports', function (Blueprint $table) {
|
||||
$table->dropIndex(['scope']);
|
||||
$table->dropColumn('include_media');
|
||||
$table->dropConstrainedForeignId('event_id');
|
||||
$table->dropColumn('scope');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user