2019_05_08_160636_create_adverts_table.php 841 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class CreateAdvertsTable extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. Schema::create('adverts', function(Blueprint $table)
  13. {
  14. $table->increments('id');
  15. $table->string('title', 191)->comment('广告标题');
  16. $table->string('thumb', 191)->comment('图片链接');
  17. $table->string('link', 191)->nullable()->comment('跳转链接');
  18. $table->boolean('sort')->default(0)->comment('排序');
  19. $table->integer('position_id')->comment('位置ID');
  20. $table->text('description', 65535)->nullable()->comment('广告描述');
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::drop('adverts');
  32. }
  33. }