M241009102932AlterTableCloudStockAgent.php 832 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace addons\CloudStock\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M241009102932AlterTableCloudStockAgent
  6. */
  7. class M241009102932AlterTableCloudStockAgent extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = <<<EOF
  16. ALTER TABLE `qimall_addons_cloud_stock_agent`
  17. MODIFY COLUMN `upgrade_status` tinyint(6) NOT NULL DEFAULT 3 COMMENT '升级类型;1条件升级;2升级礼包;3平台添加;4上级添加,5购买商品升级' AFTER `frozen_price`;
  18. EOF;
  19. $this->execute($sql);
  20. } catch (\Exception $e) {
  21. }
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. echo "M241009102932AlterTableCloudStockAgent cannot be reverted.\n";
  29. return false;
  30. }
  31. }