Voltron

I haven't done much moving applications around so I set up some tests.
As I use MySQL I set up 2 databases: "migration_a" and "migration_b".

I created an app "migration_a" with 1 table with 3 columns , a create
action and a list action, database called "migration_a".  Added a
couple of rows and displayed them - all ok.

I did a "pack all" on migration_a, had a look in the resulting tar and
it seems to be just that, a tar of everything.  Did an "upload
application" of the pack-all tar  and renamed to "migration b".  I now
have a migration_b app. The only problem is that my db.py says the
database is "migration_a" which is ok so change it to migration_b, run
the app and everything works fine.

I then went back to migration_a and added a column to my table, added
an action to my controller,ran the app, added a row, all fine, packed
the app.  If I now "upload application" using the new migration_a pack
tar and rename it to migration_b (same as before) then NOTHING in
migration_b is changed - it is silently ignored.

So I took the pack tar and manually extracted it in applications/
migration_b, changed the database name in db.py to migration_b (easy
to forget that bit) and everything runs perfectly.

However, if I uninstall migration_b (leaving the database untouched)
and repeat the previous step I get a "table x already exists" error.

So, as far as the above tests go, it seems the rules are:
1) To create a new copy of an app you can pack the original and upload
to the new name.
2) To "roll out" a new version of the original app to the copy, you
can pack the new version but you must extract it in the copy app
directory manually.
3) If you uninstall the copy app then you have to drop/recreate the
copy database as well otherwise you will get "table exists" errors.
4) Don't forget to change the database name in db.py after uploading/
extracting the packed tar (like I always do)

I hope this helps - at least I understand it a bit better now :-)


On Oct 25, 2:25 am, mdipierro <[EMAIL PROTECTED]> wrote:
> I am too sleepy tonight to understand the problem... will get back on
> this tomorrow.
>
> Massimo
>
> On Oct 24, 3:42 pm, voltron <[EMAIL PROTECTED]> wrote:
>
> > Ping!
>
> > ok, since the suggestion did not generate any comments, how can one
> > avoid the migration problems in the case I presented above? Any
> > workarounds?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to