Total Complexity | 2 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class CreateTransfersTable extends Migration |
||
8 | { |
||
9 | /** |
||
10 | * Run the migrations. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('transfers', function (Blueprint $table) { |
||
17 | $table->bigIncrements('id'); |
||
18 | $table->morphs('from'); |
||
19 | $table->unsignedBigInteger('from_wallet_id'); |
||
20 | $table->string('action')->comment('操作行为:read/download/subscribe/trial 等'); |
||
21 | $table->morphs('to'); |
||
22 | $table->unsignedBigInteger('to_wallet_id'); |
||
23 | $table->bigInteger('fee')->defalut(0)->comment('手续费'); |
||
24 | $table->unsignedBigInteger('deposit_id')->comment('收款事务 id'); |
||
25 | $table->unsignedBigInteger('withdraw_id')->comment('付款事务 id'); |
||
26 | $table->uuid('uuid')->unique(); |
||
27 | $table->boolean('refund')->default(false)->comment('交易是否完成'); |
||
28 | $table->timestamps(); |
||
29 | }); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Reverse the migrations. |
||
34 | * |
||
35 | * @return void |
||
36 | */ |
||
37 | public function down() |
||
38 | { |
||
39 | Schema::dropIfExists('transfers'); |
||
40 | } |
||
42 |