2022_01_19_090727_create_wbws_table.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateWbwsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('wbws', function (Blueprint $table) {
  15. $table->bigInteger('id')->primary();
  16. $table->string('uid',36)->uniqid()->index();
  17. $table->string('block_uid',36)->nullable()->index();
  18. $table->bigInteger('block_id')->nullable()->index();
  19. $table->bigInteger('channel_id')->nullable()->index();
  20. $table->integer('book_id');
  21. $table->integer('paragraph');
  22. $table->bigInteger('wid');
  23. $table->string("word",1024);
  24. $table->text("data")->default('');
  25. $table->integer('status')->default(10);
  26. $table->string('creator_uid',36);
  27. $table->bigInteger('editor_id');
  28. $table->bigInteger('create_time')->index();
  29. $table->bigInteger('modify_time')->index();
  30. $table->timestamp('created_at')->useCurrent();
  31. $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
  32. $table->timestamp('deleted_at')->nullable();
  33. $table->index(['book_id','paragraph','wid']);
  34. $table->index(['book_id','paragraph']);
  35. });
  36. }
  37. /**
  38. * Reverse the migrations.
  39. *
  40. * @return void
  41. */
  42. public function down()
  43. {
  44. Schema::dropIfExists('wbws');
  45. }
  46. }