To rebuild the database using the migrate

When the database is not required (as shown in Table referential integrity, and physical integrity of the integrity of the user-defined time needs to be modified) (corresponding drop database), we can use migrate to rebuild the database, the database without the need to write native SQL statements to create the database.

1、python manage.py db init

2、python manage.py db migrate -m "initial migration"

3、python manage.py db upgrade

Look at this database, new data-dev.sqlite and migrations document describing the database have been rebuilt.

Guess you like

Origin blog.csdn.net/hrbust_cxl/article/details/89763784