On Dec 17, 2010, at 5:22 PM, Emanuele Gesuato wrote:

> Hi there,
> 
> If i define a new table unrelated (without foreign keys) to the tables
> that already exist i see that this new table is created automatically
> when i create the session.

I wouldn't say that's accurate.   SQLA creates tables specifically when 
metadata.create_all() or table.create() is called, and that's it.


> 
> But if i create a new column to a table that already exist this new
> one isn't created when i start the application. Is there a way to
> altering tables at runtime ?

you'd have to emit the appropriate ALTER statements to the database.   These 
are platform specific.

> 
> I know there is sqlalchemy-migrate. Is it the right tool for this
> job ?

its the right tool if you are maintaining your alterations to your schema as 
part of your application's build process.  If you have an app that just 
arbitrarily adds/removes columns as the app runs, that's typically a practice 
thats frowned upon in database circles, but you'd be looking to emit the ALTER 
statements manually.


> Or there is a sqlalchemy way for adding/removing columns at
> runtime ?
> 
> I hope my question is clear,
> thanks
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> 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.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
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