M250526065423AlterQimallFreeShippingRules.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250526065423AlterQimallFreeShippingRules
  6. */
  7. class M250526065423AlterQimallFreeShippingRules extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "ALTER TABLE `qimall_free_shipping_rules`
  15. ADD COLUMN `num` int(11) NOT NULL DEFAULT 0 COMMENT '商品件数',
  16. ADD COLUMN `rule_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '包邮规则类型(1:满足其一即可,2:两个同时满足)';";
  17. $this->execute($sql);
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function safeDown()
  23. {
  24. echo "M250526065423AlterQimallFreeShippingRules 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 "M250526065423AlterQimallFreeShippingRules cannot be reverted.\n";
  35. return false;
  36. }
  37. */
  38. }