2022_01_20_135745_create_channels_table.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateChannelsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('channels', function (Blueprint $table) {
  15. $table->bigInteger('id')->primary();
  16. $table->string('uid',36)->uniqid()->index();
  17. $table->enum('type',['original','translation','nissaya','commentary'])->default('translation');
  18. $table->string('owner_uid',36);
  19. $table->bigInteger('editor_id');
  20. $table->string('name',128)->index();
  21. $table->string('summary',1024)->nullable();
  22. $table->string('lang',16);
  23. $table->integer('status')->default(10);
  24. $table->text('setting')->nullable();
  25. $table->bigInteger('create_time')->index();
  26. $table->bigInteger('modify_time')->index();
  27. $table->timestamp('created_at')->useCurrent();
  28. $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
  29. $table->timestamp('deleted_at')->nullable();
  30. });
  31. }
  32. /**
  33. * Reverse the migrations.
  34. *
  35. * @return void
  36. */
  37. public function down()
  38. {
  39. Schema::dropIfExists('channels');
  40. }
  41. }