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 CreateProntoAtendimentoEscalaTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pronto_atendimento_escala_tipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 8);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pronto_atendimento_escala_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProntoAtendimentoPlantaoStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pronto_atendimento_plantao_status', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 34);
|
||||
$table->string('cor', 21);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pronto_atendimento_plantao_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use App\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProntoAtendimentoPlantaoGrupoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pronto_atendimento_plantao_grupo', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('lotacao_id')->constrained('cadastro_lotacao');
|
||||
$table->foreignId('centro_custo_id')->constrained('cadastro_centro_custo');
|
||||
$table->foreignId('escala_tipo_id')->constrained('pronto_atendimento_escala_tipo');
|
||||
$table->foreignId('faixa_etaria_id')->constrained('geral_faixa_etaria');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pronto_atendimento_plantao_grupo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProntoAtendimentoPlantaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pronto_atendimento_plantao', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('grupo_id')->constrained('pronto_atendimento_plantao_grupo');
|
||||
|
||||
// Não deveria ser nullable, mas se não for, o Laravel está adicionando automanticamente
|
||||
// "current_timestamp() ON UPDATE current_timestamp()" como default.
|
||||
$table->timestamp('inicio')->nullable();
|
||||
|
||||
// Não deveria ser nullable, mas se não for, o Laravel está adicionando automanticamente
|
||||
// "'0000-00-00 00:00:00'" como default.
|
||||
$table->timestamp('fim')->nullable();
|
||||
|
||||
$table->integer('quantidade_atendimentos')->nullable();
|
||||
$table->foreignId('status_id')->constrained('pronto_atendimento_plantao_status');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pronto_atendimento_plantao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterFaixaEtariaIdToNullableOnProntoAtendimentoPlantaoGrupo extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao_grupo', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('faixa_etaria_id')->nullable(true)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao_grupo', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('faixa_etaria_id')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsToProntoAtendimentoPlantao extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('lotacao_id')->after('id')->constrained('cadastro_lotacao');
|
||||
$table->foreignId('centro_custo_id')->after('lotacao_id')->constrained('cadastro_centro_custo');
|
||||
$table->foreignId('escala_tipo_id')->after('centro_custo_id')->constrained('pronto_atendimento_escala_tipo');
|
||||
$table->foreignId('faixa_etaria_id')->after('escala_tipo_id')->nullable()->constrained('geral_faixa_etaria');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['lotacao_id']);
|
||||
$table->dropForeign(['centro_custo_id']);
|
||||
$table->dropForeign(['escala_tipo_id']);
|
||||
$table->dropForeign(['faixa_etaria_id']);
|
||||
|
||||
$table->dropColumn(['lotacao_id', 'centro_custo_id', 'escala_tipo_id', 'faixa_etaria_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropGrupoIdOnProntoAtendimentoPlantao extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['grupo_id']);
|
||||
$table->dropColumn('grupo_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('grupo_id')->constrained('pronto_atendimento_plantao_grupo');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropProntoAtendimentoPlantaoGrupoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::dropIfExists('pronto_atendimento_plantao_grupo');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::create('pronto_atendimento_plantao_grupo', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('lotacao_id')->constrained('cadastro_lotacao');
|
||||
$table->foreignId('centro_custo_id')->constrained('cadastro_centro_custo');
|
||||
$table->foreignId('escala_tipo_id')->constrained('pronto_atendimento_escala_tipo');
|
||||
$table->foreignId('faixa_etaria_id')->nullable()->constrained('geral_faixa_etaria');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCorHoverToProntoAtendimentoPlantaoStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao_status', function (Blueprint $table) {
|
||||
|
||||
$table->string('cor_hover', 21);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao_status', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('cor_hover');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropCorHoverOnProntoAtendimentoPlantaoStatus extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao_status', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('cor_hover');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao_status', function (Blueprint $table) {
|
||||
|
||||
$table->string('cor_hover', 21);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropCentroCustoIdOnProntoAtendimentoPlantao extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['centro_custo_id']);
|
||||
$table->dropColumn('centro_custo_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('centro_custo_id')->after('lotacao_id')->constrained('cadastro_centro_custo');
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddServicoIdToProntoAtendimentoPlantao extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('servico_id')->after('lotacao_id')->constrained('cadastro_servico');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_plantao', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['servico_id']);
|
||||
$table->dropColumn(['servico_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTempoAdicionalPlantaoToProntoAtendimentoParametrizacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_parametrizacao', function (Blueprint $table) {
|
||||
$table->integer('tempo_adicional_plantao')->nullable()->after('assinatura_eletronica');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_parametrizacao', function (Blueprint $table) {
|
||||
$table->dropColumn('tempo_adicional_plantao');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user