M230523072613AgentAoKaLanRepurchaseReward.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace addons\Agent\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230523072613AgentAoKaLanRepurchaseReward
  6. */
  7. class M230523072613AgentAoKaLanRepurchaseReward extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("CREATE TABLE `qimall_addons_agent_distribution_setting` (
  15. `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  16. `mall_id` INT(11) NOT NULL COMMENT '所属商城',
  17. `item_id` INT(11) NOT NULL COMMENT '对象ID',
  18. `key` VARCHAR(255) NOT NULL COMMENT '配置key' COLLATE 'utf8mb4_general_ci',
  19. `value` JSON NOT NULL COMMENT '配置值',
  20. `created_at` INT(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  21. `updated_at` INT(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  22. `status` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '-1已删除,1正常,0禁用',
  23. `deleted_at` INT(11) NOT NULL DEFAULT '0' COMMENT '删除时间',
  24. PRIMARY KEY (`id`) USING BTREE,
  25. INDEX `item_id` (`item_id`) USING BTREE
  26. )
  27. COMMENT='层级分销'
  28. COLLATE='utf8mb4_general_ci'
  29. ENGINE=InnoDB;");
  30. $this->execute("INSERT INTO `qimall_global_var_map` (`name`, `title`, `type`, `is_addons`, `created_at`, `updated_at`) VALUES ('agent_distribution_reward', '公司奖励', 'CapitalTypeMap', 1, 1654569888, 1654569888);");
  31. }
  32. /**
  33. * {@inheritdoc}
  34. */
  35. public function safeDown()
  36. {
  37. echo "M230523072613AgentAoKaLanRepurchaseReward cannot be reverted.\n";
  38. return false;
  39. }
  40. /*
  41. // Use up()/down() to run migration code without a transaction.
  42. public function up()
  43. {
  44. }
  45. public function down()
  46. {
  47. echo "M230523072613AgentAoKaLanRepurchaseReward cannot be reverted.\n";
  48. return false;
  49. }
  50. */
  51. }