[GNC] Database Versions
John Ralls
jralls at ceridwen.us
Mon Sep 23 13:40:05 EDT 2024
This applies to the SQL backend only, the XML file has no version information.
Once you’ve populated the database the versions table should look like this:
Gnucash|2060800
Gnucash-Resave|19920
accounts|1
books|1
budgets|1
budget_amounts|1
commodities|1
lots|2
prices|3
schedxactions|1
transactions|4
splits|5
billterms|2
customers|2
employees|2
entries|4
invoices|4
jobs|1
orders|1
taxtables|2
taxtable_entries|3
vendors|1
recurrences|2
slots|4
Gnucash records the version of GnuCash that originally created the database. Gnucash-Resave indicates the subversion commit number from the original creation of the SQL schema; we’d bump that if we were to make a schema change so dramatic that we needed to recreate the whole database (we haven’t yet). The remaining records table schema versions. For those that aren’t 1 there will be a comment section in the respective table implementation file labelled Upgrade (e.g. https://github.com/Gnucash/gnucash/blob/63714e5e93b2091b35bbd0d28f69bce03a397d3e/libgnucash/backend/sql/gnc-transaction-sql.cpp#L459) with a brief explanation of the change; you can use git blame to find the commit for each of those lines to get to the commit which will usually provide more details about it.
Regards,
John Ralls
> On Sep 23, 2024, at 09:01, Mark at Lorimark <mark at lorimarksolutions.com> wrote:
>
> Hi,
>
> I was looking at my back-end data, and find that there is a version reference there. In my old accounting file that I've been working in for a while, it shows "Gnucash|4000013". If I create a new file with no data, it shows "Gnucash|5000008".
>
> I'm curious, are there any references on-line as to the differences in the database schema for these different versions, and also does GnuCash automatically apply schema changes to the data when things change?
>
>> mark at lsus2:~/LorimarkSolutions/gnucash$ sqlite3 Gnucash58Test.gnucash
>> sqlite> select * from versions;
>> Gnucash|5000008
>> Gnucash-Resave|19920
>
>> mark at lsus2:~/LorimarkSolutions/gnucash$ sqlite3 LorimarkSolutions.gnucash sqlite> select * from versions;
>> Gnucash|4000013
>> Gnucash-Resave|19920
>> books|1
>
> --
> ~mark petryk
> ~w:http://www.lorimarksolutions.com
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
More information about the gnucash-user
mailing list