commit melhorias compras4
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-22 16:28:03 +02:00
parent efd97e265b
commit 36dcfdf00c
118 changed files with 6042 additions and 92 deletions
@@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('tenants', fn (Blueprint $table) => $table->json('requisition_approval_policy')->nullable());
Schema::table('approval_steps', fn (Blueprint $table) => $table->json('routing')->nullable());
}
public function down(): void
{
if (DB::table('tenants')->whereNotNull('requisition_approval_policy')->exists() || DB::table('approval_steps')->whereNotNull('routing')->exists()) {
throw new LogicException('Preserve os planos e níveis configurados antes de reverter a estrutura.');
}
Schema::table('approval_steps', fn (Blueprint $table) => $table->dropColumn('routing'));
Schema::table('tenants', fn (Blueprint $table) => $table->dropColumn('requisition_approval_policy'));
}
};