On Tuesday 24 July 2007 16:22:43 Anton V. Belyaev wrote:
> Hey,
>
> I believe there is a common approach to the situation, but I just
> dont know it.
>
> Let say, I have some tables created in the DB using SQLAlchemy.
> Then I modify Python code, which describes the table (add a column,
> remove another column,...). What is the common way to handle this
> situation? I guess it would be good to have an exception raised
> when there is a mismatch between DB tables and Python-defined
> (using SQLAlchemy).

Very soon i'll be in your situation (with hundreds of tables), so i'm 
very interested if something comes up. 

it's in the todo list of dbcook. my idea so far is:
 - automaticaly reverse engineer i.e. autoload the available 
db-structure into some metadata.
 - create another metadata as of current code
 - compare the 2 metadatas, and based on some rules - ??? - 
alter/migrate the DB into the new shape.
This has to be as automatic as possible, leaving only certain - if 
any - decisions to the user.
Assuming that the main decision - to upgrade or not to upgrade - is 
taken positive, and any locks etc explicit access is obtained.

svil

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to