python orm数据库之 SQLAlchemy 版本迁移的使用

原文链接:

https://www.jianshu.com/p/d878cec71753

 

步骤:

1.  pip install alembic

2.迁移命令:

1.alembic revision --autogenerate -m "create_user_table"

2.alembic upgrade head

 

记录坑一:

 

 数据库链接得指定charset=utf-8,否则报unicodeError

posted @ 2021-06-07 17:14  风中飞儿  阅读(110)  评论(0编辑  收藏  举报