2020_08_21_145711_create_payment_table.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreatePaymentTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('payment', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string('trade_no', 64)->comment('支付单号(本地订单号)');
  17. $table->unsignedInteger('user_id')->comment('用户ID');
  18. $table->unsignedInteger('order_id')->comment('本地订单ID');
  19. $table->unsignedInteger('amount')->default(0)->comment('金额,单位分');
  20. $table->text('qr_code')->nullable()->comment('支付二维码');
  21. $table->text('url')->nullable()->comment('支付链接');
  22. $table->boolean('status')->default(0)->comment('支付状态:-1-支付失败、0-等待支付、1-支付成功');
  23. $table->dateTime('created_at')->comment('创建时间');
  24. $table->dateTime('updated_at')->comment('最后更新时间');
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('payment');
  35. }
  36. }