Ruta Deshpande
Ruta Deshpande

Reputation: 213

Update database through migrations but not delete any table in python

I have a PostgreSQL Database of 10 tables, but in python("flask_sqlalchemy") I have created only 5 models and skipped other 5 tables as that are not needed now. But when I try to update model and run migrations other 5 tables get deleted. Is it possible to skip or not delete 5 tables and update other tables? I am using "flask_migrate" package to perform migrations.

Upvotes: 0

Views: 167

Answers (1)

Miguel Grinberg
Miguel Grinberg

Reputation: 67479

You can use the include_object option to specify which tables you want Alembic to ignore. There is an example that is close to what you need in this other question.

Upvotes: 1

Related Questions