M240710102822AddTHashField.php 882 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace addons\WechatVideoShop\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240710102822AddTHashField
  6. */
  7. class M240710102822AddTHashField extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("ALTER TABLE `qimall_addons_wechat_video_shop_express_template`
  15. ADD COLUMN `t_hash` CHAR(32) NOT NULL DEFAULT '' COMMENT '模板内容MD5值',
  16. ADD INDEX `t_hash` (`t_hash`);
  17. ");
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function safeDown()
  23. {
  24. echo "M240710102822AddTHashField cannot be reverted.\n";
  25. return false;
  26. }
  27. /*
  28. // Use up()/down() to run migration code without a transaction.
  29. public function up()
  30. {
  31. }
  32. public function down()
  33. {
  34. echo "M240710102822AddTHashField cannot be reverted.\n";
  35. return false;
  36. }
  37. */
  38. }