File: /var/www/ipsremont-demo/database/migrations/2020_10_24_154846_create_branches.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBranches extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('branches', function (Blueprint $table) {
$table->id();
$table->string('name')->comment('наименование филиала');
$table->longText('description')->nullable()->comment('описание филиала');
$table->string('address')->nullable()->comment('адрес филиала');
$table->boolean('display')->default(false)->comment('Включен / Выключен филиал');
$table->softDeletes();
$table->timestamp('created_at')->nullable()->useCurrent();
$table->timestamp('updated_at')->nullable()->useCurrent();
$table->unique(['name', 'deleted_at']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('branches');
}
}