M240417103321AddTableGoodsIndex.php 636 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace addons\QiJuhe\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240417103321AddTableGoodsIndex
  6. */
  7. class M240417103321AddTableGoodsIndex extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "ALTER TABLE `qimall_addons_qijuhe_goods`
  15. ADD INDEX(`supply_id`),
  16. ADD INDEX(`goods_id`),
  17. ADD INDEX(`mall_goods_id`);";
  18. $this->execute($sql);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M240417103321AddTableGoodsIndex cannot be reverted.\n";
  26. return false;
  27. }
  28. }