M250822175613AlterQimalGoodsExtra.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250822175613AlterQimalGoodsExtra.php
  6. */
  7. class M250822175613AlterQimalGoodsExtra extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "ALTER TABLE `qimall_goods_extra`
  15. ADD COLUMN `is_member_alone_buy_limit` tinyint(1) DEFAULT 0 COMMENT '是否会员指定等级每月限购数量',
  16. ADD COLUMN `member_alone_buy_limit_setting` longtext COMMENT '会员指定等级每月限购数量设置'";
  17. $this->execute($sql);
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function safeDown()
  23. {
  24. echo "M250822175613AlterQimalGoodsExtra.php 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 "M250729084413AlterQimallAddonsStoreGoodsExtra cannot be reverted.\n";
  35. return false;
  36. }
  37. */
  38. }