feat: implement tenant management system including CRUD operations and domain bootstrapping functionality

This commit is contained in:
2026-06-26 11:55:05 -03:00
parent 4c237fb729
commit 0dae985230
17 changed files with 9 additions and 567 deletions

View File

@@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('tenant_props', function (Blueprint $table) {
$table->id();
$table->string('codigo')->unique();
$table->string('nombre');
$table->text('descripcion')->nullable();
$table->boolean('is_required')->default(false);
$table->string('data_type');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tenant_props');
}
};

View File

@@ -1,44 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('tenant_prop_values', function (Blueprint $table) {
$table->id();
$table->string('tenant_codigo');
$table->string('tenant_prop_codigo');
$table->text('value')->nullable();
$table->timestamps();
$table->foreign('tenant_codigo')
->references('codigo')
->on('tenants')
->cascadeOnUpdate()
->cascadeOnDelete();
$table->foreign('tenant_prop_codigo')
->references('codigo')
->on('tenant_props')
->cascadeOnUpdate()
->cascadeOnDelete();
$table->unique(['tenant_codigo', 'tenant_prop_codigo']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tenant_prop_values');
}
};