2026-05-26 08:14:29 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
|
|
return new class extends Migration
|
|
|
|
|
{
|
|
|
|
|
public function up(): void
|
|
|
|
|
{
|
2026-06-17 19:13:40 +02:00
|
|
|
if (Schema::hasTable('tenants')) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-26 08:14:29 +02:00
|
|
|
Schema::create('tenants', function (Blueprint $table) {
|
|
|
|
|
$table->id();
|
|
|
|
|
$table->string('nome');
|
|
|
|
|
$table->string('slug')->unique();
|
|
|
|
|
$table->string('email')->nullable();
|
|
|
|
|
$table->string('telefono')->nullable();
|
|
|
|
|
$table->text('note')->nullable();
|
|
|
|
|
$table->boolean('attivo')->default(true);
|
|
|
|
|
$table->timestamps();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function down(): void
|
|
|
|
|
{
|
|
|
|
|
Schema::dropIfExists('tenants');
|
|
|
|
|
}
|
|
|
|
|
};
|