$sessionDBGroup not working - migration |
My default main database has 47 tables and 65 million rows. So to reduce load on my main database I am trying to use $sessionDBGroup to use separate database to store session related data. Problem is in migration. When I run migration, migration process does not create any table in $sessionDBGroup database. When I load site session library try to read from this $sessionDBGroup. As a result table not exists error happens. When I tested migration process in a fresh new installation, migration process can create 46 tables in my default database group and this is ok because session table should not be in that database instead it should be created in other database group $sessionDBGroup. What should I do to fix it?
app/Config/App.php PHP Code: public $sessionDBGroup = 'session_db_group'; app/Config/Database.php PHP Code: public $defaultGroup = 'default';
CodeIgniter 4 User Guide - Connecting to the Database
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
[quote pid="390998" dateline="1635220029"]
Simple solution is, we need to add database group in migration class like below: PHP Code: public function __construct(){ [/quote] |
Welcome Guest, Not a member yet? Register Sign In |