Re: upgrading the main database

Markus Hoenicka <[email protected]> Wed, 27 Sep 2006 13:32:45 +0200
Newsgroups gmane.text.refdb.devel
Message-ID <[email protected]>
Hi David,

David Nebauer <[email protected]> was heard to say:

> The easiest thing to do from a packager's point of view would be to run
> this command unconditionally as part of the postinstall process.  The
> reason is that it is difficult to tell the new db version immediately
> after installation but before the daemon has been started.  Can running
> the upgrade after each server upgrade cause harm?  I hope refdbd is
> smart enough to know when an upgrade is unnecessary and can be skipped.
>

You can do just this. If refdbd -a notices that the installed main database is
already at the latest version, it does nothing.

> 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.

regards,
Markus


-- 
Markus Hoenicka
[email protected]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV