This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroParentescoResponsavelTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_parentesco_responsavel', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_parentesco_responsavel');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroCursoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_curso', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 100);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_curso');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroSituacaoMercadoTrabalhoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_situacao_mercado_trabalho', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_situacao_mercado_trabalho');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroAcompanhamentoInfantilTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_acompanhamento_infantil', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_acompanhamento_infantil');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroOrientacaoSexualTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_orientacao_sexual', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_orientacao_sexual');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroPesoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_peso', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_peso');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroDoencaCardiacaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_doenca_cardiaca', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_doenca_cardiaca');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroDoencaRespiratoriaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_doenca_respiratoria', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_doenca_respiratoria');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroProblemasRinsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_problemas_rins', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_problemas_rins');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroSituacaoRuaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_situacao_rua', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_situacao_rua');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroAlimentacaoDiariaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_alimentacao_diaria', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_alimentacao_diaria');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroOrigemAlimentacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_origem_alimentacao', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_origem_alimentacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroHigienePessoalTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_higiene_pessoal', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_higiene_pessoal');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroSaidaCidadaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_saida_cidadao', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_saida_cidadao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroComunidadeTradicionalTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_comunidade_tradicional', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 100);
|
||||
$table->smallInteger('codigo_esus')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_comunidade_tradicional');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroIndividualTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_individual', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('paciente_id')->nullable()->constrained('cadastro_paciente');
|
||||
$table->foreignId('usuario_id')->nullable()->constrained('cadastro_usuario');
|
||||
$table->foreignId('equipe_id')->nullable()->constrained('atencao_basica_parametrizacao_equipe');
|
||||
$table->foreignId('usuario_ocupacao_id')->nullable()->constrained('sigtap.ocupacao');
|
||||
$table->date('data_usuario_responsavel')->nullable();
|
||||
|
||||
$table->boolean('responsavel')->default(false)->nullable();
|
||||
$table->foreignId('responsavel_cidadao_id')->nullable()->constrained('cadastro_cidadao');
|
||||
$table->decimal('renda_mensal', 8, 2)->nullable();
|
||||
$table->boolean('ativo')->default(true)->nullable();
|
||||
|
||||
$table->foreignId('parentesco_responsavel_id')->nullable()->constrained('atencao_basica_cadastro_parentesco_responsavel');
|
||||
|
||||
$table->foreignId('ocupacao_id')->nullable()->constrained('sigtap.ocupacao');
|
||||
$table->foreignId('curso_id')->nullable()->constrained('atencao_basica_cadastro_curso');
|
||||
$table->boolean('frequenta_escola_creche')->default(false)->nullable();
|
||||
$table->foreignId('situacao_mercado_trabalho_id')->nullable()->constrained('atencao_basica_cadastro_situacao_mercado_trabalho');
|
||||
$table->boolean('frequenta_cuidador_tradicional')->default(false)->nullable();
|
||||
$table->boolean('participa_grupo_comunitario')->default(false)->nullable();
|
||||
|
||||
$table->boolean('plano_saude')->default(false)->nullable();
|
||||
$table->boolean('comunidade_tradicional')->default(false)->nullable();
|
||||
$table->foreignId('comunidade_tradicional_id')->nullable()->constrained('atencao_basica_cadastro_comunidade_tradicional');
|
||||
$table->boolean('orientacao_sexual')->default(false)->nullable();
|
||||
$table->foreignId('orientacao_sexual_id')->nullable()->constrained('atencao_basica_cadastro_orientacao_sexual');
|
||||
$table->boolean('identidade_genero')->default(false)->nullable();
|
||||
$table->boolean('deficiente')->default(false)->nullable();
|
||||
$table->foreignId('saida_cidadao_id')->nullable()->constrained('atencao_basica_cadastro_saida_cidadao');
|
||||
$table->date('motivo_saida_data')->nullable();
|
||||
|
||||
$table->boolean('recusa_cadastro')->default(false)->nullable();
|
||||
|
||||
$table->boolean('gestante')->default(false)->nullable();
|
||||
$table->string('maternidade_referencia', 50)->nullable();
|
||||
$table->foreignId('peso_id')->nullable()->constrained('atencao_basica_cadastro_peso');
|
||||
$table->boolean('fumante')->default(false)->nullable();
|
||||
$table->boolean('usa_alcool')->default(false)->nullable();
|
||||
$table->boolean('outras_drogas')->default(false)->nullable();
|
||||
$table->boolean('hipertensao')->default(false)->nullable();
|
||||
$table->boolean('diabetes')->default(false)->nullable();
|
||||
$table->boolean('avc_derrame')->default(false)->nullable();
|
||||
$table->boolean('infarto')->default(false)->nullable();
|
||||
$table->boolean('hanseniase')->default(false)->nullable();
|
||||
$table->boolean('tuberculose')->default(false)->nullable();
|
||||
$table->boolean('cancer')->default(false)->nullable();
|
||||
$table->boolean('fibromialgia')->default(false)->nullable();
|
||||
$table->boolean('transtorno_espectro_autista')->default(false)->nullable();
|
||||
$table->boolean('internacao')->default(false)->nullable();
|
||||
$table->string('internacao_motivo', 50)->nullable();
|
||||
$table->boolean('doenca_cardiaca')->default(false)->nullable();
|
||||
$table->boolean('problemas_rins')->default(false)->nullable();
|
||||
$table->boolean('doenca_respiratoria')->default(false)->nullable();
|
||||
$table->boolean('tratamento_saude_mental')->default(false)->nullable();
|
||||
$table->boolean('acamado')->default(false)->nullable();
|
||||
$table->boolean('domiciliado')->default(false)->nullable();
|
||||
$table->boolean('plantas_medicinais')->default(false)->nullable();
|
||||
$table->string('plantas_medicinais_quais', 50)->nullable();
|
||||
$table->boolean('praticas_integrativas')->default(false)->nullable();
|
||||
|
||||
$table->string('outras_condicoes_primaria', 250)->nullable();
|
||||
$table->string('outras_condicoes_secundaria', 250)->nullable();
|
||||
$table->string('outras_condicoes_terciaria', 250)->nullable();
|
||||
|
||||
$table->foreignId('situacao_rua_id')->nullable()->constrained('atencao_basica_cadastro_situacao_rua');
|
||||
$table->boolean('outra_instituicao')->default(false)->nullable();
|
||||
$table->string('outra_instituicao_quais', 50)->nullable();
|
||||
$table->boolean('recebe_beneficio')->default(false)->nullable();
|
||||
$table->boolean('referencia_familiar')->default(false)->nullable();
|
||||
$table->boolean('visita_familiar')->default(false)->nullable();
|
||||
$table->string('parentesco', 50)->nullable();
|
||||
$table->foreignId('alimentacao_diaria_id')->nullable()->constrained('atencao_basica_cadastro_alimentacao_diaria');
|
||||
$table->boolean('higiene_pessoal')->default(false)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_individual');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroIndividualAcompanhamentoInfantilTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_individual_acompanhamento_infantil', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('cadastro_individual_id')->constrained('atencao_basica_cadastro_individual');
|
||||
$table->foreignId('acompanhamento_infantil_id')->constrained('atencao_basica_cadastro_acompanhamento_infantil');
|
||||
|
||||
$table->primary(['cadastro_individual_id', 'acompanhamento_infantil_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_individual_acompanhamento_infantil');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroIndividualDeficienciaBaseTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_individual_deficiencia_base', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('cadastro_individual_id')->constrained('atencao_basica_cadastro_individual');
|
||||
$table->foreignId('deficiencia_base_id')->constrained('cadastro_deficiencia_base');
|
||||
|
||||
$table->primary(['cadastro_individual_id', 'deficiencia_base_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_individual_deficiencia_base');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroIndividualProblemasRinsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_individual_problemas_rins', function (Blueprint $table) {
|
||||
$table->foreignId('cadastro_individual_id')->constrained('atencao_basica_cadastro_individual');
|
||||
$table->foreignId('problemas_rins_id')->constrained('atencao_basica_cadastro_problemas_rins');
|
||||
|
||||
$table->primary(['cadastro_individual_id', 'problemas_rins_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_individual_problemas_rins');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroIndividualHigienePessoalTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_individual_higiene_pessoal', function (Blueprint $table) {
|
||||
$table->foreignId('cadastro_individual_id')->constrained('atencao_basica_cadastro_individual');
|
||||
$table->foreignId('higiene_pessoal_id')->constrained('atencao_basica_cadastro_higiene_pessoal');
|
||||
|
||||
$table->primary(['cadastro_individual_id', 'higiene_pessoal_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_individual_higiene_pessoal');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroIndividualOrigemAlimentacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_individual_origem_alimentacao', function (Blueprint $table) {
|
||||
$table->foreignId('cadastro_individual_id')->constrained('atencao_basica_cadastro_individual');
|
||||
$table->foreignId('origem_alimentacao_id')->constrained('atencao_basica_cadastro_origem_alimentacao');
|
||||
|
||||
$table->primary(['cadastro_individual_id', 'origem_alimentacao_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_individual_origem_alimentacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroIndividualDoencaRespiratoriaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_individual_doenca_respiratoria', function (Blueprint $table) {
|
||||
$table->foreignId('cadastro_individual_id')->constrained('atencao_basica_cadastro_individual');
|
||||
$table->foreignId('doenca_respiratoria_id')->constrained('atencao_basica_cadastro_doenca_respiratoria');
|
||||
|
||||
$table->primary(['cadastro_individual_id', 'doenca_respiratoria_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_individual_doenca_respiratoria');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroIndividualDoencaCardiacaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_individual_doenca_cardiaca', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('cadastro_individual_id')->constrained('atencao_basica_cadastro_individual');
|
||||
$table->foreignId('doenca_cardiaca_id')->constrained('atencao_basica_cadastro_doenca_cardiaca');
|
||||
|
||||
$table->primary(['cadastro_individual_id', 'doenca_cardiaca_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_individual_doenca_cardiaca');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSupervisorIdToAtencaoBasicaCadastroIndividualTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_individual', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('supervisor_id')->nullable()->after('higiene_pessoal')->constrained('cadastro_usuario');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_individual', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['supervisor_id']);
|
||||
$table->dropColumn(['supervisor_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsExportacaoToAtencaoBasicaCadastroIndividualTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_individual', function (Blueprint $table) {
|
||||
|
||||
$table
|
||||
->foreignId('exportacao_id')
|
||||
->nullable()
|
||||
->after('id')
|
||||
->constrained('atencao_basica_exportacao');
|
||||
|
||||
$table
|
||||
->string('uuid_ficha', 44)
|
||||
->nullable()
|
||||
->after('exportacao_id')
|
||||
->unique();
|
||||
|
||||
$table
|
||||
->foreignId('usuario_exportacao_id')
|
||||
->nullable()
|
||||
->after('uuid_ficha')
|
||||
->constrained('cadastro_usuario');
|
||||
|
||||
$table
|
||||
->dateTime('data_hora_exportacao')
|
||||
->nullable()
|
||||
->after('usuario_exportacao_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_individual', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['exportacao_id']);
|
||||
$table->dropColumn(['exportacao_id']);
|
||||
|
||||
$table->dropForeign(['usuario_exportacao_id']);
|
||||
$table->dropColumn(['usuario_exportacao_id']);
|
||||
|
||||
$table->dropColumn('uuid_ficha');
|
||||
$table->dropColumn('data_hora_exportacao');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsTriaToAtencaoBasicaCadastroIndividualTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_individual', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('alimentos_acabaram')->after('supervisor_id')->nullable();
|
||||
$table->boolean('comeu_alguns_alimentos')->after('alimentos_acabaram')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_individual', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['alimentos_acabaram']);
|
||||
$table->dropColumn(['comeu_alguns_alimentos']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDataAtualizacaoTriaToAtencaoBasicaCadastroIndividual extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_individual', function (Blueprint $table) {
|
||||
$table->date('data_atualizacao_tria')
|
||||
->nullable()
|
||||
->after('comeu_alguns_alimentos');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_individual', function (Blueprint $table) {
|
||||
$table->dropColumn('data_atualizacao_tria');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user