2023_03_02_213237_alter_user_profiles.php
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?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']);
}
}