On Jan 27, 2014, at 1:47 AM, Ryan Eberhardt <[email protected]> wrote:
> Context: I'm using Pyramid with SQLAlchemy, and am pretty deep into a project > with no database versioning. I'm looking to use Alembic to start doing that. > > I read at > http://alembic.readthedocs.org/en/latest/tutorial.html#building-an-up-to-date-database-from-scratch > that I can use the SQLAlchemy create_all for a first version to create the > schema. I got my metadata from op.get_context.opts['target_metadata'], but I > can't figure out how to get the engine or connection to provide as the > create_all parameter... The snippet at the provided URL just shows > "my_metadata" and "engine" variables without showing where these came from. > Am I missing? Some solid Googling didn't turn anything up… somewhere in your pyramid app, you’ve set up a create_engine() somewhere…Pyramid doesn’t have any fixed convention for this so it depends on how you are accessing this creation function. How are you running it ? If you wrote some kind of .py script, it would call upon that function where you’ve also done the create_engine() step. This is all kind of DIY so you’d just establish your own system.
signature.asc
Description: Message signed with OpenPGP using GPGMail
