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 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