M250225103456AlertStoreGoodsReserve.php 724 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * 修改门店商品库存 有效距离和主商城相同
  6. * Class M250225103456AlertStoreGoodsReserve
  7. */
  8. class M250225103456AlertStoreGoodsReserve extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $sql = <<<SQL
  16. ALTER TABLE `qimall_addons_store_goods_reserve`
  17. MODIFY COLUMN `distance` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '有效距离' AFTER `reserve_type`;
  18. SQL;
  19. $this->execute($sql);
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. echo "M250225103456AlertStoreGoodsReserve cannot be reverted.\n";
  27. return false;
  28. }
  29. }