2019_06_11_095634_create_table_downloads.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateTableDownloads extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('downloads', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->integer('uid')
  17. ->unsigned()
  18. ->comment('用户uid');
  19. $table->string('username', 32)
  20. ->default('')
  21. ->comment('用户昵称');
  22. $table->string('download_type', 32)
  23. ->default('post')
  24. ->comment('类型:post内容,post_waste内容回收站');
  25. $table->tinyInteger('download_status')
  26. ->default(0)
  27. ->comment('状态:0生成中,1成功,2失败');
  28. $table->mediumText('params')
  29. ->comment('参数');
  30. $table->string('url', 255)
  31. ->default('')
  32. ->comment('下载地址');
  33. $table->timestamps();
  34. });
  35. }
  36. /**
  37. * Reverse the migrations.
  38. *
  39. * @return void
  40. */
  41. public function down()
  42. {
  43. Schema::dropIfExists('downloads');
  44. }
  45. }