@@ -0,0 +1,43 @@
|
||||
<?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('supplier_bank_details', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('tenant_id')->constrained()->restrictOnDelete();
|
||||
$table->foreignId('supplier_id')->constrained()->restrictOnDelete();
|
||||
$table->foreignId('created_by')->constrained('users')->restrictOnDelete();
|
||||
$table->unsignedInteger('revision');
|
||||
$table->string('bank_name', 200);
|
||||
$table->string('country', 2);
|
||||
$table->string('currency', 3);
|
||||
$table->text('beneficiary');
|
||||
$table->text('account_identifier');
|
||||
$table->text('evidence_reference');
|
||||
$table->text('reason');
|
||||
$table->timestamp('created_at');
|
||||
$table->unique(['supplier_id', 'revision']);
|
||||
});
|
||||
Schema::create('supplier_bank_reviews', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('tenant_id')->constrained()->restrictOnDelete();
|
||||
$table->foreignId('supplier_bank_detail_id')->constrained()->restrictOnDelete();
|
||||
$table->foreignId('reviewed_by')->constrained('users')->restrictOnDelete();
|
||||
$table->string('decision');
|
||||
$table->text('reason');
|
||||
$table->timestamp('created_at');
|
||||
$table->unique(['supplier_bank_detail_id', 'reviewed_by']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
throw new LogicException('Preservar versões bancárias e validações.');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user