当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Sudo right raising
Leverage Google cloud infrastructure and landing area to build enterprise level cloud native excellent operation capability
BGP 路由优选规则和通告原则
Contest3147 - game 38 of 2021 Freshmen's personal training match_ E: Listen to songs and know music
浅谈三点建议为所有已经毕业和终将毕业的同学
程序员的自我修养—找工作反思篇
Generic classes and parameterized classes of SystemVerilog
深入学习JVM底层(二):HotSpot虚拟机对象
Hydration failed because the initial UI does not match what was rendered on the server.问题原因之一
LeetCode 47. Full arrangement II
CUDA中的动态全局内存分配和操作
TensorRT的命令行程序
Compte à rebours de 3 jours pour l'inscription à l'accélérateur de démarrage Google Sea, Guide de démarrage collecté à l'avance!
MySQL的10大经典错误
Ros2 --- lifecycle node summary
Summary of WLAN related knowledge points
Bgp Routing preference Rules and notice Principles
CUDA与Direct3D 一致性
TensorRT的功能
LeetCode 40. 组合总和 II