init commit
All checks were successful
build-api-image / build (push) Successful in 51s

This commit is contained in:
Antonio Lopes dos Santos
2026-08-04 16:52:02 -03:00
commit afec302c3e
11594 changed files with 1636728 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTransportePacienteAgendarTransporteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->id();
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
$table->foreignId('motivo_id')->constrained('transporte_paciente_motivo_viagem_procedimento');
$table->date('data');
$table->time('horario');
$table->foreignId('municipio_id')->nullable()->constrained('intranet.cadastro_municipio');
$table->foreignId('destino_id')->nullable()->constrained('transporte_paciente_destino');
$table->text('consulta_observacao', 500)->nullable();
$table->tinyInteger('acompanhante')->nullable();
$table->foreignId('ponto_id')->nullable()->constrained('transporte_paciente_ponto');
$table->date('data_saida');
$table->time('horario_saida')->nullable();
$table->foreignId('tipo_passageiro_id')->nullable()->constrained('transporte_paciente_veiculo_tipo_passageiro');
$table->foreignId('veiculo_id')->nullable()->constrained('transporte_paciente_veiculo');
$table->foreignId('jornada_id')->nullable()->constrained('transporte_paciente_jornada');
$table->foreignId('supervisor_id')->nullable()->constrained('cadastro_usuario');
$table->text('observacao', 500)->nullable();
MigrationUtil::addCommonFields($table);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transporte_paciente_agendar_transporte');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddPreAgendaIdToTransportePacienteAgendarTransporteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->foreignId('pre_agendamento_id')->nullable()->references('id')->on('transporte_paciente_pre_agendamento_transporte');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->dropForeign('transporte_paciente_agendamento_transporte_pre_agendar_id_foreign');
$table->dropColumn('pre_agendamento_id');
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTransportePacienteStatusTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transporte_paciente_status', function (Blueprint $table) {
MigrationUtil::idWithoutIncrements($table);
$table->string('descricao', 20);
MigrationUtil::addCommonFields($table, ['staticData' => true]);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transporte_paciente_status');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddStatusIdToTransportePacienteAgendarTransporteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->foreignId('status_id')
->nullable()
->after('supervisor_id')
->constrained('transporte_paciente_status');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->dropForeign(['status_id']);
$table->dropColumn('status_id');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTransportePacienteAcompanhanteRelacaoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transporte_paciente_acompanhante_relacao', function (Blueprint $table) {
$table->id();
$table->string('descricao');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transporte_paciente_acompanhante_relacao');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTransportePacienteAcompanhanteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transporte_paciente_acompanhante', function (Blueprint $table) {
$table->id();
$table->string('nome');
$table->string('cns')->nullable();
$table->string('telefone')->nullable();
$table->foreignId('relacao_id')->nullable()->references('id')->on('transporte_paciente_acompanhante_relacao');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transporte_paciente_acompanhante');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAcompanhantesIdsToTransportePacienteAgendarTransporteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->foreignId('acompanhante_1_id')->nullable()->references('id')->on('transporte_paciente_acompanhante');
$table->foreignId('acompanhante_2_id')->nullable()->references('id')->on('transporte_paciente_acompanhante');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->dropConstrainedForeignId('acompanhante_1_id');
$table->dropConstrainedForeignId('acompanhante_2_id');
});
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddViagemIdToTransportePacienteAgendarTransporteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->foreignId('viagem_id')
->nullable()
->after('status_id')
->constrained('transporte_paciente_viagem');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->dropForeign(['viagem_id']);
$table->dropColumn('viagem_id');
});
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddProcedimentoToTransportePacienteAgendarTransporteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->foreignId('procedimento_id')->nullable()->after('observacao')->constrained('sigtap.procedimento');
$table->foreignId('lotacao_id')->nullable()->after('procedimento_id')->constrained('cadastro_lotacao');
$table->foreignId('ocupacao_id')->after('lotacao_id')->nullable()->constrained('sigtap.ocupacao');
$table->unsignedSmallInteger('quantidade')->after('ocupacao_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->dropForeign(['procedimento_id']);
$table->dropColumn('procedimento_id');
$table->dropForeign(['lotacao_id']);
$table->dropColumn('lotacao_id');
$table->dropForeign(['ocupacao_id']);
$table->dropColumn(['ocupacao_id']);
$table->dropColumn('quantidade');
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddUsuarioIdBpaLaboratorialToTransportePacienteAgendarTransporteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->foreignId('usuario_id')->nullable()->after('quantidade')->constrained('cadastro_usuario');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->dropForeign(['usuario_id']);
$table->dropColumn('usuario_id');
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddUsuarioIdToTransportePacienteAcompanhanteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_acompanhante', function (Blueprint $table) {
$table->foreignId('usuario_id')->nullable()->after('id')->constrained('cadastro_paciente');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_acompanhante', function (Blueprint $table) {
$table->dropForeign(['usuario_id']);
$table->dropColumn('usuario_id');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterQuantidadeDefaultOnTransportePacienteAgendar extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->unsignedSmallInteger('quantidade')->default(1)->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->unsignedSmallInteger('quantidade')->change();
});
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class DropFieldsToTransportePacienteAcompanhanteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_acompanhante', function (Blueprint $table) {
$table->dropColumn('nome');
$table->dropColumn('cns');
$table->dropColumn('telefone');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_acompanhante', function (Blueprint $table) {
$table->string('nome');
$table->string('cns')->nullable();
$table->string('telefone')->nullable();
});
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddVeiculoEditedToTransportePacienteAgendarTransporteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->foreignId('veiculo_edited_by')->nullable()->constrained('cadastro_usuario');
$table->timestamp('veiculo_edited_at')->nullable();
$table->integer('funcionalidade_origem')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_agendar_transporte', function (Blueprint $table) {
$table->dropConstrainedForeignId('veiculo_edited_by');
$table->dropColumn('veiculo_edited_at');
$table->dropColumn('funcionalidade_origem');
});
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCommonFieldsToTransportePacienteAcompanhanteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_acompanhante', function (Blueprint $table) {
$table->foreignId('created_lotacao_id')->nullable()->constrained('cadastro_lotacao');
$table->foreignId('updated_lotacao_id')->nullable()->constrained('cadastro_lotacao');
$table->foreignId('created_centro_custo_id')->nullable()->constrained('cadastro_centro_custo');
$table->foreignId('updated_centro_custo_id')->nullable()->constrained('cadastro_centro_custo');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_acompanhante', function (Blueprint $table) {
$table->dropForeign(['created_lotacao_id']);
$table->dropColumn(['created_lotacao_id']);
$table->dropForeign(['created_centro_custo_id']);
$table->dropColumn(['created_centro_custo_id']);
$table->dropForeign(['updated_lotacao_id']);
$table->dropColumn(['updated_lotacao_id']);
$table->dropForeign(['updated_centro_custo_id']);
$table->dropColumn(['updated_centro_custo_id']);
});
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCommonFieldsToTransportePacienteAcompanhanteRelacaoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_acompanhante_relacao', function (Blueprint $table) {
$table->foreignId('created_lotacao_id')->nullable()->constrained('cadastro_lotacao');
$table->foreignId('updated_lotacao_id')->nullable()->constrained('cadastro_lotacao');
$table->foreignId('created_centro_custo_id')->nullable()->constrained('cadastro_centro_custo');
$table->foreignId('updated_centro_custo_id')->nullable()->constrained('cadastro_centro_custo');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_acompanhante_relacao', function (Blueprint $table) {
$table->dropForeign(['created_lotacao_id']);
$table->dropColumn(['created_lotacao_id']);
$table->dropForeign(['created_centro_custo_id']);
$table->dropColumn(['created_centro_custo_id']);
$table->dropForeign(['updated_lotacao_id']);
$table->dropColumn(['updated_lotacao_id']);
$table->dropForeign(['updated_centro_custo_id']);
$table->dropColumn(['updated_centro_custo_id']);
});
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTransportePacienteAgendarTransporteHistoricoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transporte_paciente_agendar_transporte_historico', function (Blueprint $table) {
$table->id();
$table->foreignId('transporte_paciente_agendar_transporte_id')->constrained('transporte_paciente_agendar_transporte');
$table->date('data_saida');
$table->time('horario_saida')->nullable();
$table->foreignId('destino_id')->nullable()->constrained('transporte_paciente_destino');
$table->foreignId('veiculo_id')->nullable()->constrained('transporte_paciente_veiculo');
$table->tinyInteger('acompanhante')->nullable();
$table->foreignId('motivo_id')->constrained('transporte_paciente_motivo_viagem_procedimento');
$table->foreignId('status_id')->constrained('transporte_paciente_status');
$table->foreignId('lotacao_anterior_id')->constrained('cadastro_lotacao');
MigrationUtil::addCommonFields($table);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transporte_paciente_agendar_transporte_historico');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddTelefoneToTransportePacienteAcompanhanteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transporte_paciente_acompanhante', function (Blueprint $table) {
$table->string('telefone', 11)->after('nome')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transporte_paciente_acompanhante', function (Blueprint $table) {
$table->dropColumn('telefone');
});
}
}