autogenerate not work as expected.

20 views
Skip to first unread message

Mário Idival

unread,
Jul 20, 2015, 4:47:17 PM7/20/15
to sqlalchem...@googlegroups.com

Pyramid I use for web development and would like to use with the alembic for migrations from my database.

I started a project using the scaffold `alchemy` where` Base` class that is used as `declarative_base` is within the` models.py` file. My problem is this: `--autogenerate` to work properly, I have to keep my models in the` models.py` file, if I separate them, it's like the alembic or sqlalchemy did not find them, or it does not. Someone had any problem with this?

ps: already I put my `` Base.metadata` in env.py`.

Mike Bayer

unread,
Jul 20, 2015, 5:13:13 PM7/20/15
to sqlalchem...@googlegroups.com
make sure that when env.py runs, it does an "import" that ensures that all modules are imported.   you can put them in as many files as you want but they all must be imported, usually in a cascading module pattern, in order for the class definitions within them to be seen by your Python interpreter and thus be created as classes with table and mapping information.






--
You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-alem...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mário Idival

unread,
Jul 20, 2015, 5:41:34 PM7/20/15
to sqlalchem...@googlegroups.com
Hm, Thank you Mike o/

Mário Idival
Python Developer

Twitter|Github|Skype : marioidival
Facebookmario.idival
User Linux : #554446

--
You received this message because you are subscribed to a topic in the Google Groups "sqlalchemy-alembic" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sqlalchemy-alembic/tkkfz7bbARU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sqlalchemy-alem...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages