2022_01_28_123829_create_collections_table.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateCollectionsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('collections', function (Blueprint $table) {
  15. #使用雪花id
  16. $table->bigInteger('id')->primary();
  17. $table->string('uid',36)->uniqid()->index();
  18. $table->bigInteger('parent_id')->nullable()->index();
  19. $table->bigInteger('default_channel_id')->nullable()->index();
  20. $table->string('title',128)->index();
  21. $table->string('subtitle',128)->nullable();
  22. $table->string('summary',1024)->nullable();
  23. $table->text('cover')->nullable();
  24. $table->text('article_list')->nullable();
  25. $table->string('owner',36)->index();
  26. $table->bigInteger('owner_id')->index();
  27. $table->bigInteger('editor_id')->index();
  28. $table->text('setting')->nullable();
  29. $table->integer('status')->default(10)->index();
  30. $table->string('lang',16)->default('none')->index();
  31. $table->bigInteger('create_time')->index();
  32. $table->bigInteger('modify_time')->index();
  33. $table->timestamp('created_at')->useCurrent();
  34. $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
  35. $table->timestamp('deleted_at')->nullable();
  36. });
  37. }
  38. /**
  39. * Reverse the migrations.
  40. *
  41. * @return void
  42. */
  43. public function down()
  44. {
  45. Schema::dropIfExists('collections');
  46. }
  47. }