M231024114312AddNotifyToAgentOrder.php 741 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace addons\YunfastPay\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M231024114312AddNotifyToAgentOrder
  6. */
  7. class M231024114312AddNotifyToAgentOrder extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. // 插入表数据
  16. $sql = "ALTER TABLE `qimall_addons_yunfast_pay_agent_order`
  17. ADD COLUMN `notify_data` longtext NULL COMMENT '回调参数' AFTER `res_data`;";
  18. $this->execute($sql);
  19. } catch (\Exception $e) {
  20. }
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. echo "M231024114312AddNotifyToAgentOrder cannot be reverted.\n";
  28. return false;
  29. }
  30. }