| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- declare(strict_types=1);
- use Phinx\Migration\AbstractMigration;
- class ExtensionBalpayLog 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
- {
- $table = $this->table('extension_balpay_log', ['commonts' => '余额支付日志']);
- $table->addColumn('user_id', 'integer', ['signed' => false, 'comment' => '用户ID'])
- ->addColumn('order_id', 'integer', ['signed' => false, 'default' => 0, 'comment' => '订单ID(可为0)'])
- ->addColumn('type', 'integer', ['signed' => false, 'default' => 0, 'comment' => '流水类型:1-充值 2-消费 3-退款 4-冻结 5-解冻'])
- ->addColumn('amount', 'decimal', ['precision' => 10, 'scale' => 2, 'comment' => '金额'])
- ->addColumn('balance', 'decimal', ['precision' => 10, 'scale' => 2, 'comment' => '当前余额'])
- ->addColumn('description', 'string', ['limit' => 255, 'comment' => '描述'])
- ->addTimestamps('create_time', 'update_time')
- ->create();
- }
- }
|