2018_04_27_102921_create_yz_adv_table.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateYzAdvTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. if (!Schema::hasTable('yz_adv')) {
  15. Schema::create('yz_adv', function (Blueprint $table) {
  16. $table->increments('id');
  17. $table->integer('uniacid')->default(0);
  18. $table->text('advs', 65535)->nullable();
  19. $table->integer('created_at')->nullable();
  20. $table->integer('updated_at')->nullable();
  21. $table->integer('deleted_at')->nullable();
  22. });
  23. \Illuminate\Support\Facades\DB::statement("ALTER TABLE " . app('db')->getTablePrefix() . "yz_adv comment '设置-商城广告表'");//表注释
  24. }
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists('yz_adv');
  34. }
  35. }