clrghouz/database/migrations/2019_04_16_105253_create_zones.php

42 lines
1007 B
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) {
$table->integer('id')->primary();
$table->timestamps();
$table->binary('zt_id',10)->nullable();
$table->binary('ztnet',6)->nullable();
$table->ipAddress('ipv4')->nullable();
$table->integer('ipv4_mask')->nullable();
$table->ipAddress('ipv6')->nullable();
$table->integer('ipv6_mask')->nullable();
$table->unique('zt_id');
$table->foreign('zt_id')->references('id')->on('zt');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('zones');
}
}