vernova/database/migrations/2024_01_01_000002_create_tenants_table.php
2026-07-26 19:58:27 +03:30

33 lines
1.1 KiB
PHP

<?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
{
Schema::create('tenants', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->string('domain')->nullable();
$table->boolean('is_active')->default(true);
$table->string('default_locale', 10)->default('fa');
$table->enum('default_calendar', ['gregorian', 'jalali', 'hijri'])->default('jalali');
$table->foreignId('base_currency_id')->nullable()->constrained('currencies')->nullOnDelete();
$table->boolean('allow_multi_currency')->default(false);
$table->string('logo_path')->nullable();
$table->json('settings')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
public function down(): void
{
Schema::dropIfExists('tenants');
}
};