M240903153309AddColumnDeliveryToItem.php 954 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace addons\StarChain\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240903153309AddColumnDeliveryToItem
  6. */
  7. class M240903153309AddColumnDeliveryToItem extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. ALTER TABLE `qimall_addons_star_chain_order_item`
  16. ADD COLUMN `delivery_sn` varchar(64) NULL DEFAULT '' COMMENT '物流编号' AFTER `num`,
  17. ADD COLUMN `delivery_corp_sn` varchar(64) NULL DEFAULT '' COMMENT '物流公司编号' AFTER `delivery_sn`,
  18. ADD COLUMN `send_status` tinyint(2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '发货状态 0未发货 1已发货' AFTER `delivery_corp_sn`;
  19. SQL;
  20. $this->execute($sql);
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. echo "M240903153309AddColumnDeliveryToItem cannot be reverted.\n";
  28. return false;
  29. }
  30. }