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 CreateCadastroFabricanteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cadastro_fabricante', function (Blueprint $table) {
$table->id();
$table->string('nome', 180);
$table->string('cnpj', 14);
MigrationUtil::addCommonFields($table);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cadastro_fabricante');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCadastroFabricanteTipoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cadastro_fabricante_tipo', function (Blueprint $table) {
MigrationUtil::idWithoutIncrements($table);
$table->string('nome', 20)->unique();
MigrationUtil::addCommonFields($table, ['staticData' => true]);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cadastro_fabricante_tipo');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddTipoIdToCadastroFabricanteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cadastro_fabricante', function (Blueprint $table) {
$table->foreignId('tipo_id')->after('id')->constrained('cadastro_fabricante_tipo');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cadastro_fabricante', function (Blueprint $table) {
MigrationUtil::dropColumnWithForeign($table, 'tipo_id');
});
}
}

View File

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