2023_05_08_112141_create_user_wallets_table.php
1.3 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
39
40
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserWalletsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_wallets', function (Blueprint $table) {
$table->increments('id');
$table->unsignedBigInteger('user_id')->index()->comment('用户ID');
$table->decimal('income', 11)->nullable()->default(0.00)->comment('累计总收益');
$table->decimal('balance', 11)->nullable()->default(0.00)->comment('账户余额');
$table->decimal('withdrawn', 11)->nullable()->default(0.00)->comment('已提现总额');
$table->decimal('frozen', 11)->nullable()->default(0.00)->comment('冻结总额');
$table->tinyInteger('status')->nullable()->default(1)->comment('状态:1-有效;0-无效');
$table->timestamps();
$table->softDeletes();
});
DB::statement("ALTER TABLE `user_wallets` comment '用户-钱包' ");
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_wallets');
}
}