42 lines
1.6 KiB
PHP
42 lines
1.6 KiB
PHP
<?php
|
|
|
|
use think\migration\Migrator;
|
|
use think\migration\db\Column;
|
|
|
|
class BankAccount 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('bank_account', ['comment' => '结算账户', 'engine' => 'InnoDB', 'encoding' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci']);
|
|
$table->addColumn('agency_id', 'integer',['limit'=>1,'default'=>0,'comment'=>'代理id'])
|
|
->addColumn('name', 'string',['limit'=>20, 'default'=>'','comment'=>'真实姓名'])
|
|
->addColumn('type', 'integer',['limit'=>2, 'default'=>0,'comment'=>'账户类型'])
|
|
->addColumn('account', 'string',['limit'=>30, 'default'=>'','comment'=>'收款账户'])
|
|
->addColumn('remark', 'string',['limit'=>50, 'default'=>'','comment'=>'备注'])
|
|
->addColumn('create_time', 'integer',['limit'=>10, 'default'=>0,'comment'=>'创建时间'])
|
|
->addColumn('update_time', 'integer',['limit'=>10, 'default'=>0,'comment'=>'更新时间'])
|
|
->create();
|
|
}
|
|
}
|