M240923180121ModifyColumnCachierServiceRatio.php 743 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240923180121ModifyColumnCachierServiceRatio
  6. */
  7. class M240923180121ModifyColumnCachierServiceRatio extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql=<<<SQL
  15. ALTER TABLE `qimall_addons_store_settings`
  16. MODIFY COLUMN `cachier_service_ratio` decimal(6, 3) NOT NULL DEFAULT 0.000 COMMENT '收银台服务费比例' AFTER `store_commission_authority`;
  17. SQL;
  18. $this->execute($sql);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M240923180121ModifyColumnCachierServiceRatio cannot be reverted.\n";
  26. return false;
  27. }
  28. }