views:

205

answers:

1

Hello,

I am working on my first pylons + SQLAlchemy app (I'm new to both).

As I change my mind on the table structure, I wish there was a similar function to metadata.create_all(), that checks if there are new columns definitions and create theme in the database.

Does such a function exist ?

+2  A: 

I'm not (yet) a SQLAlchemy user, but I've heard good things about sqlalchemy-migrate. The general term of the problem you have is "schema migration", I'm sure a google search containing these terms will help you further.

piquadrat
Thank you, I wasn't aware of this term, nor of the existence of such a tool for sqlalchemy-migrate. However, it would be much straightforward for me to just override whatever "create" method in a subclass. Maybe override the Table::create method to alter its structure if it aleready exists in the database.
ychaouche