<?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('chef_user', function (Blueprint $table) {
            $table->string("openid",50)->nullable()->change();
        });
        Schema::table('main_coaches', function (Blueprint $table) {
            $table->string("openid",50)->nullable()->change();
        });
        Schema::table('customer_service_users', function (Blueprint $table) {
            $table->string("openid",50)->nullable()->change();
        });
        Schema::table('coaches', function (Blueprint $table) {
            $table->string("openid",50)->nullable()->change();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('chef_user', function (Blueprint $table) {
            $table->string('openid',50)->nullable(false)->change(); // 这里需要确保没有null值在该列中
        });
        Schema::table('main_coaches', function (Blueprint $table) {
            $table->string('openid',50)->nullable(false)->change(); // 这里需要确保没有null值在该列中
        });
        Schema::table('customer_service_users', function (Blueprint $table) {
            $table->string('openid',50)->nullable(false)->change(); // 这里需要确保没有null值在该列中
        });
        Schema::table('coaches', function (Blueprint $table) {
            $table->string('openid',50)->nullable(false)->change(); // 这里需要确保没有null值在该列中
        });
    }
};
