r20123 - gnucash/trunk/src/backend - Enhanced database version handling.

John Ralls jralls at code.gnucash.org
Tue Jan 18 18:42:49 EST 2011


Author: jralls
Date: 2011-01-18 18:42:48 -0500 (Tue, 18 Jan 2011)
New Revision: 20123
Trac: http://svn.gnucash.org/trac/changeset/20123

Modified:
   gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c
   gnucash/trunk/src/backend/dbi/test/test-dbi-basic.c
   gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.c
   gnucash/trunk/src/backend/sql/gnc-backend-sql.c
   gnucash/trunk/src/backend/sql/gnc-backend-sql.h
Log:
Enhanced database version handling.

* Add a macro GNC_RESAVE_VERSION which holds an svn revision number. 
* When fully saving a database put this number in versions with 
  table_name Gnucash-Resave.
* On database load, compare the current GNC_RESAVE_VERSION with the 
  Gnucash revision and Gnucash-Resave revision saved when the database 
  was created. 
* If the current GNC_RESAVE_VERSION > the saved Gnucash 
  version, then emit ERR_SQL_DB_TOO_OLD.
* If GNC_RESAVE_VERSION < the saved Gnucash-Resave, emit ERR_SQL_DB_TOO_NEW.





More information about the gnucash-patches mailing list