Yesterday I updated my emonCMS that I use for MyHomeEnergyPlanner and today when trying to log in I couldn’t, I got in the login box the following message: Database error, you may need to run database update
Digging into the error this waw the MySQL error: Unknown column ‘email_verified’ in ‘field list’.
To log in we are trying to fetch the column “email_verified” but that column doesn’t exist in my database yet. Also because I can’t login I can’t update the database. I have sorted it adding the column with phpMyAdmin.
I am posting it here because I am sure more than one will have the same problem unless they are already logged in when they update emonCMS and they do the database update straight away.
EmonPi installs will automatically call database update during the update process. For other installations its possible to enable a special update login by adding the line:
$updatelogin = true;
to settings.php.
You can then navigate to /emoncms/admin/db to run the update:
Would it not be useful to add $updatelogin = false;to the default settings file with an explanation of what it’s for and why it must always be set back to false after use. This would not only make the function more accessible, but also protect against users “just adding it” to the settings file and forgetting to set it back to false after forgetting it’s purpose further down the line.
[edit] or add $updatelogin = true;` commented out with a note?
I solved the same error (but may be a different problem) using this solution (which IMHO is better than fiddling with the settings.php file). Perhaps that php file can be made available in the main emoncms repo so it can be run from the command line?