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 CreateWebServicePermissaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_permissao', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 100);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_permissao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceUsuarioTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_usuario', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->string('nome', 150);
|
||||
$table->string('usuario', 100)->unique();
|
||||
$table->string('senha', 255);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_usuario');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceUsuarioPermissaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_usuario_permissao', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('usuario_id')->constrained('web_service_usuario')->onDelete('cascade');
|
||||
$table->foreignId('permissao_id')->constrained('web_service_permissao');
|
||||
|
||||
$table->primary(['usuario_id', 'permissao_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_usuario_permissao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceLogAcessoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_log_acesso', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('usuario_id')->constrained('web_service_usuario')->onDelete('cascade');
|
||||
$table->string('controlador', 200);
|
||||
$table->string('metodo', 100);
|
||||
$table->timestamp('acessado_em');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_log_acesso');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteUnidadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_unidade', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_centro_custo_id')->on('cadastro_centro_custo')->nullable();
|
||||
$table->string('nome', 100)->unique();
|
||||
$table->string('cnes', 7)->nullable();
|
||||
$table->boolean('is_almoxarifado');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_unidade');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteMaterialTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_material', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_material_id')->on('cadastro_material')->nullable();
|
||||
$table->string('nome', 100)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_material');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteFornecedorTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_fornecedor', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_fornecedor_id')->on('cadastro_fornecedor')->nullable();
|
||||
$table->string('nome', 100)->unique();
|
||||
$table->string('cnpj', 14)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_fornecedor');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteFabricanteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_fabricante', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_fabricante_id')->on('cadastro_fabricante')->nullable();
|
||||
$table->string('nome', 100)->unique();
|
||||
$table->string('cnpj', 14)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_fabricante');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClientePeriodoContabilTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_periodo_contabil', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->date('inicio');
|
||||
$table->date('fim');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_periodo_contabil');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteEntradaStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_entrada_status', 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('web_service_almoxarifado_cliente_entrada_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteEntradaDocumentoTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_entrada_documento_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('web_service_almoxarifado_cliente_entrada_documento_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteEntradaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_entrada', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_entrada_id')->nullable()->constrained('almoxarifado_entrada');
|
||||
$table->foreignId('unidade_id')->constrained('web_service_almoxarifado_cliente_unidade');
|
||||
$table->foreignId('fornecedor_id')->constrained('web_service_almoxarifado_cliente_fornecedor');
|
||||
$table->unsignedBigInteger('codigo_nota');
|
||||
$table->foreignId('documento_tipo_id')->constrained('web_service_almoxarifado_cliente_entrada_documento_tipo');
|
||||
$table->date('data_documento');
|
||||
$table->string('numero_documento', 10)->nullable();
|
||||
$table->string('numero_pedido', 20)->nullable();
|
||||
$table->foreignId('status_id')->constrained('web_service_almoxarifado_cliente_entrada_status');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_entrada');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteEntradaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_entrada_item', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('entrada_id')->constrained('web_service_almoxarifado_cliente_entrada')->onDelete('cascade');
|
||||
$table->foreignId('material_id')->constrained('web_service_almoxarifado_cliente_material');
|
||||
$table->foreignId('fabricante_id')->constrained('web_service_almoxarifado_cliente_fabricante');
|
||||
$table->string('lote', 15);
|
||||
$table->date('validade_lote');
|
||||
$table->integer('quantidade');
|
||||
$table->decimal('valor_unitario', 14, 6);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_entrada_item');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceLaboratorioClienteLaboratorioTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_laboratorio_cliente_laboratorio', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_infraestrutura_id')->constrained('cadastro_infraestrutura');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_laboratorio_cliente_laboratorio');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceLaboratorioClienteExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_laboratorio_cliente_exame', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('laboratorio_id')->constrained('web_service_laboratorio_cliente_laboratorio');
|
||||
$table->foreignId('conectasus_exame_id')->nullable()->constrained('parametrizacao_exame');
|
||||
$table->string('nome', 200);
|
||||
|
||||
$table->unique(['laboratorio_id', 'nome']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_laboratorio_cliente_exame');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceLaboratorioClientePedidoStatus extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_laboratorio_cliente_pedido_status', 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('web_service_laboratorio_cliente_pedido_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceLaboratorioClientePedidoMovimentacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_laboratorio_cliente_pedido_movimentacao', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_exame_laboratorial_agendamento_id')->constrained('exame_laboratorial_agendamento');
|
||||
$table->foreignId('status_id')->constrained('web_service_laboratorio_cliente_pedido_status');
|
||||
$table->string('motivo', 500)->nullable();
|
||||
$table->timestamp('movimentado_em');
|
||||
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_laboratorio_cliente_pedido_movimentacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTimestampsToWebServiceLaboratorioClientePedidoMovimentacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('web_service_laboratorio_cliente_pedido_movimentacao', function (Blueprint $table) {
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('web_service_laboratorio_cliente_pedido_movimentacao', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['created_at', 'updated_at']);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user