mailwolt/database/migrations/2025_09_27_153255_create_do...

41 lines
1.4 KiB
PHP

<?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('domains', function (Blueprint $table) {
$table->id();
$table->string('domain', 191)->unique();
$table->string('description', 500)->nullable();
$table->string('tags', 500)->nullable();
$table->boolean('is_active')->default(true)->index();
$table->boolean('is_system')->default(false);
$table->boolean('is_server')->default(false)->index();
$table->unsignedInteger('max_aliases')->default(400);
$table->unsignedInteger('max_mailboxes')->default(10);
$table->unsignedInteger('default_quota_mb')->default(3072);
$table->unsignedInteger('max_quota_per_mailbox_mb')->default(10240);
$table->unsignedBigInteger('total_quota_mb')->default(0);
$table->unsignedInteger('rate_limit_per_hour')->nullable();
$table->boolean('rate_limit_override')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('domains');
}
};