File: /var/www/ipsremont-demo/database/migrations/2020_11_30_111912_create_warehouses_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWarehousesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('warehouses', function (Blueprint $table) {
$table->id();
$table->string('name')->comment('Наименование склада');
$table->longText('description')->nullable()->comment('Описание склада');
$table->string('country')->comment('Страна');
$table->string('city')->comment('Город');
$table->string('address')->comment('Адрес');
$table->boolean('central')->default(false)->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('warehouses');
}
}