M250222153365AlterSmartFormTemplateColumn.php 651 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace addons\SmartForm\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250222153365AlterSmartFormTemplateColumn
  6. * 更新option 字段类型
  7. */
  8. class M250222153365AlterSmartFormTemplateColumn extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $sql = <<<SQL
  16. ALTER TABLE `qimall_addons_smart_form_template_column`
  17. MODIFY COLUMN `option` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '选项' AFTER `limit`;
  18. SQL;
  19. $this->execute($sql);
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. return false;
  27. }
  28. }