m220227_151444_addon_wechat_reply_default.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use yii\db\Migration;
  3. class m220227_151444_addon_wechat_reply_default extends Migration
  4. {
  5. public function up()
  6. {
  7. /* 取消外键约束 */
  8. $this->execute('SET foreign_key_checks = 0');
  9. /* 创建表 */
  10. $this->createTable('{{%addon_wechat_reply_default}}', [
  11. 'id' => "int(11) NOT NULL AUTO_INCREMENT",
  12. 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
  13. 'follow_content' => "varchar(200) NULL DEFAULT '' COMMENT '关注回复关键字'",
  14. 'default_content' => "varchar(200) NULL DEFAULT '' COMMENT '默认回复关键字'",
  15. 'status' => "tinyint(4) NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]'",
  16. 'created_at' => "int(10) unsigned NULL DEFAULT '0' COMMENT '创建时间'",
  17. 'updated_at' => "int(10) unsigned NULL DEFAULT '0' COMMENT '修改时间'",
  18. 'PRIMARY KEY (`id`)'
  19. ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信_默认回复表'");
  20. /* 索引设置 */
  21. /* 表数据 */
  22. /* 设置外键约束 */
  23. $this->execute('SET foreign_key_checks = 1;');
  24. }
  25. public function down()
  26. {
  27. $this->execute('SET foreign_key_checks = 0');
  28. /* 删除表 */
  29. $this->dropTable('{{%addon_wechat_reply_default}}');
  30. $this->execute('SET foreign_key_checks = 1;');
  31. }
  32. }
粤ICP备19079148号