42 lines
1007 B
PHP
42 lines
1007 B
PHP
|
<?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');
|
||
|
}
|
||
|
}
|