| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- use yii\db\Migration;
- class m220227_151444_addon_wechat_reply_default extends Migration
- {
- public function up()
- {
- /* 取消外键约束 */
- $this->execute('SET foreign_key_checks = 0');
-
- /* 创建表 */
- $this->createTable('{{%addon_wechat_reply_default}}', [
- 'id' => "int(11) NOT NULL AUTO_INCREMENT",
- 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
- 'follow_content' => "varchar(200) NULL DEFAULT '' COMMENT '关注回复关键字'",
- 'default_content' => "varchar(200) NULL DEFAULT '' COMMENT '默认回复关键字'",
- 'status' => "tinyint(4) NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]'",
- 'created_at' => "int(10) unsigned NULL DEFAULT '0' COMMENT '创建时间'",
- 'updated_at' => "int(10) unsigned NULL DEFAULT '0' COMMENT '修改时间'",
- 'PRIMARY KEY (`id`)'
- ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信_默认回复表'");
-
- /* 索引设置 */
-
-
- /* 表数据 */
-
- /* 设置外键约束 */
- $this->execute('SET foreign_key_checks = 1;');
- }
- public function down()
- {
- $this->execute('SET foreign_key_checks = 0');
- /* 删除表 */
- $this->dropTable('{{%addon_wechat_reply_default}}');
- $this->execute('SET foreign_key_checks = 1;');
- }
- }
|