File: /var/www/ipsremont-demo/database/migrations/2020_12_08_161017_create_parts_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePartsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('parts', function (Blueprint $table) {
$table->id();
$table->string('name')->comment('Наименование');
$table->string('item')->comment('Единица хранения остатков');
$table->double('price', 9,2)->comment('Цена');
$table->string('foto')->comment('Ссылка на фото, название файла');
$table->string('external_id', 50)->comment('uuid 1C')->nullable();
$table->string('external_type', 50)->comment('тип ТМЦ')->nullable();
$table->softDeletes();
$table->timestamp('created_at')->nullable()->useCurrent();
$table->timestamp('updated_at')->nullable()->useCurrent();
$table->index('external_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('parts');
}
}