M241114075657AddNumsColumnToOrderExpressTable.php 540 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Handles adding columns to table `{{%order_express}}`.
  6. */
  7. class M241114075657AddNumsColumnToOrderExpressTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. ALTER TABLE `qimall_order_express`
  16. ADD COLUMN `nums` json NULL COMMENT '发货数量 {detail_id: num}';
  17. SQL;
  18. $this->execute($sql);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. return false;
  26. }
  27. }