M250916012147AlterQimallAddonsStoreCensus.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use common\enums\RabbitMqEnum;
  4. use yii\db\Migration;
  5. /**
  6. * Class M250916012147AlterQimallAddonsStoreCensus
  7. */
  8. class M250916012147AlterQimallAddonsStoreCensus extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $sql = "ALTER TABLE `qimall_addons_store_census`
  16. ADD COLUMN `order_refund_money` decimal(12, 2) NOT NULL DEFAULT '0' COMMENT '订单售后金额';";
  17. $this->execute($sql);
  18. \Yii::$app->services->rabbitMq->push(RabbitMqEnum::EXCHANGE_LONG_DURATION, RabbitMqEnum::LONG_DURATION_QUEUE,
  19. [], \addons\Store\common\models\StoreCensus::class, 'historyOrderRefund');
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. echo "M250916012147AlterQimallAddonsStoreCensus cannot be reverted.\n";
  27. return false;
  28. }
  29. /*
  30. // Use up()/down() to run migration code without a transaction.
  31. public function up()
  32. {
  33. }
  34. public function down()
  35. {
  36. echo "M250916012147AlterQimallAddonsStoreCensus cannot be reverted.\n";
  37. return false;
  38. }
  39. */
  40. }