Changed to using new Address Model, Implemented Setup, Some minor CSS changes
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSystemToSetups extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('setups', function (Blueprint $table) {
|
||||
$table->integer('options');
|
||||
$table->integer('system_id');
|
||||
$table->foreign('system_id')->references('id')->on('systems');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('setups', function (Blueprint $table) {
|
||||
$table->dropForeign(['system_id']);
|
||||
$table->dropColumn(['system_id','options']);
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddMailerToSystem extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('systems', function (Blueprint $table) {
|
||||
$table->string('mailer_address')->nullable();
|
||||
$table->integer('mailer_port')->nullable();
|
||||
$table->integer('mailer_type')->nullable();
|
||||
$table->string('zt_id',10)->nullable()->unique();
|
||||
|
||||
$table->unique(['mailer_type','mailer_address','mailer_port']);
|
||||
});
|
||||
|
||||
Schema::table('zones', function (Blueprint $table) {
|
||||
$table->dropColumn(['ztid']);
|
||||
});
|
||||
|
||||
Schema::table('zones', function (Blueprint $table) {
|
||||
$table->string('zt_id',16)->unique()->nullable();
|
||||
|
||||
$table->ipAddress('zt_ipv4')->nullable();
|
||||
$table->integer('zt_ipv4_mask')->nullable();
|
||||
$table->unique(['zt_ipv4','zt_ipv4_mask']);
|
||||
$table->ipAddress('zt_ipv6')->nullable();
|
||||
$table->integer('zt_ipv6_mask')->nullable();
|
||||
$table->unique(['zt_ipv6','zt_ipv6_mask']);
|
||||
});
|
||||
|
||||
Schema::create('address_zone', function (Blueprint $table) {
|
||||
$table->string('sespass')->nullable();
|
||||
$table->string('pktpass',8)->nullable();
|
||||
$table->string('ticpass')->nullable();
|
||||
$table->string('fixpass')->nullable();
|
||||
|
||||
$table->ipAddress('zt_ipv4')->nullable();
|
||||
$table->ipAddress('zt_ipv6')->nullable();
|
||||
|
||||
$table->integer('system_id');
|
||||
$table->foreign('system_id')->references('id')->on('systems');
|
||||
$table->integer('zone_id');
|
||||
$table->foreign('zone_id')->references('id')->on('zones');
|
||||
|
||||
$table->unique(['system_id','zone_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('address_zone');
|
||||
|
||||
Schema::table('zones', function (Blueprint $table) {
|
||||
$table->dropUnique(['zt_id']);
|
||||
$table->dropColumn(['zt_id']);
|
||||
$table->dropUnique(['zt_ipv4','zt_ipv4_mask']);
|
||||
$table->dropUnique(['zt_ipv6','zt_ipv6_mask']);
|
||||
$table->dropColumn(['zt_ipv4','zt_ipv4_mask']);
|
||||
$table->dropColumn(['zt_ipv6','zt_ipv6_mask']);
|
||||
});
|
||||
|
||||
Schema::table('zones', function (Blueprint $table) {
|
||||
$table->string('ztid')->nullable();
|
||||
});
|
||||
|
||||
Schema::table('systems', function (Blueprint $table) {
|
||||
$table->dropUnique(['zt_id']);
|
||||
$table->dropUnique(['mailer_type','mailer_address','mailer_port']);
|
||||
$table->dropColumn(['mailer_address','mailer_port','mailer_type','zt_id']);
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user