M250524065841CreateQimallAddonsAchievementAwardLogExtra.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace addons\Achievement\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250524065841CreateQimallAddonsAchievementAwardLogExtra
  6. */
  7. class M250524065841CreateQimallAddonsAchievementAwardLogExtra extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "CREATE TABLE `qimall_addons_achievement_award_log_extra` (
  15. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  16. `mall_id` int(11) NOT NULL COMMENT '商城id',
  17. `user_id` int(11) NOT NULL COMMENT '用户id',
  18. `grant_id` int(11) NOT NULL COMMENT '发放规则日志id',
  19. `team_achievement` decimal(10,2) NOT NULL COMMENT '团队业绩',
  20. `created_at` int(11) DEFAULT NULL COMMENT '添加时间',
  21. `updated_at` int(11) DEFAULT NULL COMMENT '修改时间',
  22. `equal_first` decimal(10,2) NOT NULL COMMENT '一层平级奖励',
  23. `equal_second` decimal(10,2) NOT NULL COMMENT '二层平级奖励',
  24. PRIMARY KEY (`id`)
  25. ) ENGINE=InnoDB AUTO_INCREMENT=2186 DEFAULT CHARSET=utf8mb4 COMMENT='奖励明细拓展表';";
  26. $this->execute($sql);
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function safeDown()
  32. {
  33. echo "M250524065841CreateQimallAddonsAchievementAwardLogExtra cannot be reverted.\n";
  34. return false;
  35. }
  36. /*
  37. // Use up()/down() to run migration code without a transaction.
  38. public function up()
  39. {
  40. }
  41. public function down()
  42. {
  43. echo "M250524065841CreateQimallAddonsAchievementAwardLogExtra cannot be reverted.\n";
  44. return false;
  45. }
  46. */
  47. }