M240829104723AddColunmIsGrantToRebate.php 660 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace addons\Rebate\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240829104723AddColunmIsGrantToRebate
  6. */
  7. class M240829104723AddColunmIsGrantToRebate extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. ALTER TABLE `qimall_addons_rebate` ADD COLUMN `is_grant` int(1) NULL DEFAULT 0 COMMENT '优惠/抵扣不发奖开关:1开启 0关闭';
  16. SQL;
  17. $this->execute($sql);
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function safeDown()
  23. {
  24. echo "M240829104723AddColunmIsGrantToRebate cannot be reverted.\n";
  25. return false;
  26. }
  27. }