This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroHigieneResidencialTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_higiene_residencial', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_higiene_residencial');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroLazerTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_lazer', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_lazer');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroImovelTipo extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_imovel_tipo', 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_imovel_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroSituacaoDomicilio extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_situacao_domicilio', 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_domicilio');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroDomicilioTipo extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_domicilio_tipo', 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_domicilio_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroSituacaoRural extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_situacao_rural', 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_rural');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroDomicilioTipoAcesso extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_domicilio_tipo_acesso', 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_domicilio_tipo_acesso');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroMaterialPredominante extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_material_predominante', 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_material_predominante');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroAbastecimento extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_abastecimento', 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_abastecimento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroTratamento extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_tratamento', 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_tratamento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroDestinoLixo extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_destino_lixo', 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_destino_lixo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroFormaEscoamento extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_forma_escoamento', 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_forma_escoamento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroAnimal extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_animal', 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_animal');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroDomiciliarTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_domiciliar', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('domicilio_id')->constrained('cadastro_domicilio');
|
||||
$table->foreignId('microarea_id')->nullable()->constrained('atencao_basica_parametrizacao_microarea');
|
||||
$table->boolean('fora_area')->nullable();
|
||||
|
||||
$table->string('instituicao_nome', 100)->nullable();
|
||||
$table->boolean('instituicao_outros_profissionais')->nullable();
|
||||
$table->string('instituicao_nome_responsavel_tecnico', 70)->nullable();
|
||||
$table->char('instituicao_cns_responsavel_tecnico', 15)->nullable();
|
||||
$table->string('instituicao_cargo_responsavel_tecnico', 70)->nullable();
|
||||
$table->string('instituicao_telefone_responsavel_tecnico', 11)->nullable();
|
||||
|
||||
$table->foreignId('imovel_tipo_id')->nullable()->constrained('atencao_basica_cadastro_imovel_tipo');
|
||||
$table->foreignId('situacao_domicilio_id')->nullable()->constrained('atencao_basica_cadastro_situacao_domicilio');
|
||||
$table->foreignId('domicilio_tipo_id')->nullable()->constrained('atencao_basica_cadastro_domicilio_tipo');
|
||||
$table->integer('quantidade_comodos')->nullable();
|
||||
$table->foreignId('situacao_rural_id')->nullable()->constrained('atencao_basica_cadastro_situacao_rural');
|
||||
$table->foreignId('domicilio_zona_id')->nullable()->constrained('cadastro_zona');
|
||||
$table->foreignId('domicilio_tipo_acesso_id')->nullable()->constrained('atencao_basica_cadastro_domicilio_tipo_acesso');
|
||||
$table->foreignId('material_predominante_id')->nullable()->constrained('atencao_basica_cadastro_material_predominante');
|
||||
$table->foreignId('abastecimento_id')->nullable()->constrained('atencao_basica_cadastro_abastecimento');
|
||||
$table->foreignId('tratamento_id')->nullable()->constrained('atencao_basica_cadastro_tratamento');
|
||||
$table->foreignId('destino_lixo_id')->nullable()->constrained('atencao_basica_cadastro_destino_lixo');
|
||||
$table->foreignId('forma_escoamento_id')->nullable()->constrained('atencao_basica_cadastro_forma_escoamento');
|
||||
$table->boolean('possui_animais')->nullable();
|
||||
$table->boolean('energia_eletrica')->nullable();
|
||||
$table->integer('quantidade_animais')->nullable();
|
||||
|
||||
$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->foreignId('higiene_residencial_id')->nullable()->constrained('atencao_basica_cadastro_higiene_residencial');
|
||||
$table->boolean('bolsa_familia')->nullable();
|
||||
$table->boolean('vale_gas')->nullable();
|
||||
$table->boolean('bolsa_escola')->nullable();
|
||||
|
||||
$table->boolean('recusa_cadastro')->default(false)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_domiciliar');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroDomiciliarLazerTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_domiciliar_lazer', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('cadastro_domiciliar_id')->constrained('atencao_basica_cadastro_domiciliar');
|
||||
$table->foreignId('lazer_id')->constrained('atencao_basica_cadastro_lazer');
|
||||
|
||||
$table->primary(['cadastro_domiciliar_id', 'lazer_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_domiciliar_lazer');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroDomiciliarAnimalTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_domiciliar_animal', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('cadastro_domiciliar_id')->constrained('atencao_basica_cadastro_domiciliar');
|
||||
$table->foreignId('animal_id')->constrained('atencao_basica_cadastro_animal');
|
||||
|
||||
$table->primary(['cadastro_domiciliar_id', 'animal_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_domiciliar_animal');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddEscalaCoelhoIdToAtencaoBasicaCadastroDomiciliarTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_domiciliar', function (Blueprint $table) {
|
||||
|
||||
$table
|
||||
->foreignId('escala_coelho_id')
|
||||
->nullable()
|
||||
->after('data_usuario_responsavel')
|
||||
->constrained('atencao_basica_cadastro_escala_coelho');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_domiciliar', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['escala_coelho_id']);
|
||||
$table->dropColumn(['escala_coelho_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsExportacaoToAtencaoBasicaCadastroDomiciliarTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_cadastro_domiciliar', 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_domiciliar', 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');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user