6
0
Fork 0
jiqu-library-server/database/migrations/2021_12_23_171645_create_wa...

36 lines
1017 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWalletsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('wallets', function (Blueprint $table) {
$table->unsignedBigInteger('user_id')->primary()->comment('用户ID');
$table->unsignedBigInteger('balance')->default(0)->comment('余额(分)');
$table->unsignedBigInteger('total_expenses')->default(0)->comment('总支出(分)');
$table->unsignedBigInteger('total_revenue')->default(0)->comment('总收入(分)');
$table->boolean('withdrawable')->default(true)->comment('是否可提现');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('wallets');
}
}