M240120165423AlertQimallAddonsRebateBuy.php 988 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace addons\Rebate\console\migrations;
  3. use common\models\common\Addons;
  4. use yii\db\Migration;
  5. /**
  6. * Class M240120165423AlertQimallAddonsRebateBuy
  7. */
  8. class M240120165423AlertQimallAddonsRebateBuy extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. try {
  16. $sql="ALTER TABLE `qimall_addons_rebate_buy` ADD COLUMN `reward_id` int(10) NULL DEFAULT 0 COMMENT '对应结算的奖励id';";
  17. $this->execute($sql);
  18. } catch (\Exception $e) {
  19. }
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. echo "M240120165423AlertQimallAddonsRebateBuy cannot be reverted.\n";
  27. return false;
  28. }
  29. /*
  30. // Use up()/down() to run migration code without a transaction.
  31. public function up()
  32. {
  33. }
  34. public function down()
  35. {
  36. echo "M240120165423AlertQimallAddonsRebateBuy cannot be reverted.\n";
  37. return false;
  38. }
  39. */
  40. }