2021_12_29_050502_create_progress_table.php 951 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateProgressTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('progress', function (Blueprint $table) {
  15. $table->id();
  16. $table->integer('book');
  17. $table->integer('para');
  18. $table->string('lang',16);
  19. $table->integer('all_strlen');
  20. $table->integer('public_strlen');
  21. $table->timestamp('created_at')->useCurrent();
  22. $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
  23. $table->index(['book','para']);
  24. $table->index(['book','para','lang']);
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('progress');
  35. }
  36. }