On 21/02/2012 18:41, Michael Bayer wrote:

The current release does this:

http://alembic.readthedocs.org/en/latest/tutorial.html#the-migration-environment
http:/alembic.readthedocs.org/en/latest/tutorial.html#editing-the-ini-file (see 
"file_template")

*goes to learn hg again* I thought I was looking at current tip :-/

Why not? The sql will still eventually be executed in the context of a database 
connection, right?

er well in the context of a connection, but not one where there is any application code 
prepared to receive result rows.     Think "cat myscript.sql | psql".

Yep, that makes sense, glad there's no reason not to do insert ... select stuff and sql that computes column values from other column values and the like (ie: oh, I just had an "email" column in the "user" table, now I realise I need a "contacts" table with an "email" type, as well as phone, etc.

- Is there any support for just adding raw lumps of sql as migration steps?

sure just use execute():

op.execute("my raw lump of SQL")

What would be great would be to have .sql files and .sqli (mako templates with some context provided by the env.py) in addition to .py files. How hard could that be? ;-)

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk

--
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to