If applications share a table, you must decide which app owns the table. 
 Only that application should ever migrate the table.

Assuming an application called 'foo', this could be accomplished by 
something like this in your model file.

should_migrate = False
if request.application=='foo':
  should_migrate = True

db.define_table('foo_objects',
  Field('foo_object_name' ....
  ),
  migrate=should_migrate
)

Be aware, though, that upgrading your applications in production becomes 
somewhat twitchy.  If you have another application, 'bar' that requires a 
change to the foo_objects table, you need to follow a sequence of events 
like this:

   1. upload the foo_objects model file.
   2. do a request in foo to make the migration kick in.  Just open the 
   database administrator page or do a refresh if you already have it open.
   3. upload the bar model table that references foo_objects
   4. upload the bar controller that references the table

You really need to do upgrades like this via script or other automated tool.

On Wednesday, April 8, 2009 12:18:01 AM UTC-4, TheDude wrote:
>
> OperationalError: (1050, "Table 'users' already exists") 
>
> I know it already exists, but I want you to just know about it rather 
> than try to create it all the time. I tried clearing out my /databases 
> folder as well. Any other ideas?

Reply via email to