This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameImagemFechamentoStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_imagem_fechamento_status', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 10);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_imagem_fechamento_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterFieldNomeSizeFromExameImagemFechamentoStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_status', function (Blueprint $table) {
|
||||
|
||||
$table->string('nome', 180)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_status', function (Blueprint $table) {
|
||||
|
||||
$table->string('nome', 10)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameImagemFechamentoFaturamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->date('data');
|
||||
$table->foreignId('agendamento_id')->constrained('exame_imagem_agendamento');
|
||||
$table->foreignId('exame_id')->constrained('parametrizacao_exame');
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->foreignId('grupo_id')->constrained('cadastro_grupo');
|
||||
$table->foreignId('unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('agendamento_exame_id')->constrained('exame_imagem_agendamento_exame');
|
||||
$table->decimal('valor', 8, 2)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_imagem_fechamento_faturamento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddValorNormalToExameImagemFechamentoFaturamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('valor_normal', 8, 2)->after('valor')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('valor_normal');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddBpaProcedimentoIdToExameImagemFechamentoFaturamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
$table->foreignId('bpa_procedimento_id')->after('valor_normal')->nullable()->constrained('bpa_procedimento');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
$table->dropForeign(['bpa_procedimento_id']);
|
||||
$table->dropColumn(['bpa_procedimento_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsToExameImagemFechamentoFaturamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('procedimento_id')->nullable()->after('bpa_procedimento_id')->constrained('sigtap.procedimento');
|
||||
$table->foreignId('lotacao_id')->nullable()->after('procedimento_id')->constrained('cadastro_lotacao');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['procedimento_id']);
|
||||
$table->dropColumn('procedimento_id');
|
||||
$table->dropForeign(['lotacao_id']);
|
||||
$table->dropColumn('lotacao_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddQuantidadeToExameImagemFechamentoFaturamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->unsignedSmallInteger('quantidade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('quantidade');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddOcupacaoIdToExameImagemFechamentoFaturamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('ocupacao_id')->after('lotacao_id')->nullable()->constrained('sigtap.ocupacao');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
$table->dropForeign(['ocupacao_id']);
|
||||
$table->dropColumn(['ocupacao_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCidsIdToExameImagemFechamentoFaturamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('cid_principal_id')->after('ocupacao_id')->nullable()->constrained('sigtap.cid');
|
||||
$table->foreignId('cid_secundario_id')->after('cid_principal_id')->nullable()->constrained('sigtap.cid');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['cid_principal_id']);
|
||||
$table->dropColumn(['cid_principal_id']);
|
||||
$table->dropForeign(['cid_secundario_id']);
|
||||
$table->dropColumn(['cid_secundario_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddUsuarioIdToExameImagemFechamentoFaturamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('usuario_id')->nullable()->after('cid_secundario_id')->constrained('cadastro_usuario');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['usuario_id']);
|
||||
$table->dropColumn('usuario_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddApacProcedimentoSecundarioIdToExameImagemFechamentoFaturamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('apac_procedimento_secundario_id')
|
||||
->nullable()
|
||||
->after('bpa_procedimento_id')
|
||||
->constrained('apac_solicitacao_autorizacao_procedimento_secundario');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_imagem_fechamento_faturamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('apac_procedimento_secundario_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user