<?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('shop_price_list_values', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedMediumInteger('price_list_id')->nullable()->index('price_list_id');
            $table->string('code', 50)->nullable();
            $table->unsignedDecimal('quantity', 7)->nullable();
            $table->decimal('price', 7)->nullable()->default(0);
            $table->decimal('price_taxed', 7)->nullable()->default(0);
            $table->tinyInteger('tax_id')->nullable();
            $table->unsignedSmallInteger('created_by')->nullable();
            $table->unsignedSmallInteger('updated_by')->nullable();
            $table->unsignedSmallInteger('deleted_by')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

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