M230423035037AddGiveConditionToRechargeLog.php 940 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace addons\Recharge\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230423035037AddGiveConditionToRechargeLog
  6. */
  7. class M230423035037AddGiveConditionToRechargeLog extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "ALTER TABLE `qimall_addons_recharge_log`
  15. ADD COLUMN `give_condition` decimal(10,2) NOT NULL DEFAULT 0 COMMENT '达标的赠送条件' AFTER `updated_at`;";
  16. $this->execute($sql);
  17. }
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function safeDown()
  22. {
  23. echo "M230423035037AddGiveConditionToRechargeLog cannot be reverted.\n";
  24. return false;
  25. }
  26. /*
  27. // Use up()/down() to run migration code without a transaction.
  28. public function up()
  29. {
  30. }
  31. public function down()
  32. {
  33. echo "M230423035037AddGiveConditionToRechargeLog cannot be reverted.\n";
  34. return false;
  35. }
  36. */
  37. }