<?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('myshop_pricelist', function (Blueprint $table) {
            $table->unsignedInteger('owner_id');
            $table->unsignedInteger('item_vnum');
            $table->unsignedInteger('price');

            $table->unique(['owner_id', 'item_vnum'], 'list_id');
            $table->foreign('owner_id')->references('id')->on('player');
        });
    }

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