Receber documentos privados e locais de disponibilidade nas candidaturas
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-30 20:52:10 +02:00
parent 2134aa084b
commit bf84575d10
26 changed files with 2756 additions and 49 deletions
@@ -0,0 +1,39 @@
<?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::create('candidate_submission_documents', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id');
$table->unsignedBigInteger('people_process_id');
$table->unsignedBigInteger('candidate_submission_id');
$table->foreign(['tenant_id', 'people_process_id', 'candidate_submission_id'], 'candidate_document_submission_scope')->references(['tenant_id', 'people_process_id', 'id'])->on('candidate_submissions')->restrictOnDelete();
$table->string('document_key', 50);
$table->string('path');
$table->string('original_name', 180);
$table->string('mime_type', 100);
$table->unsignedBigInteger('size');
$table->string('sha256', 64);
$table->timestamp('created_at');
$table->unique(['candidate_submission_id', 'document_key']);
});
if (DB::getDriverName() === 'sqlite') {
DB::unprepared("CREATE TRIGGER preserve_candidate_documents_update BEFORE UPDATE ON candidate_submission_documents BEGIN SELECT RAISE(ABORT, 'Preservar documentos recebidos'); END;
CREATE TRIGGER preserve_candidate_documents_delete BEFORE DELETE ON candidate_submission_documents BEGIN SELECT RAISE(ABORT, 'Preservar documentos recebidos'); END;");
} elseif (DB::getDriverName() === 'pgsql') {
DB::unprepared('CREATE TRIGGER preserve_candidate_documents BEFORE UPDATE OR DELETE ON candidate_submission_documents FOR EACH ROW EXECUTE FUNCTION sgc_preserve_candidate_submissions();');
}
}
public function down(): void
{
throw new LogicException('Preservar documentos recebidos.');
}
};