File: /var/www/ipsremont-demo/database/migrations/2020_12_15_140547_create_devices_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDevicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('devices', function (Blueprint $table) {
$table->id();
$table->string('external_id', 50)->comment('Артикул')->unique();
$table->string('category_code')->comment('Код категории');
$table->string('name')->comment('Название');
$table->string('photo')->comment('Фото');
$table->string('specification')->comment('Спецификации');
$table->softDeletes();
$table->timestamp('created_at')->nullable()->useCurrent();
$table->timestamp('updated_at')->nullable()->useCurrent();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('devices');
}
}