Bug 341304 - upgrade database to version 1 does not work with sqlite
Summary: upgrade database to version 1 does not work with sqlite
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: database (show other bugs)
Version: git (master)
Platform: Compiled Sources All
: NOR minor
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-26 20:28 UTC by Christian David
Modified: 2022-11-13 05:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian David 2014-11-26 20:28:55 UTC
MyMoneyStorageSql::upgradeToV1() uses the query "ALTER TABLE kmmSplits ADD PRIMARY KEY (transactionId, splitId);" which will always fail in SQLite because it does not support adding primary keys in alter table (http://sqlite.org/lang_altertable.html).

KMyMoney will not open SQLite databases of version 0 - that issue must be there for five years already. So we have to decide if it will be fixed as nobody complained before. I found it only because the databasemrgtest persistently fails/crashes on my system.
Comment 1 Christian David 2015-01-10 16:41:58 UTC
Git commit d30be72a46be9450a0f205d7c615b96f34a8bf0a by Christian Dávid.
Committed on 10/01/2015 at 16:20.
Pushed by christiand into branch 'master'.

Database version is set after creating tables

So the upgrade routine is not executed starting from version 0 - which
is useless as the database should be the most recent version anyway.

Also removed the version param from createTables(int version). It was
not used and was totaly useless as createTables() calls upgradeDb().

This is also a workaround for bug 341304 as the upgradeToV1() won't be
called after creation of tables anymore. The bug persists if the user
has a version 0 database.
REVIEW: 121288

M  +1    -1    kmymoney/mymoney/storage/mymoneydatabasemgrtest.cpp
M  +16   -8    kmymoney/mymoney/storage/mymoneystoragesql.cpp
M  +1    -1    kmymoney/mymoney/storage/mymoneystoragesql.h

http://commits.kde.org/kmymoney/d30be72a46be9450a0f205d7c615b96f34a8bf0a
Comment 2 Justin Zobel 2022-10-14 05:46:47 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported and confirmed, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 3 Bug Janitor Service 2022-10-29 05:02:16 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Bug Janitor Service 2022-11-13 05:14:31 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!