53 lines
1.3 KiB
PHP
53 lines
1.3 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('module_ip_address', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('vm_name')->nullable();
|
|
|
|
$table->foreignId('module_network_id')
|
|
->nullable()
|
|
->constrained('module_network')
|
|
->nullOnDelete();
|
|
|
|
$table->foreignId('module_host_id')
|
|
->nullable()
|
|
->constrained('module_host')
|
|
->nullOnDelete();
|
|
|
|
$table->string('ip')->nullable();
|
|
$table->string('gateway')->nullable();
|
|
$table->string('netmask')->nullable();
|
|
$table->string('dns')->nullable();
|
|
|
|
$table->tinyInteger('status')
|
|
->default(0)
|
|
->comment('1: assign; 0: free');
|
|
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('module_ip_address');
|
|
}
|
|
};
|