2021_08_11_104303_create_goods_advertising.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateGoodsAdvertising extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. if (!Schema::hasTable('yz_goods_advertising')) {
  15. Schema::create('yz_goods_advertising', function (Blueprint $table) {
  16. $table->increments('id');
  17. $table->integer('uniacid');
  18. $table->integer('goods_id')->index();
  19. $table->integer('is_open')->default("0")->comment('广告宣传语开关');
  20. $table->string('copywriting')->default("")->comment('文案');
  21. $table->integer('created_at')->nullable()->comment('创建时间');
  22. $table->integer('updated_at')->nullable()->comment('修改时间');
  23. });
  24. }
  25. \Illuminate\Support\Facades\DB::statement("ALTER TABLE `".app('db')->getTablePrefix()."yz_goods_advertising` comment'商品--广告宣传语记录表'");//表注释
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. //
  35. }
  36. }