ufutx.dma/database/migrations/2024_06_12_104451_change_table_role.php
2026-03-04 14:42:40 +08:00

51 lines
1.7 KiB
PHP

<?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值在该列中
});
}
};