<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('vendors', function (Blueprint $table) {
            $table->id();
            $table->string('code')->unique()->comment('廠商編號');
            $table->string('name')->comment('廠商名稱');
            $table->string('short_name')->nullable()->comment('廠商簡稱');
            $table->string('tax_id')->nullable()->comment('統一編號');
            $table->string('owner')->nullable()->comment('負責人');
            $table->string('contact_name')->nullable()->comment('聯絡人');
            $table->string('tel')->nullable()->comment('市話');
            $table->string('phone')->nullable()->comment('連絡電話');
            $table->string('email')->nullable()->comment('電子郵件');
            $table->text('address')->nullable()->comment('地址');
            $table->text('remark')->nullable()->comment('備註');
            $table->timestamps();
        });
    }

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