2021_08_13_094855_create_resources_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateResourceTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('resources', function (Blueprint $table) {
  15. $table->id();
  16. $table->string('name')->nullable()->comment('文件名');
  17. $table->string('original_name')->nullable()->comment('原文件名');
  18. $table->string('path')->nullable()->comment('路径');
  19. $table->string('disk', 50)->nullable()->comment('disk');
  20. $table->string('url', 300)->nullable()->comment('url');
  21. $table->integer('size')->default(0)->comment('大小');
  22. $table->tinyInteger('status')->default(0)->unsigned()->comment('状态');
  23. $table->softDeletes();
  24. $table->timestamps();
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('resource');
  35. }
  36. }