com.github.spt-oss:flyway-plus

Custom implementation for Flyway

License

License

Categories

Categories

Flyway Data Databases
GroupId

GroupId

com.github.spt-oss
ArtifactId

ArtifactId

flyway-plus
Last Version

Last Version

5.1.4.0
Release Date

Release Date

Type

Type

jar
Description

Description

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-plus

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
org.flywaydb : flyway-core jar 5.1.4
org.springframework.boot : spring-boot-autoconfigure Optional jar 2.0.5.RELEASE

provided (1)

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

test (3)

Group / Artifact Type Version
com.h2database : h2 jar 1.4.197
org.springframework.boot : spring-boot-starter-jdbc jar 2.0.5.RELEASE
org.springframework.boot : spring-boot-starter-test jar 2.0.5.RELEASE

Project Modules

There are no modules declared in this project.

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.1.4.0
4.2.0.0
0.4.3
0.4.2
0.4.1
0.4.0
0.3.0
0.2.1
0.2.0
0.1.1
0.1.0