@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
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::table('requisition_items', fn (Blueprint $table) => $table->json('category_context')->nullable());
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
throw new LogicException('Preserve recorded category context; use reviewed recovery instead of deleting history.');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
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('procurement_saved_searches', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('tenant_id')->constrained()->restrictOnDelete();
|
||||
$table->foreignId('user_id')->constrained()->restrictOnDelete();
|
||||
$table->string('name', 100);
|
||||
$table->string('term', 100);
|
||||
$table->string('active_name_key', 64)->nullable();
|
||||
$table->unsignedInteger('version')->default(1);
|
||||
$table->timestamp('archived_at')->nullable();
|
||||
$table->timestamps();
|
||||
$table->unique(['tenant_id', 'user_id', 'active_name_key'], 'saved_search_active_name_unique');
|
||||
$table->index(['tenant_id', 'user_id', 'archived_at'], 'saved_search_owner_index');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
throw new LogicException('Preserve saved search criteria; no automatic history deletion.');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user