2019_04_23_135825_min_app_template_message.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class MinAppTemplateMessage extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. if (!Schema::hasTable('yz_mini_app_template_message')) {
  15. Schema::create('yz_mini_app_template_message', function (Blueprint $table) {
  16. $table->integer('id', true);
  17. $table->integer('uniacid');
  18. $table->string('title')->comment('模板标题');
  19. $table->string('template_id', 45)->comment('微信模板ID');
  20. $table->text('data', 65535)->nullable()->comment('模板参数');
  21. $table->integer('is_default')->nullable()->comment('是否显示:1是,0否');
  22. $table->integer('is_open')->default(0)->comment('是否开启哦:1是,0否');
  23. $table->integer('created_at')->nullable();
  24. $table->integer('updated_at')->nullable();
  25. });
  26. \Illuminate\Support\Facades\DB::statement("ALTER TABLE " . app('db')->getTablePrefix() . "yz_mini_app_template_message comment '微信小程序消息模板表'");//表注释
  27. }
  28. }
  29. /**
  30. * Reverse the migrations.
  31. *
  32. * @return void
  33. */
  34. public function down()
  35. {
  36. Schema::dropIfExists('yz_mini_app_template_message');
  37. }
  38. }