Hi Aubin. I was thinking something along these lines but initially prefered to have the schema in a single sql file. I may try things this way once I squash a few bugs and make things work a bit better though.


Aubin Paul wrote:
To further explain how this could work:


1. Check for a table called freevo_core or something, which has a few basic things, including a version number.

Yep, already saving version info in the db...


2. If no table exists, then use a 'create_tables()' function

3. If table DOES exist, check the version and use ALTER TABLE commands
to update it, and then update the version.

I think I've read that sqlite doesn't support ALTER TABLE but the table data can be copied into a temp table while the table is dropped and recreated.



I guess for the ALTER to work, you'd need to keep the revisions in
kind of a cascaded list, i.e.

ver = get_ver_from_table()

if ver < X1:
    command()
if ver < X2:
    command()
if ver < X3:
    command()

and X1 < X2 < X3

so it would call start at one and call the functions beneath it so
instead of keeping a bunch of upgrade queries, you just run the alters
for each version.

Good point. It would incrmentally update from any old version that way.


You probably thought of this, but here it is ;)

Yes, this did occur to me but thanks for reinforcing the ideas!

-Rob


------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Freevo-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to