Re: [Refdb-devel] upgrading the main database
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mar...@mh...> - 2006-09-28 08:19:49
|
Markus Hoenicka <mar...@mh...> was heard to say: > > The postinstall script checks for a main refdb database. If none is > > found it automatically creates a main sqlite database using the sqlite > > dump. Now that you have versioned the dump files it will be difficult > > for the postinstall script to know which dump file to import. I could > > include a loop in which it checks each refdb.[ver].dump.sqlite and > > determines the largest 'ver'. It would be easier, however, for me (and, > > I presume, other packagers) if the newest dump file had a predictable, > > stable name. Could you call the newest version 'refdb.dump.sqlite' with > > only older versions numbered? When the newest version is replaced it > > would then be renamed to include the version number and the replacement > > (now the newest) would receive the unversioned name. Alternately, and > > to avoid any possible confusion, the newest dump might be called > > 'refdb.newest.dump.sqlite' or 'refdb.latest.dump.sqlite'. > > > > I was thinking along these lines too. I think I'll reverse the current > filenames > to refdb.dump.sqlite and version only the older ones. > Now that I turned my brain on again (it must have been offline yesterday...), renaming the files is not necessary. Your postinstall script should simply rely on refdbd -a doing the right thing if it is run unconditionally. As mentioned before, if the main database is at the current version, this command will do nothing. If the main database is too old, it will be upgraded. If there is no main database, it will be created. Therefore you no longer need to know which dump file to use, and you no longer need a dependency on the sqlite binary either. refdbd -a will do all this for you. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |