我只是从 Laravel 存储库克隆 git 并设置 pgSQL 数据库详细信息。接下来我尝试使用artisan
来创建session
表。
php artisan session:table
但是,这给了我以下错误:
X-Powered-By: PHP/5.3.16
Content-type: text/html
<br />
<b>Fatal error</b>: Uncaught exception 'Laravel\Database\Exception' with message 'SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "sessions" does not exist
LINE 1: SELECT * FROM "sessions" WHERE "id" = $1 LIMIT 1
^
SQL: SELECT * FROM "sessions" WHERE "id" = ? LIMIT 1
Bindings: array (
0 => 'i8qwmexP1joUkSLDH7naRayJDiSrLFGQa4xeubgz',
)' in /home/dev/public_html/laravel/database/connection.php:263
Stack trace:
#0 /home/dev/public_html/laravel/database/connection.php(183): Laravel\Database\Connection->execute('SELECT * FROM "...', Array)
#1 /home/dev/public_html/laravel/database/query.php(648): Laravel\Database\Connection->query('SELECT * FROM "...', Array)
#2 /home/dev/public_html/laravel/database/query.php(592): Laravel\Database\Query->get(Array)
#3 /home/dev/public_html/laravel/database/query.php(563): Laravel\Database\Query->first(Array)
#4 /home/dev/public_html/laravel/session/drivers/database.php(36): Laravel\Database\Query->find('i8qwmexP1joUkSL...')
#5 /home/dev/public_html/laravel/session/dri in <b>/home/dev/public_html/laravel/database/connection.php</b> on line <b>263</b><br />
当我将数据库驱动程序切换到时,mysql
我收到以下消息:
X-Powered-By: PHP/5.3.16
Content-type: text/html
You forgot to provide the task name.
执行 SQL 查询虽然有效,但artisan
无效。
CREATE TABLE `sessions` (
`id` VARCHAR(40) NOT NULL,
`last_activity` INT(10) NOT NULL,
`data` TEXT NOT NULL,
PRIMARY KEY (`id`)
);
使用 pgSQL 驱动程序时,我应该如何解决这个错误?不知道这里出了什么问题。