M240429131101AddLimitPaymentColumnToQimallPaymentTrade.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. *
  6. * Class M240429131101AddLimitPaymentColumnToQimallPaymentTrade
  7. */
  8. class M240429131101AddLimitPaymentColumnToQimallPaymentTrade extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. try {
  16. $sql = "ALTER TABLE `qimall_payment_trade` ADD COLUMN `limit_payment` longtext NULL COMMENT '限制支付方式'";
  17. $this->execute($sql);
  18. $sql = "ALTER TABLE `qimall_goods` ADD COLUMN `is_pay_limit` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否限制支付方式'";
  19. $this->execute($sql);
  20. $sql = "ALTER TABLE `qimall_goods` ADD COLUMN `pay_limit` longtext NULL COMMENT '限制的支付方式'";
  21. $this->execute($sql);
  22. }catch (\Exception $e){
  23. }
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function safeDown()
  29. {
  30. echo "M240429131101AddLimitPaymentColumnToQimallPaymentTrade cannot be reverted.\n";
  31. return false;
  32. }
  33. /*
  34. // Use up()/down() to run migration code without a transaction.
  35. public function up()
  36. {
  37. }
  38. public function down()
  39. {
  40. echo "M220907030905AddVideoUrlColumnFirstFrameColumnWatchTimesToQimallAddonsStoreCoupon cannot be reverted.\n";
  41. return false;
  42. }
  43. */
  44. }