2018_05_11_094000_create_album_cat.php 971 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateAlbumCat extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('album_cat', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string('name')->comment('名称');
  17. $table->unsignedInteger('parent_id')->default(0)->comment('父分类ID 0--顶级分类');
  18. $table->string('level')->comment('分类级别');
  19. $table->longText('pic_url')->default('')->comment('图片url');
  20. $table->unsignedInteger('is_delete')->default(0)->comment('Is_delete');
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::dropIfExists('album_cat');
  32. }
  33. }