2018_10_15_104737_create_yz_advertisement_table.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateYzAdvertisementTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. if (!Schema::hasTable('yz_advertisement')) {
  15. Schema::create('yz_advertisement', function (Blueprint $table) {
  16. $table->increments('id');
  17. $table->integer('uniacid')->default(0)->index('idx_uniacid');
  18. $table->string('name', 200)->default('')->nullable()->comment('标题');
  19. $table->string('thumb', 255)->default('')->nullable()->comment('图片');
  20. $table->string('adv_url')->default('')->nullable()->comment('广告链接');
  21. $table->integer('sort_by')->default(0)->nullable()->comment('排序');
  22. $table->tinyInteger('status')->default(0)->comment('0:不显示|1:显示');
  23. $table->string('extend', 255)->default('');
  24. $table->integer('created_at')->nullable();
  25. $table->integer('updated_at')->nullable();
  26. $table->integer('deleted_at')->nullable();
  27. });
  28. \Illuminate\Support\Facades\DB::statement("ALTER TABLE " . app('db')->getTablePrefix() . "yz_advertisement comment '财务-广告表'");//表注释
  29. }
  30. }
  31. /**
  32. * Reverse the migrations.
  33. *
  34. * @return void
  35. */
  36. public function down()
  37. {
  38. Schema::dropIfExists('yz_advertisement');
  39. }
  40. }