gamebackend/database/migrations/20220113105029_check_out.php

45 lines
1.9 KiB
PHP
Raw Permalink Normal View History

<?php
use think\migration\Migrator;
use think\migration\db\Column;
class CheckOut extends Migrator
{
/**
* 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()
{
$table = $this->table('check_out', ['comment' => '结算记录', 'engine' => 'InnoDB', 'encoding' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci']);
$table->addColumn('agency', 'string',['limit'=>30, 'default'=>'','comment'=>'代理账号'])
->addColumn('money', 'decimal',['limit'=>[8,2], 'default'=>0,'comment'=>'结算金额'])
->addColumn('tax', 'decimal',['limit'=>[5,2], 'default'=>0,'comment'=>'手续费'])
->addColumn('amount', 'decimal',['limit'=>[8,2], 'default'=>0,'comment'=>'实际金额'])
->addColumn('type', 'integer',['limit'=>1, 'default'=>0,'comment'=>'兑换类型'])
->addColumn('name', 'string',['limit'=>30, 'default'=>'','comment'=>'代理昵称'])
->addColumn('bank_account', 'string',['limit'=>30, 'default'=>'','comment'=>'结算账户'])
->addColumn('status', 'boolean',['limit'=>1, 'default'=>0,'comment'=>'状态'])
->addColumn('create_time', 'integer',['limit'=>10, 'default'=>0,'comment'=>'创建时间'])
->addColumn('update_time', 'integer',['limit'=>10, 'default'=>0,'comment'=>'更新时间'])
->create();
}
}