M2304121843AddColumnMerchantSettings.php 800 B

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