| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- namespace addons\SmartForm\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230710022029SmartFormSmsNotice
- */
- class M230710022029SmartFormSmsNotice extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $this->execute("ALTER TABLE `qimall_addons_smart_form_template_column`
- ADD COLUMN `extra_data` JSON NULL DEFAULT NULL COMMENT '扩展数据' AFTER `content_type`;");
- $this->execute("ALTER TABLE `qimall_addons_smart_form_template`
- ADD COLUMN `is_repeat` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否支持重复' AFTER `updated_at`;");
- $this->execute("CREATE TABLE `qimall_addons_smart_form_sms_notice` (
- `id` INT(10) NOT NULL AUTO_INCREMENT,
- `status` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '状态[0:禁用;1:启用,2:已过期]',
- `created_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '添加时间',
- `updated_at` INT(10) NOT NULL DEFAULT '0',
- `mall_id` INT(10) NOT NULL DEFAULT '0',
- `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户',
- `content` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '发送内容' COLLATE 'utf8mb4_general_ci',
- `send_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发送时间',
- `send_var` JSON NULL DEFAULT NULL COMMENT '发送变量',
- `send_status` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0待发送,1可以发送,10发送中,20已过期,30已取消,50发送失败,100发送成功',
- `send_res` JSON NULL DEFAULT NULL COMMENT '发送结果',
- `template_id` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '模板ID' COLLATE 'utf8mb4_general_ci',
- `column_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '字段ID',
- `goods_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '绑定的商品ID',
- `user_form_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户填写的表单ID',
- `order_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单ID',
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `send_at` (`send_at`) USING BTREE,
- INDEX `user_id` (`user_id`) USING BTREE,
- INDEX `goods_id` (`goods_id`) USING BTREE,
- INDEX `order_id` (`order_id`) USING BTREE
- )
- COMMENT='短信通知'
- COLLATE='utf8mb4_general_ci'
- ENGINE=InnoDB;");
- $this->execute("INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('智能表单 - 每分钟执行短信通知', 'smart-form/sms-notice/send', 2, '0 */1 * * * *', 0, 1, 1688955476, 1688955486);");
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230710022029SmartFormSmsNotice cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230710022029SmartFormSmsNotice cannot be reverted.\n";
- return false;
- }
- */
- }
|