I have a Flask project with MySQL database and uses SQLAlchemy as ORM and Flask-Migrate*for migrations.
I wrote my models and when I run the migrations, migration file is empty because existing tables are out of Flask-Migrate's control so I actually have to delete those tables to let migration tool to detect and create them again. But the problem is that I do not want to delete and create my tables.
So is there a way that I can sync my model with my existing table ?
EDIT : I just found out that in env.py file, it's possible to specify tables that exists and it will not create those tables :
metadata.reflect(engine, only=["table1", "table2"])
Thanks for the answer.