2022-02-21 01:17:59 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
class CreateIPsTable extends Migration
|
|
|
|
{
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('ips', function (Blueprint $table) {
|
2022-03-05 01:05:30 +01:00
|
|
|
$table->char('id', 8)->primary();
|
|
|
|
$table->char('service_id', 8);
|
2022-02-21 01:17:59 +01:00
|
|
|
$table->string('address');
|
|
|
|
$table->tinyInteger('is_ipv4')->default(1);
|
|
|
|
$table->tinyInteger('active')->default(1);
|
|
|
|
$table->timestamps();
|
2022-03-04 15:02:39 +01:00
|
|
|
$table->unique(['service_id','address'], 'uni');
|
2022-02-21 01:17:59 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('ips');
|
|
|
|
}
|
|
|
|
}
|