ThinkAdmin/plugin/think-plugs-account/stc/database/20230224000002_install_account20240308.php
2024-08-02 08:45:48 +08:00

44 lines
1.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | Account Plugin for ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2022~2024 ThinkAdmin [ thinkadmin.top ]
// +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top
// +----------------------------------------------------------------------
// | 免责声明 ( https://thinkadmin.top/disclaimer )
// | 会员免费 ( https://thinkadmin.top/vip-introduce )
// +----------------------------------------------------------------------
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-account
// | github 代码仓库https://github.com/zoujingli/think-plugs-account
// +----------------------------------------------------------------------
use think\migration\Migrator;
@set_time_limit(0);
@ini_set('memory_limit', -1);
/**
* 数据库更新补丁
* @class InstallAccount20240308
* @package think\migration\Migrator
*/
class InstallAccount20240308 extends Migrator
{
/**
* 更新数据库
*/
public function change()
{
// 短信记录表修正字段
$table = $this->table('plugin_account_msms');
$table->hasColumn('unid') || $table->renameColumn('uuid', 'unid')->update();
// 用户表增加密码字段
$table = $this->table('plugin_account_user');
$table->hasColumn('password') || $table->addColumn('password', 'string', [
'limit' => 32, 'default' => '', 'null' => true, 'after' => 'nickname', 'comment' => '登录密码'
])->update();
}
}