M240429132301CreateTableQimallAddonsAgentImportLevelLog.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace addons\Agent\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240429132301CreateTableQimallAddonsAgentImportLevelLog
  6. */
  7. class M240429132301CreateTableQimallAddonsAgentImportLevelLog extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "CREATE TABLE `qimall_addons_agent_import_level_log` (
  15. `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  16. `mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
  17. `counts` int(11) NOT NULL DEFAULT 0 COMMENT '导入数量',
  18. `success_counts` int(11) NOT NULL DEFAULT 0 COMMENT '导入成功数量',
  19. `fail_counts` int(11) NOT NULL DEFAULT 0 COMMENT '导入失败数量',
  20. `upload_file` varchar(255) NOT NULL DEFAULT '' COMMENT '上传文件存在路径',
  21. `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态:1:导入成功;2导入失败;3:导入中;4:导入中断',
  22. `updated_at` int(11) NOT NULL DEFAULT 0,
  23. `created_at` int(11) NOT NULL DEFAULT 0,
  24. PRIMARY KEY (`id`) USING BTREE
  25. ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT = '会员导入日志表' ROW_FORMAT = Dynamic;";
  26. $this->execute($sql);
  27. $sql = "CREATE TABLE `qimall_addons_agent_import_level_fail_log` (
  28. `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  29. `mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
  30. `log_id` int(11) NOT NULL DEFAULT 0 COMMENT '导入批次id',
  31. `user_id` int(11) NULL DEFAULT NULL,
  32. `level` int(11) NOT NULL COMMENT '导入等级的id',
  33. `reason` varchar(255) NOT NULL DEFAULT '' COMMENT '失败原因',
  34. `extra` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '导入的内容',
  35. `updated_at` int(11) NOT NULL DEFAULT 0,
  36. `created_at` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间',
  37. PRIMARY KEY (`id`) USING BTREE
  38. ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 ROW_FORMAT = Dynamic COMMENT = '代理等级导入失败日志';";
  39. $this->execute($sql);
  40. }
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function safeDown()
  45. {
  46. echo "M240429132301CreateTableQimallAddonsAgentImportLevelLog cannot be reverted.\n";
  47. return false;
  48. }
  49. /*
  50. // Use up()/down() to run migration code without a transaction.
  51. public function up()
  52. {
  53. }
  54. public function down()
  55. {
  56. echo "M240417082535CreateTableAgentApply cannot be reverted.\n";
  57. return false;
  58. }
  59. */
  60. }