M250506151432AlterTableCloudStockLevel.php 766 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace addons\CloudStock\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * 权重等级添加权重说明字段
  6. * Class M250506151432AlterTableCloudStockLevel
  7. */
  8. class M250506151432AlterTableCloudStockLevel extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. try {
  16. $sql = <<<SQL
  17. ALTER TABLE `qimall_addons_cloud_stock_level`
  18. ADD COLUMN `detail` text NULL COMMENT '等级权重说明';
  19. SQL;
  20. $this->execute($sql);
  21. } catch (\Exception $e) {
  22. }
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function safeDown()
  28. {
  29. echo "M250506151432AlterTableCloudStockLevel cannot be reverted.\n";
  30. return false;
  31. }
  32. }