当前位置:网站首页>Flask-Migrate 检测不到db.string() 等长度变化
Flask-Migrate 检测不到db.string() 等长度变化
2022-07-02 06:21:00 【zb0567】
修改migrations下的env.py 添加参数compare_type = True
context.configure(connection=connection,
target_metadata=target_metadata,
process_revision_directives=process_revision_directives,
compare_type = True, #compare_type默认为False,不检测数据变化
compare_server_default = True, #默认值
**current_app.extensions['migrate'].configure_args)
切记是在online里面,对应的第一个参数是connection
更新完成之后
python manage.py db migrate
python manage.py db upgrade
如果报错,在最上面里面添加
render_as_batch = True
然后删除versions下面所有的版本,如果报错,删除data==schemas==main==alembic_version对应的版本号
重新执行
python manage.py db migrate
python manage.py db upgrade
边栏推荐
猜你喜欢
In depth understanding of JUC concurrency (I) what is JUC
实习生跑路留了一个大坑,搞出2个线上问题,我被坑惨了
LeetCode 78. 子集
Learn about various joins in SQL and their differences
Data science [9]: SVD (2)
From design delivery to development, easy and efficient!
深入学习JVM底层(五):类加载机制
Data playback partner rviz+plotjuggler
Google play academy team PK competition, official start!
Summary of WLAN related knowledge points
随机推荐
Introduce two automatic code generators to help improve work efficiency
CUDA用户对象
利用传统方法(N-gram,HMM等)、神经网络方法(CNN,LSTM等)和预训练方法(Bert等)的中文分词任务实现
LeetCode 47. 全排列 II
Redis——大Key问题
Codeforces Round #797 (Div. 3) A—E
程序员的自我修养—找工作反思篇
Redis - big key problem
In depth understanding of JUC concurrency (I) what is JUC
Eco express micro engine system has supported one click deployment to cloud hosting
LeetCode 39. Combined sum
Frequently asked questions about jetpack compose and material you
Contest3147 - game 38 of 2021 Freshmen's personal training match_ 1: Maximum palindromes
Browser principle mind map
Use of Arduino wire Library
TensorRT的功能
Singleton mode compilation
Decryption skills of encrypted compressed files
深入学习JVM底层(二):HotSpot虚拟机对象
IPv6 experiment and summary