slimpd icon indicating copy to clipboard operation
slimpd copied to clipboard

hard-reset check for the users table, even on its first run (when no tables exists)

Open igwan opened this issue 8 years ago • 1 comments

During the installation, I was trying to run hard-reset to create the database but got the error : Can't connect to database. please check your settings!

I added cliLog($exception->getMessage()); in core/php/dependencies.php line 349 to get a better error message :

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'slimpddb.users' doesn't exist (SQL: select * from `users` where `users`.`uid` = 1 limit 1)

It seems the database check in core/php/dependencies.php is using the users table and the hard-reset script is calling this dependencies.php script even on its first run, when no tables exists.

I'm not sure how to solve this, either create a init-db task which doesn't run the dependencies.php code or find another way to check for database connectivity.

Anyway the quick workaround is to run CREATE TABLE users (uid int(11));.

igwan avatar Feb 22 '17 11:02 igwan

@igwan thank you for reporting. i already noticed this issue a few weeks ago as i decided to use eloquent for the user model.

currently i have no idea to solve this problem without creating an ugly hack. but i am looking forward to find a solution.

othmar52 avatar Feb 23 '17 18:02 othmar52