M230825022817AleterQimallAddonsBossLevelSetting.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace addons\Boss\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230825022817AleterQimallAddonsBossLevelSetting
  6. */
  7. class M230825022817AleterQimallAddonsBossLevelSetting extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "ALTER TABLE `qimall_addons_boss_level_setting`
  15. ADD COLUMN `digital_prize` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '数字币永久分红,单位:百分比',
  16. ADD COLUMN `extra_digital_prize` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '额外分红数字币,单位:百分比';";
  17. $this->execute($sql);
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function safeDown()
  23. {
  24. echo "M230825022817AleterQimallAddonsBossLevelSetting cannot be reverted.\n";
  25. return false;
  26. }
  27. /*
  28. // Use up()/down() to run migration code without a transaction.
  29. public function up()
  30. {
  31. }
  32. public function down()
  33. {
  34. echo "M230825022817AleterQimallAddonsBossLevelSetting cannot be reverted.\n";
  35. return false;
  36. }
  37. */
  38. }