How do I update the database and add new tables when a new data model is added to flask-sqlalchemy?

I generate database tables in the @ manager.shell command line of flask-script.

for example, before a model is User , when the table is generated for the first time:

db.create_all()

at this point, a user table is generated.

then add a new table called Post . If you don"t use flask-migrate, how can you update the database and let the database generate post tables?

Apr.11,2021

directly manipulate the database.

Menu