[Flask] Add, Change and Delete Models during runtime with flask-sqlalchemy and flask-migrate

Alejo Arias alejoar at gmail.com
Sun May 15 04:58:40 EDT 2016


If you change the models you are basically changing the app code.

I don't think this would be possible, a restart is needed at some point to
acknowledge the new models. Even if you do the changes directly in the DB,
you'll start getting exceptions when the app tries to do stuff with things
that no longer exist in your new models.

What's the purpose of this?
On May 15, 2016 04:31, "Patrick Rieser" <zufaellig at outlook.com> wrote:

Hello everybody,

so I try to add, change and delete Models during runtime with
flask-sqlalchemy and flask-migrate . To do that I plan to
write/change/delete the mymodel.py file, create the migration script and
then do the migration. So far so good. The problem is that I don't know
what internally happens in Flask and flask-sqlalchemy. I guess that there
is at least some internal caching/dict to store additional information
(like class names, fields etc.) that should be added/changed/cleared
accordingly. Does anybody have any clue about this? Any help is greatly
appreciated!


With kind regards,
Patrick

_______________________________________________
Flask mailing list
Flask at python.org
https://mail.python.org/mailman/listinfo/flask
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160515/f19d8d29/attachment.html>


More information about the Flask mailing list