I found that there is a little bit of awkwardness using Alembic with
Pyramid + Sqlalchemy, but overall, I works great for me. Here are a two
things that I do:


   1. Keep the Alembic settings in the same file as your environment
   settings (.ini file), that way you have all your site settings per
   environment in the same file. Something like this:

   [app:main]
   ...
   sqlalchemy.url = postgresql+psycopg2://your-connection-string
   ...

   [alembic]
   script_location = db_scripts
   sqlalchemy.url = postgresql+psycopg2://your-connection-string
   ...

   You could probably configure Pyramid to just use the Alembic section,
   but that's shouldn't be too difficult.

   When running the Alembic command, you can specify the .ini file you want
   to use:

   *alembic -c production.ini upgrade head*

   2. In your Alembic folder's env.py file, make sure you import any models
   that you want Alembic to use (assuming you are using the
*autogenerate* functionality).
   This is something I always forget.


Other than these two things, I found that the Sqlalchemy + Pyramid and
Alembic documentation are quite good for showing how to get things started.
Hopefully this helps and puts you on the right track.

-Vincent

On Mon, Jul 6, 2015 at 7:40 PM, Mário Idival <[email protected]> wrote:

> Does anyone have any concrete example of how to work perfectly Pyramid+
> SqAlchemy Alembic?
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pylons-discuss.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vincent Catalano
Software Engineer and Web Developer,
(520).603.8944

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to