my-idlers/database/migrations/2022_02_21_001233_create_ips_table.php
cp6 52a5c2427c Updated migrations for primary keys
Updated migrations for primary keys
2022-03-05 11:05:30 +11:00

27 lines
698 B
PHP

<?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) {
$table->char('id', 8)->primary();
$table->char('service_id', 8);
$table->string('address');
$table->tinyInteger('is_ipv4')->default(1);
$table->tinyInteger('active')->default(1);
$table->timestamps();
$table->unique(['service_id','address'], 'uni');
});
}
public function down()
{
Schema::dropIfExists('ips');
}
}