工匠迁移语法错误

时间:2014-12-12 12:43:11

标签: sql-server laravel odbc artisan-migrate

我正在尝试进行工匠迁移。我已经安装了odbc-driver并且连接设置成功,因为我可以从db读取。问题是我无法使用php artisan migrate创建表。我在php.ini上启用了odbc。错误如下:

{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Ccovey\\ODBCDriver\\Schema\\Grammars\\Sq
lServerGrammar' not found","file":"C:\\wamp\\www\\license3\\vendor\\ccovey\\odbc-driver-l4\\src\\Ccovey\\ODBCDriver\\ODBCDriverConnecti
on.php","line":36}}

这是我的ODBCDriverConnection类:

class ODBCDriverConnection extends Connection
{
    /**
     * @return Query\Grammars\Grammar
     */
    protected function getDefaultQueryGrammar()
    {
        $grammarConfig = $this->getGrammarConfig();

        if ($grammarConfig) {
            $packageGrammar = "Ccovey\\ODBCDriver\\Grammars\\" . $grammarConfig;
            if (class_exists($packageGrammar)) {
                return $this->withTablePrefix(new $packageGrammar);
            }

            $illuminateGrammar = "Illuminate\\Database\\Query\\Grammars\\" . $grammarConfig;
            if (class_exists($illuminateGrammar)) {
                return $this->withTablePrefix(new $illuminateGrammar);
            }
        }

        return $this->withTablePrefix(new Grammar);
    }

    /**
     * Default grammar for specified Schema
     * @return Schema\Grammars\Grammar
     */
    protected function getDefaultSchemaGrammar()
    {
        return $this->withTablePrefix(new Schema\Grammars\SqlServerGrammar);
    }

    protected function getGrammarConfig()
    {
        if ($this->getConfig('grammar')) {
            return $this->getConfig('grammar');
        }

        return false;
    }
}

0 个答案:

没有答案