20251120070536_lakala_wechat_payment.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. final class LakalaWechatPayment 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('lakala_wechat_payment', ['comment' => '拉卡拉微信支付表', 'signed' => false])
  20. ->addColumn('payment_id', 'integer', ['signed' => false,'comment' => '支付ID'])
  21. ->addColumn('wechat_transaction_id', 'string', ['comment' => '微信交易ID'])
  22. ->addColumn('order_state', 'tinyinteger', ['signed' => false,'comment' => '订单状态枚举:(1) 待发货;(2) 已发货;(3) 确认收货;(4) 交易完成;(5) 已退款;(6) 资金待结算。'])
  23. ->addColumn('goods_desc', 'string', ['limit' => 255,'comment' => '商品描述'])
  24. ->addColumn('express_company', 'string', ['limit' => 32,'comment' => '快递公司ID'])
  25. ->addColumn('express_company_name', 'string', ['limit' => 64,'comment' => '快递公司名称'])
  26. ->addTimestamps('create_time', 'update_time')
  27. ->addIndex(['payment_id'], ['name' => 'idx_payment_id', 'unique' => true])
  28. ->addIndex(['wechat_transaction_id'], ['name' => 'idx_wechat_transaction_id', 'unique' => true])
  29. ->create();
  30. }
  31. }