M240608071421UpdateTitleTipsPlaceholderLength.php 953 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace addons\SmartForm\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240608071421UpdateTitleTipsPlaceholderLength
  6. * 更新title tips placeholder 字段长度
  7. */
  8. class M240608071421UpdateTitleTipsPlaceholderLength extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $sql = <<<UPDATE
  16. ALTER TABLE `qimall_addons_smart_form_template_column`
  17. MODIFY COLUMN `placeholder` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '简短提示' AFTER `tips`;
  18. UPDATE;
  19. $this->execute($sql);
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. return false;
  27. }
  28. /*
  29. // Use up()/down() to run migration code without a transaction.
  30. public function up()
  31. {
  32. }
  33. public function down()
  34. {
  35. echo "M240608071421UpdateTitleTipsPlaceholderLength cannot be reverted.\n";
  36. return false;
  37. }
  38. */
  39. }