2023_03_31_121853_create_goods_table.php 1.65 KB
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('category_id')->nullable(false);
            $table->string('title', 255);
            $table->integer('price')->default(0);
            $table->integer('price_old')->default(0);
            $table->string('image', 255)->nullable();
            $table->string('manufacturer', 255)->nullable();
            $table->string('country', 255)->nullable();
            $table->string('size', 255)->nullable();
            $table->integer('power')->default(0);
            $table->text('description')->nullable();
            $table->text('feature')->nullable();
            $table->text('equipment')->nullable();
            $table->unsignedBigInteger('accessory_id')->nullable()->default(0);
            $table->unsignedBigInteger('tooling_id')->nullable()->default(0);
            $table->string('weight', 100)->nullable();
            $table->boolean('new')->default(1);
            $table->integer('stock_count')->default(1);
            $table->boolean('demo')->default(0);
            $table->boolean('way')->default(0);
            $table->string('type_good', 100)->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
};