<?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::table('partner_account', function (Blueprint $table) {
            $table->string('user_name')->nullable()->comment('用户名或公司名')->after('user_id');
            $table->string('user_mobile')->nullable()->comment('用户或公司手机号')->after('user_name');
            $table->string('id_card')->nullable()->comment('用户身份证或公司营业执照')->after('user_mobile');
            $table->tinyInteger('type')->default(0)->comment('账户类型 0:个人 1:公司 2:灵工')->after('is_default');
            $table->string('address')->nullable()->comment('地址')->after('type');
            $table->string('email')->nullable()->comment('邮箱')->after('address');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('partner_account', function (Blueprint $table) {
            $table->dropColumn('type');
            $table->dropColumn('user_name');
            $table->dropColumn('user_mobile');
            $table->dropColumn('id_card');
            $table->dropColumn('address');
            $table->dropColumn('email');
        });
    }
};
