Laravel 5.3 - can't use session db driver
I'm upgrading my app from Laravel 4.2 to 5.3. I finally got everything working except one strange thing - I can't save sessions in database. If I use file driver everything works great, but if I try to use db I get error: column "user_id" of relation "sessions" does not exist. Thing is that column exists. I also tried to create a new table and make Laravel use it, but then i get an error that entire table doesn't exists. Just to mention that app reads and writes to all other tables with no problem. I also tried to make a fresh new Laravel installation and just drop my app specific files but the result was the same. Has anyone came across this problem? Btw I'm using PostgreSQL.
Here is my log:
Next exception 'Illuminate\Database\QueryException' with message 'SQLSTATE[42703]: Undefined column: 7 ERROR: column "user_id" of relation "sessions" does not exist
LINE 1: ...sert into "sessions" ("payload", "last_activity", "user_id",...
^ (SQL: insert into "sessions" ("payload", "last_activity", "user_id", "ip_address", "user_agent", "id") values (YTo2OntzOjY6Il90b2tlbiI7czo0MDoiZkNWbjE0NDBWczh6S1JPek5COGpDTEszTllJRmVvbk5mSmFkeWJXQiI7czo0OiJsYW5nIjtzOjI6ImhyIjtzOjk6Il9wcmV2aW91cyI7YToxOntzOjM6InVybCI7czoxMDg6Imh0dHA6Ly9tb29kbGUtZGV2LnAuc3JjZS5oci9rYXRhbG9nNTMvbGFuZz9jdXJyZW50X3VybD1odHRwJTNBJTJGJTJGbW9vZGxlLWRldi5wLnNyY2UuaHIlMkZrYXRhbG9nNTMmbGFuZz1ociI7fXM6MjI6IlBIUERFQlVHQkFSX1NUQUNLX0RBVEEiO2E6MDp7fXM6OToiX3NmMl9tZXRhIjthOjM6e3M6MToidSI7aToxNDg0NzI1NTMyO3M6MToiYyI7aToxNDg0NzI1NTMyO3M6MToibCI7czoxOiIwIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==, 1484725532, , 161.53.254.88, Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36, tqXoLhN2U0A6FwWaDSRwshTDznxATIvwhGwcZZnP))' in /var/www/merlin/katalog53/vendor/laravel/framework/src/Illuminate/Database/Connection.php:771
Stack trace:
#0 /var/www/merlin/katalog53/vendor/laravel/framework/src/Illuminate/Database/Connection.php(726): Illuminate\Database\Connection->runQueryCallback('insert into "se...', Array, Object(Closure))
#1 /var/www/merlin/katalog53/vendor/laravel/framework/src/Illuminate/Database/Connection.php(481): Illuminate\Database\Connection->run('insert into "se...', Array, Object(Closure))
#2 /var/www/merlin/katalog53/vendor/laravel/framework/src/Illuminate/Database/Connection.php(435): Illuminate\Database\Connection->statement('insert into "se...', Array)
#3 /var/www/merlin/katalog53/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2138): Illuminate\Database\Connection->insert('insert into "se...', Array)
#4 /var/www/merlin/katalog53/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php(119): Illuminate\Database\Query\Builder->insert(Array)
#5 /var/www/merlin/katalog53/vendor/laravel/framework/src/Illuminate/Session/Store.php(263): Illuminate\Session\DatabaseSessionHandler->write('tqXoLhN2U0A6FwW...', 'a:6:{s:6:"_toke...')
#6 /var/www/merlin/katalog53/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(88): Illuminate\Session\Store->save()
#7 /var/www/merlin/katalog53/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(177): Illuminate\Session\Middleware\StartSession->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#8 /var/www/merlin/katalog53/public/index.php(57): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#9 {main}
If I try to do var_dump of any variable at the lines from the trace I get nothing, like that code is never executed :/
Thanks, Zvone
Please or to participate in this conversation.