How to integrate existing database tables into a Flask app with SQLAlchemy and Flask-Migrate?

69 Views Asked by At

I'm building a Flask app using SQLAlchemy and Flask-Migrate for managing my database. Some of my tables were created by external scrapers outside of Flask. I need to integrate these tables into my Flask app so I can retrieve information from them. However, when I run migrations, the tables created outside of Flask are dropped from the database.

How can I make my Flask app aware of these existing tables and prevent them from being dropped during migrations?

Here's my current setup:

I have a Flask app using Flask-SQLAlchemy and Flask-Migrate for database management.
Some tables are created by external scrapers outside of Flask.
I want to use these existing tables in my Flask app and prevent them from being dropped during migrations.

I'd appreciate any help on how to achieve this. Thanks!

0

There are 0 best solutions below