| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- declare(strict_types=1);
- use Phinx\Migration\AbstractMigration;
- class ExtensionRefund extends AbstractMigration
- {
- /**
- * Change Method.
- *
- * Write your reversible migrations using this method.
- *
- * More information on writing migrations is available here:
- * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
- *
- * The following commands can be used in this method and Phinx will
- * automatically reverse them when rolling back:
- *
- * createTable
- * renameTable
- * addColumn
- * renameColumn
- * addIndex
- * addForeignKey
- *
- * Remember to call "create()" or "update()" and NOT "save()" when working
- * with the Table class.
- */
- public function change(): void
- {
- $this->table('extension_refund')
- ->setComment('支付退款记录表')
- ->addColumn('payment_id', 'integer', ['comment' => '关联支付记录ID'])
- ->addColumn('order_sn', 'char', ['limit' => 20, 'comment' => '支付订单编号'])
- ->addColumn('out_refund_no', 'char', ['limit' => 20, 'comment' => '商户退款单号'])
- ->addColumn('reason', 'string', ['comment' => '退款原因'])
- ->addColumn('amount', 'decimal', ['precision' => 10, 'scale' => 2, 'comment' => '退款金额(元)'])
- ->addColumn('status', 'tinyinteger', ['comment' => '退款状态:0-待退款/1-退款中/2-成功/3-失败'])
- ->addColumn('refund_id', 'char', ['limit' => 32, 'comment' => '三方退款唯一订单号'])
- ->addColumn('success_time', 'integer', ['comment' => '退款成功时间'])
- ->addColumn('refund_param', 'json', ['comment' => '退款参数'])
- ->addColumn('refund_result', 'json', ['comment' => '查询退款结果信息'])
- ->addColumn('status_desc', 'string', ['comment' => '退款状态说明'])
- ->addTimestamps('create_time', 'update_time')
- ->addIndex(['refund_id'])
- ->addIndex(['out_refund_no'], ['unique' => true])
- ->addIndex(['order_sn'])
- ->create();
- }
- }
|