47 lines
1.8 KiB
PHP
47 lines
1.8 KiB
PHP
<?php
|
|
|
|
use think\migration\Migrator;
|
|
use think\migration\db\Column;
|
|
|
|
class UserAlipay 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('user_alipay')->setCollation('utf8mb4_general_ci')->setComment('买家支付宝');
|
|
$table
|
|
->addColumn(Column::unsignedInteger('user_id')->setComment('关联用户ID'))
|
|
->addColumn(Column::string('detail')->setComment('支付宝号码'))
|
|
->addColumn(Column::integer('alipay_image_id')->setComment('认证图片'))
|
|
->addColumn(Column::tinyInteger('status')->setDefault(0)->setComment('认证状态0=认证中1=通过-1=未通过'))
|
|
->addColumn(Column::string('remark')->setNullable()->setComment('未通过的理由'))
|
|
->addColumn(Column::unsignedInteger('admin_id')->setNullable())
|
|
->addColumn(Column::unsignedInteger("admin_time")->setComment('审核时间')->setDefault(0))
|
|
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
|
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
|
->addIndex(['user_id'])
|
|
->addIndex(['detail'])
|
|
->create();
|
|
}
|
|
}
|