2022_02_04_012828_create_shares_table.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateSharesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('shares', function (Blueprint $table) {
  15. #使用雪花id
  16. $table->bigInteger('id')->primary();
  17. $table->string('res_id',36);
  18. $table->integer('res_type');
  19. $table->string('cooperator_id',36);
  20. $table->integer('cooperator_type');
  21. $table->integer('power');
  22. $table->bigInteger('create_time');
  23. $table->bigInteger('modify_time');
  24. $table->timestamp('accepted_at')->nullable()->index();
  25. $table->bigInteger('acceptor')->nullable();
  26. $table->timestamp('created_at')->useCurrent()->index();
  27. $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate()->index();
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('shares');
  38. }
  39. }