This project allows for automated database migration to YDB, using the Flyway migration tool.
Flyway simplifies database migrations and provides version control for database schema changes, which is incredibly useful in team-based development environments.
- Support main Flyway commands:
migrate
,info
,repair
,validate
, andclean
- Safe when used in parallel
To use this YDB Flyway Dialect, you'll need:
- Java 17 or above
- YDB JDBC Driver
- Access to a YDB Database instance
- Flyway 10 or above
For Maven, add the following dependency to your pom.xml:
<!-- Set an actual versions -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway.core.version}</version>
</dependency>
<dependency>
<groupId>tech.ydb.jdbc</groupId>
<artifactId>ydb-jdbc-driver</artifactId>
<version>${ydb.jdbc.version}</version>
</dependency>
<dependency>
<groupId>tech.ydb.dialects</groupId>
<artifactId>flyway-ydb-dialect</artifactId>
<version>${flyway.ydb.dialect.version}</version>
</dependency>
For Gradle, add the following to your build.gradle (or build.gradle.kts):
dependencies {
// Set an actual versions
implementation "org.flywaydb:flyway-core:$flywayCoreVersion"
implementation "tech.ydb.dialects:flyway-ydb-dialect:$flywayYdbDialecVersion"
implementation "tech.ydb.jdbc:ydb-jdbc-driver:$ydbJdbcVersion"
}
Mac OS:
# install flyway
# $(which flyway)
cp flyway-ydb-dialect-${version-dialect}.jar ./libexec/lib
cp ydb-jdbc-driver-shaded-${version-jdbc}.jar ./libexec/drivers
Use this custom dialect just like any other Flyway dialect.
spring.datasource.url=jdbc:ydb:grpc://localhost:2136/local
An example of a simple Spring Boot Flyway can be found at the following link.
To understand what SQL constructs YDB can perform, see the documentation for the query language.
See connect to YDB.
For support, you can open issues in the repository issue tracker with tag flyway
.