| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- namespace addons\Agent\console\migrations;
- use yii\db\Migration;
- /**
- * Class M240429132301CreateTableQimallAddonsAgentImportLevelLog
- */
- class M240429132301CreateTableQimallAddonsAgentImportLevelLog extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "CREATE TABLE `qimall_addons_agent_import_level_log` (
- `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
- `counts` int(11) NOT NULL DEFAULT 0 COMMENT '导入数量',
- `success_counts` int(11) NOT NULL DEFAULT 0 COMMENT '导入成功数量',
- `fail_counts` int(11) NOT NULL DEFAULT 0 COMMENT '导入失败数量',
- `upload_file` varchar(255) NOT NULL DEFAULT '' COMMENT '上传文件存在路径',
- `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态:1:导入成功;2导入失败;3:导入中;4:导入中断',
- `updated_at` int(11) NOT NULL DEFAULT 0,
- `created_at` int(11) NOT NULL DEFAULT 0,
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT = '会员导入日志表' ROW_FORMAT = Dynamic;";
- $this->execute($sql);
- $sql = "CREATE TABLE `qimall_addons_agent_import_level_fail_log` (
- `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
- `log_id` int(11) NOT NULL DEFAULT 0 COMMENT '导入批次id',
- `user_id` int(11) NULL DEFAULT NULL,
- `level` int(11) NOT NULL COMMENT '导入等级的id',
- `reason` varchar(255) NOT NULL DEFAULT '' COMMENT '失败原因',
- `extra` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '导入的内容',
- `updated_at` int(11) NOT NULL DEFAULT 0,
- `created_at` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 ROW_FORMAT = Dynamic COMMENT = '代理等级导入失败日志';";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240429132301CreateTableQimallAddonsAgentImportLevelLog cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240417082535CreateTableAgentApply cannot be reverted.\n";
- return false;
- }
- */
- }
|