Minor DB rework, remove spaces in database/migration files

This commit is contained in:
Deon George
2021-05-03 22:12:26 +10:00
parent 6f4c58f01f
commit bede0a5880
13 changed files with 433 additions and 252 deletions

View File

@@ -6,36 +6,44 @@ 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();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('zones', function (Blueprint $table) {
$table->integer('id')->primary();
$table->timestamps();
$table->unique('zt_id');
$table->foreign('zt_id')->references('id')->on('zt');
});
$table->integer('zone_id');
$table->string('description')->nullable();
$table->boolean('active')->default(TRUE);
$table->boolean('public')->default(TRUE);
}
$table->ipAddress('ipv4')->nullable();
$table->integer('ipv4_mask')->nullable();
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('zones');
}
$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');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('zones');
}
}