Flyway

Custom implementation of Flyway

License

License

Categories

Categories

Flyway Data Databases
GroupId

GroupId

com.github.bitmc
ArtifactId

ArtifactId

flyway-parent
Last Version

Last Version

7.4.0.0
Release Date

Release Date

Type

Type

pom
Description

Description

Flyway
Custom implementation of Flyway
Project URL

Project URL

https://github.com/bitmc/flyway
Project Organization

Project Organization

BITMC
Source Code Management

Source Code Management

https://github.com/bitmc/flyway

Download flyway-parent

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.bitmc/flyway-parent/ -->
<dependency>
    <groupId>com.github.bitmc</groupId>
    <artifactId>flyway-parent</artifactId>
    <version>7.4.0.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.bitmc/flyway-parent/
implementation 'com.github.bitmc:flyway-parent:7.4.0.0'
// https://jarcasting.com/artifacts/com.github.bitmc/flyway-parent/
implementation ("com.github.bitmc:flyway-parent:7.4.0.0")
'com.github.bitmc:flyway-parent:pom:7.4.0.0'
<dependency org="com.github.bitmc" name="flyway-parent" rev="7.4.0.0">
  <artifact name="flyway-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.bitmc', module='flyway-parent', version='7.4.0.0')
)
libraryDependencies += "com.github.bitmc" % "flyway-parent" % "7.4.0.0"
[com.github.bitmc/flyway-parent "7.4.0.0"]

Dependencies

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.16

Project Modules

  • flyway-core

Flyway

github actions maven central javadoc

  • Custom implementation of Flyway

Usage

  1. Add a dependency in your project.

    <dependency>
        <groupId>com.github.bitmc</groupId>
        <artifactId>flyway-core</artifactId>
        <version>7.4.0.0</version>
    </dependency>
  2. Implement SqlReplacer. You can also use MysqlH2SqlReplacer.

    package my.project;
    
    import org.flywaydb.core.internal.sqlscript.SqlReplacer;
    
    public class MySqlReplacer implements SqlReplacer {
        
        public String replace(String sql) {
            ......
        }
    }
  3. Setup CustomFlyway instance.

    import org.flywaydb.core.CustomFlyway;
    import org.flywaydb.core.Flyway;
    import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
    import my.project.MySqlReplacer;
    
    Flyway source = Flyway.configure()
        .locations("classpath:/data/migration")
        .schemas("example")
        .sqlMigrationPrefix("")
        .sqlMigrationSeparator("-")
        .dataSource(DataSourceBuilder.create().url("jdbc:h2:mem:test;MODE=MySQL;DATABASE_TO_UPPER=FALSE").build())
        .load();
    
    CustomFlyway flyway = new CustomFlyway(source, new MySqlReplacer());
    flyway.clean();
    flyway.migrate();

License

  • Apache License 2.0
com.github.bitmc

BITMC

Versions

Version
7.4.0.0
7.3.2.0
7.2.1.0
7.1.1.1
7.1.1.0