M230807033123AlterQimallAddonsShortVideoComment.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace addons\ShortVideo\console\migrations;
  3. use common\models\common\Addons;
  4. use yii\db\Migration;
  5. /**
  6. * Class M230807033123AlterQimallAddonsShortVideoComment
  7. */
  8. class M230807033123AlterQimallAddonsShortVideoComment extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. try {
  16. $sql="ALTER table qimall_addons_short_video_comment add `is_top` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否置顶0.否|1.是';";
  17. $this->execute($sql);
  18. }catch (\Exception $e){
  19. }
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. echo "M230807033123AlterQimallAddonsShortVideoComment cannot be reverted.\n";
  27. return false;
  28. }
  29. /*
  30. // Use up()/down() to run migration code without a transaction.
  31. public function up()
  32. {
  33. }
  34. public function down()
  35. {
  36. echo "M230807033123AlterQimallAddonsShortVideoComment cannot be reverted.\n";
  37. return false;
  38. }
  39. */
  40. }