Amarok/Archives/Database check idea

From KDE Community Wiki

Ok heres the not-so-simple-really thing...

The Current SVN first-run-wizard doesn't store the Database type on the last page, if it is compiled with mysql support. So, even if you configure the mysql during First-Run-Wizard then amaroK still starts-up using sqlite. This is easly fixable by renaming databaseEngine into kcfg_DatabaseEngine in dbsetup.ui and also in the header file.


While testing that, i noticed a worry-some behaviour and this is why im writing this.

Once the first-run-wizard is finished, it creates the amarokrc and puts the database config in it(atm its not saving the DatabaseEngine, hence the kcfg_ add). Now.. when amaroK starts, the amarokrc will contain only the database engine, also username and password if mysql was configured. Problem: amarokrc doesn't contain the default values. Database version is ofcourse the default value and is not saved into amarokrc during first-run-wizard. Now.. when amarok starts, it finds that (missing)DatabaseVersion does not match with the database version saved into amarokapp. Henche the tables are dropped and new tables are created. Sht!! there goes my database!

Now.. basicaly we assume that if the user didnt had amarokrc, then he also doesnt have database.. but what if i want to allow multible users to share the mysql database? a new user doesnt have amarokrc, but the database is already filled with info by another user for example. I know its basicaly not an importan thing, but basicaly the problem is that the database version is stored in amarokrc, and if that is missing, then the database is always dropped, recreated.


My idea: the database version should be stored inside of the database, instead of, or also in amarokrc.


Because, currently my mysql contains a database version 89 for example, amarok expects to see database version 89, but as my amarokrc doesnt contain the database versin, then amarok wipes out my database. if amarok would ask the version from the database, instead of the config file, then everything would be ok, as the database matches amarok's required database.