barn

Quarkus barn is reactive database migration tool

License

License

Categories

Categories

Quarkus Container Microservices
GroupId

GroupId

org.lorislab.quarkus
ArtifactId

ArtifactId

barn
Last Version

Last Version

0.4.0
Release Date

Release Date

Type

Type

jar
Description

Description

barn
Quarkus barn is reactive database migration tool
Project Organization

Project Organization

lorislab

Download barn

How to add to project

<!-- https://jarcasting.com/artifacts/org.lorislab.quarkus/barn/ -->
<dependency>
    <groupId>org.lorislab.quarkus</groupId>
    <artifactId>barn</artifactId>
    <version>0.4.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.lorislab.quarkus/barn/
implementation 'org.lorislab.quarkus:barn:0.4.0'
// https://jarcasting.com/artifacts/org.lorislab.quarkus/barn/
implementation ("org.lorislab.quarkus:barn:0.4.0")
'org.lorislab.quarkus:barn:jar:0.4.0'
<dependency org="org.lorislab.quarkus" name="barn" rev="0.4.0">
  <artifact name="barn" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.lorislab.quarkus', module='barn', version='0.4.0')
)
libraryDependencies += "org.lorislab.quarkus" % "barn" % "0.4.0"
[org.lorislab.quarkus/barn "0.4.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.slf4j : slf4j-api jar
io.smallrye.reactive : smallrye-mutiny-vertx-sql-client jar

test (3)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar
org.junit.jupiter : junit-jupiter-engine jar
org.slf4j : slf4j-simple jar 1.7.30

Project Modules

There are no modules declared in this project.

Barn Quarkus extension

License GitHub Workflow Status (branch) GitHub release (latest SemVer) Maven Central

Barn Quarkus extension is database migration tool for the reactive database client. The naming convention for migration scripts is as in Flyway documentation. Supported are Versioned and Repeatable migration scripts.

Versioned Migrations

Example: V2__Add_new_table.sql

  • Prefix: V
  • Version: Version with dots separate as many parts as you like.
  • Separator: __ (two underscores)
  • Description: Underscores or spaces separate the words
  • Suffix: .sql

Repeatable Migrations

Repeatable migration will be executed only if checksum of the script change and there is new Versioned migration to run.

Example: R__Add_new_table.sql

  • Prefix: R
  • Separator: __ (two underscores)
  • Description: Underscores or spaces separate the words
  • Suffix: .sql

How to use it

Add maven dependency for your database pool:

  • org.lorislab.quarkus:barn-pg-client
  • org.lorislab.quarkus:barn-mysql-client

Create your database migration SQL scripts in the src/main/resources/db/migration directory.

+ src
   + main
      + resources
         + db
            + migration
               - V1.0_Create_tables.sql
               - V1.1_Add_search_index.sql
               - R__Update_descruption.sql

Add these properties to the applications.properties

# Clean schema before migration. Default: false
quarkus.barn.clean-at-start=true
# Start migration at start. Default: false
quarkus.barn.migrate-at-start=true
# Import test data after migration. Default: false 
quarkus.barn.test-data=true
# Test data scripts. Default: empty array
quarkus.barn.test-data-scripts=db/import/test1.sql,db/import/test2.sql

Postgres SQL reactive client

Maven dependency

<dependency>
    <groupId>org.lorislab.quarkus</groupId>
    <artifactId>barn-pg-client</artifactId>
    <version>{latest-release-version}</version>
</dependency>

Mysql reactive client

Maven dependency

<dependency>
    <groupId>org.lorislab.quarkus</groupId>
    <artifactId>barn-mysql-client</artifactId>
    <version>{latest-release-version}</version>
</dependency>
org.lorislab.quarkus

lorislab

Versions

Version
0.4.0
0.3.0
0.2.0
0.1.0