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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -