InfraHub
30 строк · 676.0 Байт
1<?php
2
3use Illuminate\Database\Migrations\Migration;
4use Illuminate\Database\Schema\Blueprint;
5use Illuminate\Support\Facades\Schema;
6
7class CreateServersTable extends Migration
8{
9/**
10* Run the migrations.
11*/
12public function up()
13{
14Schema::create('servers', function (Blueprint $table) {
15$table->id();
16$table->string('hostname');
17$table->string('ip_address')->unique();
18$table->string('status')->default('offline');
19$table->timestamps();
20});
21}
22
23/**
24* Reverse the migrations.
25*/
26public function down()
27{
28Schema::dropIfExists('servers');
29}
30}
31