| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace addons\DoubleCopy\console\migrations;
- use yii\db\Migration;
- /**
- * Class M240204093537FrozenFundClearLog
- */
- class M240204093537FrozenFundClearLog extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "CREATE TABLE `qimall_addons_double_copy_frozen_fund_clear_log` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商城id',
- `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
- `clear_num` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '操作金额',
- `reward_currency` varchar(32) NOT NULL DEFAULT 'commission' COMMENT '奖励类型:佣金-commission,积分-score',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间戳',
- `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间戳',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_mall_user` (`mall_id`,`user_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='二二复制冻结基金清零记录表';";
- $this->execute($sql);
- $sql = "ALTER TABLE `qimall_addons_double_copy_pool_source` ADD COLUMN `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注';";
- $this->execute($sql);
- $sql = "INSERT INTO `qimall_crontab_task` ( `name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at` ) VALUES ( '二二复制冻结基金每月清零', 'double-copy/frozen-fund/clear', '2', '0 1 0 * * *', '0', '1', '1708418352', '1708418352' );";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240204093537FrozenFundClearLog cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240204093537FrozenFundClearLog cannot be reverted.\n";
- return false;
- }
- */
- }
|