用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1860|回复: 1
收起左侧

[数据库] 求助,使用migrate类迁移数据库提示Message: Undefined property: Migrate::$auth

[复制链接]
发表于 2018-3-16 08:02:56 | 显示全部楼层 |阅读模式
CI version 3.0.3
新搭一台服务器环境,web程序部署完成,准备迁移数据库,按照官方教程在控制器文件夹添加一个迁移控制器,代码如下:
<?php

class Migrate extends CI_Controller
{

    public function index()
    {
        $this->load->library('migration');

        if ($this->migration->current() === FALSE)
        {
            show_error($this->migration->error_string());
        }
    }

}

输入url:http://localhost/migrate/,页面提示错误:
======================>up
A PHP Error was encountered
Severity: Notice

Message: Undefined property: Migrate:auth

Filename: libraries/Migration.php

Line Number: 443

An uncaught Exception was encountered
Type: Error

Message: Call to a member function table_exists() on null

Filename: /home/xzt/lianchong/Web/MonitorPHP/apps/libraries/Base_Migration.php

Line Number: 92

查看了下系统文件夹下的代码 libraries/Migration.php,类定义中找不到auth这个定义,请教下这个auth属性是哪里定义的?谢谢
发表于 2018-3-16 14:32:20 | 显示全部楼层
你这报错是自定义了 Base_Migration.php 里面的错误,不是用的系统 Migration.php

本版积分规则