I'm just raising this to get some miscellaneous database problems documented, since I'm just about to migrate to KDE4.2 and who knows what will happen! None of them are high priority.
1. KVP discrepancy (may no longer be a problem)
Some KeyValuePairs are not being written to the database.
Using an XML file:
1. I open an XML file, add a new account, and re-save, the new account gets
written out without a 'lastStatementDate' KVP.
2. I re-open it, add a transaction, and re-save it, the account created in
step 1 has acquired the missing KVP.
Using a database:
Step 1 works as for XML file.
Step 2 does not acquire the missing KVP.
2. Precision problem
The 'xyzFormatted' fields in the database are always written with a precision of 2. This is not correct. However, since these fields are only provided as a convenience, and are not fed back into the app, this is pretty much cosmetic.
3. Potential upgrade problem
Consider the following scenario:
1. In (say) V4, we introduce a new table
2. In V5, we add a column to this table
3. If a user opens a db which is V3, then
4. in UpgradeToV4, we will create the table, but using the V5 dbdef, which
contains the new column
5. In UpgradeToV5, we will attempt to add the column again, and (presumably)
crash out with a duplicate name failure.
Being as KMM is a frequently used app, and times between upgrades are
relatively long, it's unlikely that anyone will need to upgrade 2 versions at
once, but I suppose we should cater for it.
I haven't thought through all the logic, but I thought of having a function
void checkAddColumn (table def, column def)
which would check for the presence of a column before adding it Qt provides a
record.contains function). Maybe something similar for dropColumn. I think
the code could look tidier too.