This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateTransportePacientePreAgendamentoTransporteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('transporte_paciente_pre_agendamento_transporte', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('paciente_id')->references('id')->on('cadastro_paciente');
|
||||
$table->foreignId('motivo_id')->references('id')->on('transporte_paciente_motivo_viagem_procedimento');
|
||||
$table->time('horario');
|
||||
$table->date('data');
|
||||
$table->foreignId('municipio_id')->references('id')->on('intranet.cadastro_municipio');
|
||||
$table->foreignId('destino_id')->references('id')->on('transporte_paciente_destino');
|
||||
$table->smallInteger('acompanhante');
|
||||
$table->foreignId('ponto_id')->references('id')->on('transporte_paciente_ponto');
|
||||
$table->string('observacao', 200)->nullable();
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('transporte_paciente_pre_agendamento_transporte');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddColumnsToPreAgendarTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('transporte_paciente_pre_agendamento_transporte', function (Blueprint $table) {
|
||||
$table->date('data_saida')->nullable();
|
||||
$table->time('horario_saida')->nullable();
|
||||
$table->foreignId('veiculo_id')->nullable()->references('id')->on('transporte_paciente_veiculo');
|
||||
$table->foreignId('jornada_id')->nullable()->references('id')->on('transporte_paciente_jornada');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('transporte_paciente_pre_agendamento_transporte', function (Blueprint $table) {
|
||||
$table->dropColumn(['data_saida','horario_saida']);
|
||||
$table->dropConstrainedForeignId('veiculo_id');
|
||||
$table->dropConstrainedForeignId('jornada_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddColumnTipoPassageiroOnTranportePacientePreagendarTranporteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('transporte_paciente_pre_agendamento_transporte', function (Blueprint $table) {
|
||||
$table->foreignId('tipo_passageiro_id')->nullable()->references('id')->on('transporte_paciente_veiculo_tipo_passageiro');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('transporte_paciente_pre_agendamento_transporte', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('tipo_passageiro_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user