Flyway Plus

Custom implementation for Flyway

License

License

Categories

Categories

Flyway Data Databases
GroupId

GroupId

com.github.spt-oss
ArtifactId

ArtifactId

flyway-parent
Last Version

Last Version

5.2.4.0
Release Date

Release Date

Type

Type

pom
Description

Description

Flyway Plus
Custom implementation for Flyway
Project URL

Project URL

https://github.com/spt-oss/flyway-plus
Project Organization

Project Organization

SPT
Source Code Management

Source Code Management

https://github.com/spt-oss/flyway-plus/tree/master

Download flyway-parent

How to add to project

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

Dependencies

provided (1)

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

Project Modules

  • flyway-core

Flyway Plus

circleci maven central javadoc

  • Custom implementation for Flyway
  • Note: This project is unofficial and experimental.

Products

  • CustomFlyway extends Flyway
    • Additional method: setPlaceholderReplacer(PlaceholderReplacer)
  • MysqlH2SqlReplacer implements PlaceholderReplacer
    • Replace MySQL-SQL to H2-SQL on migration

Usage

  1. Add a dependency in your project.

    <dependency>
        <groupId>com.github.spt-oss</groupId>
        <artifactId>flyway-core</artifactId>
        <version>5.2.4.0</version>
    </dependency>
  2. Create a subclass of PlaceholderReplacer. You can also use MysqlH2SqlReplacer.

    package my.project;
    
    import org.flywaydb.core.internal.util.placeholder.PlaceholderReplacer;
    
    public class MyPlaceholderReplacer implements PlaceholderReplacer {
        ......
    }
  3. Setup CustomFlyway instance.

    import java.sql.DataSource;
    import org.flywaydb.core.CustomFlyway;
    import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
    import my.project.MyPlaceholderReplacer;
    
    DataSource dataSource = DataSourceBuilder.create().url("jdbc:mysql://host:3306/db").build();
    
    CustomFlyway flyway = new CustomFlyway();
    flyway.setLocations("classpath:/data");
    flyway.setSchemas("foo", "bar");
    flyway.setDataSource(dataSource);
    flyway.setPlaceholderReplacer(new MyPlaceholderReplacer());
    flyway.migrate();

License

  • This software is released under the Apache License 2.0.
com.github.spt-oss

SPT

Open Source Libraries for Java

Versions

Version
5.2.4.0
5.1.4.1