20251121023409_wechat_delivery.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. final class WechatDelivery extends AbstractMigration
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
  13. *
  14. * Remember to call "create()" or "update()" and NOT "save()" when working
  15. * with the Table class.
  16. */
  17. public function change(): void
  18. {
  19. $this->table('wechat_delivery', ['signed' => false, 'comment' => '微信快递公司列表'])
  20. ->addColumn('delivery_id', 'string', ['limit' =>32, 'comment' => '快递公司 ID'])
  21. ->addColumn('delivery_name', 'string', ['comment' => '快递公司名称'])
  22. ->addColumn('can_use_cash', 'tinyinteger', ['signed' => false, 'comment' => '是否支持散单, 1表示支持'])
  23. ->addColumn('can_get_quota', 'tinyinteger', ['signed' => false, 'comment' => '是否支持查询面单余额, 1表示支持'])
  24. ->addColumn('service_type', 'json', ['comment' => '支持的服务类型'])
  25. ->addColumn('cash_biz_id', 'string', ['limit' => 32, 'comment' => '散单对应的bizid,当can_use_cash=1时有效'])
  26. ->addTimestamps('create_time', 'update_time')
  27. ->addIndex(['delivery_id'], ['unique' => true])
  28. ->create();
  29. }
  30. }