2019_06_03_162527_crate_table_post_imgs.php 869 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CrateTablePostImgs extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('post_imgs', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->integer('post_id')
  17. ->index('post_id')
  18. ->comment('内容id');
  19. $table->string('img', 255)
  20. ->default('')
  21. ->comment('图片');
  22. $table->softDeletes();
  23. $table->timestamps();
  24. });
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists('post_imgs');
  34. }
  35. }