othmar52 / slimpd

PHP/JS based MPD-web-client for large music collections
GNU Affero General Public License v3.0
41 stars 11 forks source link

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

Open igwan opened 7 years ago

igwan commented 7 years ago

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));.

othmar52 commented 7 years ago

@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.