2023_03_02_213237_alter_user_profiles.php 1.11 KB
<?php

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

class AlterUserProfiles extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::table('user_profiles', function (Blueprint $table) {
            $table->string('intro')->after('user_id')->default("")->comment('简介');
            $table->date('birthday')->after('intro')->default("2023-01-01")->comment('生日');

            $table->unsignedInteger('follow_count')->after('video_count')->default(0)->comment('关注数量');
            $table->unsignedInteger('fans_count')->after('follow_count')->default(0)->comment('粉丝数量');
            $table->unsignedInteger('popular_count')->after('fans_count')->default(0)->comment('人气数量');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::dropColumns('user_profiles', ['intro','birthday','follow_count','fans_count','popular_count']);
    }
}