flyway简单入门
flyway是一款数据库版本管理工具
1. 工作原理
flyway通过历史记录表(flyway_schema_history)来记录版本历史。每次随项目启动时将会自动扫描在resources/db/migration下的文件,并查询flyway_schema_history判断是否为新增文件?
- 如果是新增的文件,则执行该迁移文件
- 如果不是,则忽略该文件
flyway_schema_history的表结构:
create table flyway_schema_history
(
installed_rank int not null
primary key,
version varchar(50) null,
description varchar(200) not null,
type varchar(20) not null,
script varchar(1000) not null,
checksum int null,
installed_by varchar(100) not null,
installed_on timestamp default CURRENT_TIMESTAMP not null,
execution_time int not null,
success tinyint(1) not null
);
create index fly

本文介绍Flyway数据库版本管理工具的工作原理及如何在Spring Boot项目中整合使用。通过历史记录表跟踪版本变化,实现增量更新。
最低0.47元/天 解锁文章
4550

被折叠的 条评论
为什么被折叠?



