clrghouz/database/migrations/2019_04_16_105253_create_zones.php

53 lines
1.1 KiB
PHP
Raw Normal View History

2019-04-26 04:30:00 +00:00
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateZones extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('zones', function (Blueprint $table) {
2021-05-13 12:40:21 +00:00
$table->id();
$table->timestamps();
$table->integer('zone_id');
$table->string('description')->nullable();
2021-05-13 12:40:21 +00:00
$table->boolean('active');
$table->string('notes')->nullable();
$table->boolean('public')->default(TRUE);
$table->ipAddress('ipv4')->nullable();
$table->integer('ipv4_mask')->nullable();
$table->ipAddress('ipv6')->nullable();
$table->integer('ipv6_mask')->nullable();
$table->integer('domain_id')->nullable()->unique();
$table->foreign('domain_id')->references('id')->on('domains');
$table->binary('zt_id',10)->nullable()->unique();
$table->foreign('zt_id')->references('id')->on('zt');
2021-05-13 12:40:21 +00:00
$table->unique(['zone_id','domain_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('zones');
}
2019-04-26 04:30:00 +00:00
}