2022_10_20_143347_create_contracts_table.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. /**
  5. * Class CreateContractsTable.
  6. */
  7. class CreateContractsTable extends Migration
  8. {
  9. /**
  10. * Run the migrations.
  11. *
  12. * @return void
  13. */
  14. public function up()
  15. {
  16. Schema::create('contracts', function(Blueprint $table) {
  17. $table->increments('id');
  18. $table->integer('m_id')->index('m_id')->default('0')->comment('m_id');
  19. $table->integer('type')->index('type')->default('0')->comment('类型:1:初投,2:复投');
  20. $table->integer('status')->index('status')->default('1')->comment('1:广播中,2:成功,3:失败');
  21. $table->string('hash')->index('hash')->default('')->comment('交易hash');
  22. $table->text('broadcast_data')->comment('交易详情');
  23. $table->double('money',16,6)->default(0)->comment('投入金额');
  24. $table->string('error_msg')->default('')->comment('错误内容');
  25. $table->timestamps();
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. *
  31. * @return void
  32. */
  33. public function down()
  34. {
  35. Schema::drop('contracts');
  36. }
  37. }