python - Why doesn't sqlalchemy modify the database when I add/remove a column? -
if run python script, creates tables correctly.
however, if add/remove column , run script again, doesn't modify database.
why this?
i doing after defining everything:
mapper(product, products) mapper(category, categories) metadata.create_all(engine) session = session()
create_all creates. doesn't modify. http://www.sqlalchemy.org/docs/core/schema.html?highlight=create_all#sqlalchemy.schema.metadata.create_all
if you've changed columns need either drop/readd table, or manually add column outside of script. there tools sqlalchemy-migrate full migrations manager project. http://code.google.com/p/sqlalchemy-migrate/
Comments
Post a Comment