2018_10_10_061341_create_ads_table.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateAdsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('ads', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string('theme')->default('default')->comment('主题');
  17. $table->string('alias')->comment('调用名');
  18. $table->tinyInteger('is_display')->default('1')->comment('是否显示 (1:显示 0:不显示)');
  19. $table->integer('category_id')->comment('广告分类');
  20. $table->integer('type_id')->comment('广告属性');
  21. $table->string('title')->comment('广告标题');
  22. $table->string('note')->comment('备注');
  23. $table->integer('list_order')->comment('显示顺序');
  24. $table->integer('started_at')->comment('开始日期');
  25. $table->integer('ended_at')->comment('结束日期');
  26. $table->text('content')->comment('文字广告内容或者其它类型的图片信息等');
  27. $table->string('url')->comment('广告链接');
  28. $table->string('text_color')->comment('文字颜色');
  29. $table->string('explain')->comment('图片文字说明')->nullable();
  30. $table->integer('uid')->comment('会员UID');
  31. $table->integer('subsite_id')->default('0')->comment('分站信息(0:总站)');
  32. $table->timestamps();
  33. $table->softDeletes();
  34. });
  35. }
  36. /**
  37. * Reverse the migrations.
  38. *
  39. * @return void
  40. */
  41. public function down()
  42. {
  43. Schema::dropIfExists('ads');
  44. }
  45. }