Flask管理数据库

Flask管理数据库

flask-migrate+flask-script

一、第一种方式

  1. 使用如下命令进入python shell

    python manage.py shell
    
  2. 输入指令即可,例如:

    db.drop_all()
    db.create_all()
    

二、第二种方式

直接使用指令,例如:

python3 manage.py db init
python3 manage.py db migrate
python3 mange.py db upgrade
python3 mange.py db --help
posted @ 2021-08-18 17:42  Dapeus  阅读(64)  评论(0)    收藏  举报