<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDomainsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('domains', function (Blueprint $table) {
$table->string('domain')->unique();
$table->unsignedInteger('user_id')->nullable(false)
->comment('Albarid for best performance with relations tables');
$table->text('description')->nullable();
$table->text('disclaimer')->nullable();
$table->unsignedInteger('aliases')->nullable(false)->default(0);
$table->unsignedInteger('mailboxes')->nullable(false)->default(0);
$table->unsignedInteger('maillists')->nullable(false)->default(0);
$table->unsignedInteger('quota')->nullable(false)->default(0)->comment('Real quota asigned in Mb');
$table->unsignedInteger('max_quota')->nullable(false)->default(0)->comment('Grace quota asigned in Mb');
$table->unsignedBigInteger('quota_used')->nullable(false)->default(0)->comment('Quota used in Bytes');
$table->unsignedInteger('quota_user_default')->nullable(false)->default(1024)
->comment('QUota default mailbox in Megabytes');
$table->string('transport')->nullable(false)->default('dovecot');
$table->boolean('backupmx')->nullable(false)->default(false)->index();
// $table->json('settings')->nullable();
$table->boolean('active')->nullable(false)->default(true)->index();
$table->timestamps();
$table->softDeletes();
$table->timestamp('expires_in')->nullable(true)->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('domains');
}
}