Replies: 1 comment
-
Flask-Migrate requires that you use the Flask-SQLAlchemy or the Alchemical extensions. If you use SQLAlchemy directly, then use Alembic directly instead of Flask-Migrate. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
For some reason we thought it would be handy to separate our SQLAlchemy models from our Flask application so we could use the models also in other applications. The Flask app is the main user however, likely the only one so far. The declarative base works like a charm.
Is there a way to use Flask-Migrate for this? Since the models package has no idea where the database is located (or even what kind of database it is using) it is quite the challenge to point Alembic towards the correct database. On the other hand, the Models can change without (in theory) the application knowing about this, so creating migrations could be a challenge.
What have people tried in this situation, or should I just give up and merge both source trees (which my colleagues are not that positive on)?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions