Message - ID: <1436202.ivb9Oc2hBi@asus-k53e> User - Agent: KMail/4.98 pre (Linux/3.15.3; KDE/5.1.0; x86_64; ; ) MIME - Version: 1.0 Content - Transfer - Encoding: quoted-printable Content - Type: text/plain; charset="iso-8859-1"
On Sunday, August 10, 2014 01:24:08 PM Christian D=E1vid wrote: > Hi all, > Hi Fernando, >=20 > as you can see from [1] I started to familiarize myself with the data= base > manager. >=20 > Now I added a new column to kmmFieldInfo in MyMoneyDbDef::FileInfo(vo= id) > using: >=20 > appendField(MyMoneyDbIntColumn("hiOnlineJobId", MyMoneyDbIntColumn::B= IG, > UNSIGNED, false, false, 8)); >=20 > First question: is that correct? Yes, that is correct. It should just add it on the next upgrade. You wi= ll=20 probably also have to update the version. >=20 > If I open KMyMoney with a sql-database it crashes because it tries to= select > the new column "hiOnlineJobId" (or even tags if the version is 6) bef= ore it > updated the database. >=20 > I did some investigation and noticed that the upgradeToVx() methods c= all > readFileInfo() and writeFileInfo() quite often. But these methods use= > m_db.m_tables["kmmFileInfo"].selectAllString(). This leads to the req= uest > for non-existing columns (-> exception -> crash). >=20 > Have I done something wrong? Those methods are intended for a few of the more complex updates to the= =20 structure we made in the past. I think just rolling the version number = will=20 fix it, but I need to look harder at it. >=20 > Btw: what is fixLevel in kmmFileInfo used for? >=20 If I remember correctly, this current problem is exactly it. Check out=20= upgradeToV2() for a small example. It calls alterTable() on a single ta= ble to=20 force the code to deal with the new columns. > Have a nice day! > Christian >=20 > P.S.: I think we have to rethink how the hole storage system should w= ork. > For beginners like me it is a lot of work to understand it, way to mu= ch if > you remember which tasks they solve. There are to many hacks, abstrac= tions > and methods which do nothing else then calling another method without= any > changes. I feel like being in a pinball machine :( But especially ope= n > source projects which are based on the work of volunteers must make i= t easy > for new contributors to help. If I had known what work is waiting for= me, I > had never started contributing. >=20 I agree, but I have not had a chance to tackle this. Thomas says he has= an=20 idea to clean up the whole storage system by going to an in-memory SQLi= te=20 database that gets dumped to disk when the user presses "Save". I suspe= ct his=20 schedule has been just as chaotic, but he may be able to provide more i= nsight=20 to you in case you want to address this. -- Thanks, Fernando Vilas fvi...@iname.com _______________________________________________ KMyMoney-devel mailing list KMyMoney-devel@kde.org https://mail.kde.org/mailman/listinfo/kmymoney-devel