M240508222704AlterQimallAddonsCouponUserRelate.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace addons\Coupon\console\migrations;
  3. use addons\Coupon\common\models\AddonsCouponUserRelate;
  4. use yii\db\Migration;
  5. /**
  6. * Class M240508222704AlterQimallAddonsCouponUserRelate
  7. */
  8. class M240508222704AlterQimallAddonsCouponUserRelate extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $sql="ALTER TABLE qimall_addons_coupon add give_time int(11) not null default 0 COMMENT '转赠次数'";
  16. $this->execute($sql);
  17. $sql="ALTER TABLE qimall_addons_coupon_user_relate add give_time int(11) not null default 0 COMMENT '转赠次数'";
  18. $this->execute($sql);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M240508222704AlterQimallAddonsCouponUserRelate cannot be reverted.\n";
  26. return false;
  27. }
  28. /*
  29. // Use up()/down() to run migration code without a transaction.
  30. public function up()
  31. {
  32. }
  33. public function down()
  34. {
  35. echo "M231212062704AlterQimallAddonsCouponUserRelate cannot be reverted.\n";
  36. return false;
  37. }
  38. */
  39. }