init commit
All checks were successful
build-api-image / build (push) Successful in 51s

This commit is contained in:
Antonio Lopes dos Santos
2026-08-04 16:52:02 -03:00
commit afec302c3e
11594 changed files with 1636728 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCadastroFornecedorCategoriaTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cadastro_fornecedor_categoria', 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('cadastro_fornecedor_categoria');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCadastroFornecedorTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cadastro_fornecedor', function (Blueprint $table) {
$table->id();
$table->string('cnpj', 14)->unique();
$table->string('inscricao_estadual', 14)->nullable()->unique();
$table->string('nome_fantasia', 255)->unique();
$table->string('razao_social', 255)->unique();
$table->foreignId('categoria_id')->nullable()->constrained('cadastro_fornecedor_categoria');
$table->string('site', 180)->nullable();
$table->foreignId('endereco_id')->nullable()->constrained('cadastro_endereco');
MigrationUtil::addCommonFields($table);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cadastro_fornecedor');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCadastroFornecedorTelefoneTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cadastro_fornecedor_telefone', function (Blueprint $table) {
$table->id();
$table->foreignId('fornecedor_id')->constrained('cadastro_fornecedor')->onDelete('cascade');
$table->string('numero', 11);
$table->string('observacao', 50)->nullable();
MigrationUtil::addCommonFields($table);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cadastro_fornecedor_telefone');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCadastroFornecedorContatoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cadastro_fornecedor_contato', function (Blueprint $table) {
$table->id();
$table->foreignId('fornecedor_id')->constrained('cadastro_fornecedor')->onDelete('cascade');
$table->string('nome', 150);
$table->string('departamento', 50)->nullable();
$table->string('cargo', 50)->nullable();
$table->string('telefone', 11)->nullable();
$table->string('email', 180)->nullable();
MigrationUtil::addCommonFields($table);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cadastro_fornecedor_contato');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class SetCnpjToNullableAtCadastroFornecedorTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cadastro_fornecedor', function (Blueprint $table) {
$table->string('cnpj', 14)->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cadastro_fornecedor', function (Blueprint $table) {
$table->string('cnpj', 14)->nullable(false)->change();
});
}
}