Skip to content

ryarnyah/dblock-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

DBLock Version: 0.4.0

DBLock Backwards Compatibility Check Maven Plugin

The dblock-maven-plugin plugin is a Maven plugin to run a backwards compatibility check SQL databases. The plugin can be integrated after database schema update. After first execution, then plugin generate a db.lock file and check againts it for the nexts.

It is also possible to force any breaking changes and reset the current state by deleting or altering the db.lock file. It will then reinitialize the next time the plugin is run.

Maintaining Backwards Compatibility

In order to maintain backwards compatibility for your databases, a few rules must be followed when making updates. Please refer here to avoid breaking changes: https://github.com/ryarnyah/dblock/blob/master/README.md

Usage

<build>
    <plugins>
        <plugin>
            <groupId>com.github.ryarnyah</groupId>
            <artifactId>dblock-maven-plugin</artifactId>
            <version>1.0.0</version>
            <configuration>
                <databaseType>POSTGRES</databaseType>
                <databaseSchemaRegex>public</databaseSchemaRegex>
                <databaseConnInfo>host=localhost port=5432 user=postgres dbname=test sslmode=disable password=postgres</databaseConnInfo>
                <databaseLockFile>.dblock.lock</databaseLockFile>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>backwards-compatibility-check</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Configuration

  • <databaseType> (default to POSTGRES) - must be a value of POSTGRES, MYSQL, MSSQL.
  • <databaseSchemaRegex> (default to .*) - regex to match schema(s) to check.
  • <databaseConnInfo> (empty) - Database connetion info (See https://github.com/ryarnyah/dblock/blob/master/README.md for format)
  • <databaseLockFile> (default to db.lock) - File path to lock file.