M250208101738CloudStock101AddColumnToAgentOrderTable.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace addons\CloudStock\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250208101738AddSellerRemarkColumn
  6. */
  7. class M250208101738CloudStock101AddColumnToAgentOrderTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. ALTER TABLE `qimall_addons_cloud_stock_agent_order`
  16. ADD COLUMN `seller_remark` varchar(255) NOT NULL DEFAULT '' COMMENT '卖家备注',
  17. ADD COLUMN `cancel_admin_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '取消自提的管理员id',
  18. ADD COLUMN `is_shipping_refunded` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否已经退了运费',
  19. ADD COLUMN `is_delivery_address_modified` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否已经修改过收货地址';
  20. SQL;
  21. $this->execute($sql);
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. echo "M250208101738AddSellerRemarkColumn cannot be reverted.\n";
  29. return false;
  30. }
  31. /*
  32. // Use up()/down() to run migration code without a transaction.
  33. public function up()
  34. {
  35. }
  36. public function down()
  37. {
  38. echo "M250208101738AddSellerRemarkColumn cannot be reverted.\n";
  39. return false;
  40. }
  41. */
  42. }