2022_02_08_153922_create_user_profiles_table.php 1.34 KB
<?php

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

class CreateUserProfilesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_profiles', function (Blueprint $table) {
            $table->id();
            $table->string('unionid')->default('')->comment('唯一标识');

            $table->string('last_visit_path')->default('')->comment('上次访问路径');
            $table->timestamp('last_visit_time')->nullable()->comment('上次访问时间');
            $table->string('registration_id')->default('')->comment('极光注册id');
            $table->string('alias_id')->default('')->comment('极光推送别名');


            $table->string('buy_number')->default(0)->comment('购买次数');
            $table->string('buy_amount')->default(0)->comment('消费金额');
            $table->timestamp('last_buy_time')->nullable()->comment('上次购买时间');
            $table->unsignedInteger('video_count')->default(0)->comment('视频数量');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_profiles');
    }
}