M241011084022AlterQimallOrderComments.php 905 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\migrations;
  3. use common\models\order\OrderComments;
  4. use yii\db\Migration;
  5. /**
  6. * Class M241011084022AlterQimallOrderComments
  7. */
  8. class M241011084022AlterQimallOrderComments extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $sql = "alter table qimall_order_comments add goods_type tinyint(1) not null default 0";
  16. $this->execute($sql);
  17. OrderComments::updateGoodsType();
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function safeDown()
  23. {
  24. echo "M241011084022AlterQimallOrderComments 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 "M241011084022AlterQimallOrderComments cannot be reverted.\n";
  35. return false;
  36. }
  37. */
  38. }