<?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_codes', function (Blueprint $table) {
            $table->id();
            $table->integer('goods_id')->unsigned();
            $table->integer('sku_id')->unsigned();
            $table->string('code', 20)->unique();
            $table->string('goods_name')->nullable();
            $table->string('sku_name')->nullable();
            $table->string('number')->nullable();
            $table->timestamps();
        });
    }

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