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 CreateManutencaoStatusTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_status_tipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 50)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_status_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoPrioridadeTipo extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_prioridade_tipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 50)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_prioridade_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoParametrizacaoStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_parametrizacao_status', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('tipo_id')->constrained('manutencao_status_tipo');
|
||||
$table->string('nome', 100)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_parametrizacao_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoParametrizacaoPrioridadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_parametrizacao_prioridade', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('tipo_id')->constrained('manutencao_prioridade_tipo');
|
||||
$table->string('nome', 100)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_parametrizacao_prioridade');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoParametrizacaoSla extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_parametrizacao_sla', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('prioridade_id')->constrained('manutencao_parametrizacao_prioridade');
|
||||
$table->string('tempo_atendimento', 6);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_parametrizacao_sla');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoSolicitacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
Schema::create('manutencao_solicitacao', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('status_id')->constrained('manutencao_parametrizacao_status');
|
||||
$table->foreignId('usuario_solicitante_id')->constrained('cadastro_usuario');
|
||||
$table->foreignId('infraestrutura_solicitante_id')->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('grupo_id')->constrained('cadastro_grupo');
|
||||
$table->foreignId('subgrupo_id')->constrained('cadastro_subgrupo');
|
||||
$table->foreignId('servico_id')->constrained('cadastro_servico_manutencao');
|
||||
$table->string('assunto', 150)->nullable();
|
||||
$table->string('detalhe', 1000)->nullable();
|
||||
$table->string('codigo', 50)->nullable();
|
||||
$table->boolean('pendente_finalizacao')->default(false)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_solicitacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoGerenciamentoMensagemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_gerenciamento_mensagem', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('solicitacao_id')->constrained('manutencao_solicitacao');
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura')->nullable();
|
||||
$table->foreignId('usuario_id')->constrained('cadastro_usuario');
|
||||
$table->string('mensagem', 500);
|
||||
$table->boolean('is_respondida')->default(false);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_gerenciamento_mensagem');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoSolicitacaoCausaProvavelTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_solicitacao_causa_provavel', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('solicitacao_id')->constrained('manutencao_solicitacao');
|
||||
$table->foreignId('causa_provavel_id')->constrained('cadastro_servico_manutencao_causas_provaveis');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_solicitacao_causa_provavel');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoSolicitacaoRespostaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_solicitacao_resposta', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('solicitacao_id')->constrained('manutencao_solicitacao');
|
||||
$table->foreignId('mensagem_id')->constrained('manutencao_gerenciamento_mensagem');
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura')->nullable();
|
||||
$table->foreignId('usuario_id')->constrained('cadastro_usuario');
|
||||
$table->string('mensagem', 500);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_solicitacao_resposta');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoStatusOrigemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_status_origem', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 50)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_status_origem');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoSolicitacaoStatusHistoricoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_solicitacao_status_historico', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('solicitacao_id')->constrained('manutencao_solicitacao');
|
||||
$table->foreignId('status_id')->constrained('manutencao_parametrizacao_status');
|
||||
$table->foreignId('origem_id')->constrained('manutencao_status_origem');
|
||||
$table->foreignId('usuario_id')->constrained('cadastro_usuario');
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura');
|
||||
$table->string('mensagem', 500)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_solicitacao_status_historico');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFiledsToManutencaoSolicitacao extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('manutencao_solicitacao', function (Blueprint $table) {
|
||||
$table->foreignId('prestador_id')->nullable()->constrained('cadastro_servico_manutencao_prestador_fornecedor')->after('pendente_finalizacao');
|
||||
$table->date('data_agendamento')->nullable()->after('prestador_id');
|
||||
$table->string('os_prestador', 10)->nullable()->after('data_agendamento');
|
||||
$table->decimal('custo', 8, 2)->nullable()->after('os_prestador');
|
||||
$table->foreignId('usuario_atendente_id')->nullable()->constrained('cadastro_usuario')->after('custo');
|
||||
$table->foreignId('usuario_finalizador_id')->nullable()->constrained('cadastro_usuario')->after('usuario_atendente_id');
|
||||
$table->foreignId('infraestrutura_atendente_id')->nullable()->constrained('cadastro_infraestrutura')->after('usuario_finalizador_id');
|
||||
$table->foreignId('infraestrutura_finalizador_id')->nullable()->constrained('cadastro_infraestrutura')->after('infraestrutura_atendente_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('manutencao_solicitacao', function (Blueprint $table) {
|
||||
$table->dropColumn('prestador_id');
|
||||
$table->dropColumn('data_agendamento');
|
||||
$table->dropColumn('os_prestador');
|
||||
$table->dropColumn('custo');
|
||||
$table->dropColumn('usuario_atendente_id');
|
||||
$table->dropColumn('usuario_finalizador_id');
|
||||
$table->dropColumn('infraestrutura_atendente_id');
|
||||
$table->dropColumn('infraestrutura_finalizador_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFiledsToManutencaoSolicitacaoStatusHistorico extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('manutencao_solicitacao_status_historico', function (Blueprint $table) {
|
||||
$table->foreignId('prestador_id')->nullable()->constrained('cadastro_servico_manutencao_prestador_fornecedor')->after('pendente_finalizacao');
|
||||
$table->date('data_agendamento')->nullable()->after('prestador_id');
|
||||
$table->string('os_prestador', 10)->nullable()->after('data_agendamento');
|
||||
$table->decimal('custo', 8, 2)->nullable()->after('os_prestador');
|
||||
$table->foreignId('usuario_atendente_id')->nullable()->constrained('cadastro_usuario')->after('custo');
|
||||
$table->foreignId('usuario_finalizador_id')->nullable()->constrained('cadastro_usuario')->after('usuario_atendente_id');
|
||||
$table->foreignId('infraestrutura_atendente_id')->nullable()->constrained('cadastro_infraestrutura')->after('usuario_finalizador_id');
|
||||
$table->foreignId('infraestrutura_finalizador_id')->nullable()->constrained('cadastro_infraestrutura')->after('infraestrutura_atendente_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('manutencao_solicitacao_status_historico', function (Blueprint $table) {
|
||||
$table->dropColumn('prestador_id');
|
||||
$table->dropColumn('data_agendamento');
|
||||
$table->dropColumn('os_prestador');
|
||||
$table->dropColumn('custo');
|
||||
$table->dropColumn('usuario_atendente_id');
|
||||
$table->dropColumn('usuario_finalizador_id');
|
||||
$table->dropColumn('infraestrutura_atendente_id');
|
||||
$table->dropColumn('infraestrutura_finalizador_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterUnicidadeInCadastroUnidadeExecutanteManutencao extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('cadastro_unidade_executante_manutencao', function (Blueprint $table) {
|
||||
$table->unique(['infraestrutura_id', 'usuario_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('cadastro_unidade_executante_manutencao', function (Blueprint $table) {
|
||||
$table->dropUnique(['infraestrutura_id', 'usuario_id']);
|
||||
$table->inique(['infraestrutura_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterObservacaoInCadastroServicoManutencaoCausasProvaveis extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('cadastro_servico_manutencao_causas_provaveis', function (Blueprint $table) {
|
||||
$table->string('observacao', 1000)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('cadastro_servico_manutencao_causas_provaveis', function (Blueprint $table) {
|
||||
$table->string('observacao', 100)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateManutencaoSolicitacaoItensAlmoxarifadoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('manutencao_solicitacao_itens_almoxarifado', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('solicitacao_id')->constrained('manutencao_solicitacao');
|
||||
$table->foreignId('material_id')->constrained('cadastro_material');
|
||||
$table->integer('quantidade');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('manutencao_solicitacao_itens_almoxarifado');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user