File: /var/www/ipsremont-demo/database/migrations/2020_11_05_202619_create_services.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateServices extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('services', function (Blueprint $table) {
$table->id();
$table->string('name')->comment('Наименование сервиса');
$table->string('country')->nullable()->comment('Страна');
$table->string('city')->nullable()->comment('Город');
$table->string('physical_address')->nullable()->comment('Физический адрес');
$table->string('inn')->nullable()->comment('ИНН');
$table->string('additional_info', 500)->nullable()->comment('Дополнительная информация');
$table->string('legal_address')->nullable()->comment('Юридический адрес');
$table->string('bank_name')->nullable()->comment('Наименование банка');
$table->string('bank_bik')->nullable()->comment('бик');
$table->string('bank_inn')->nullable()->comment('инн банка');
$table->string('bank_score')->nullable()->comment('банковский счет');
$table->string('bank_cor_score')->nullable()->comment('кор счет');
$table->integer('branch_id')->nullable()->comment('подразделение');
$table->boolean('display')->default(false)->comment('Включен / Выключен филиал');
$table->string('external_id', 50)->comment('uuid 1C')->nullable();
$table->softDeletes();
$table->timestamp('created_at')->nullable()->useCurrent();
$table->timestamp('updated_at')->nullable()->useCurrent();
$table->index('external_id');
$table->unique(['name', 'deleted_at']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('services');
}
}