Giter VIP home page Giter VIP logo

liquibase-sbt-plugin's Introduction

The liquibase-sbt-plugin is a plugin for the Simple Build Tool (SBT) for running LiquiBase commands.

Liquibase is a database-independent library for tracking, managing and applying database changes.

#Install#

The liquibase-sbt-plugin is not (yet) available in a public repository, so you have to build and install it yourself.

git clone git://github.com/sdb/liquibase-sbt-plugin.git
cd liquibase-sbt-plugin
sbt update
sbt publish-local

#Setup#

  1. Define a dependency on the liquibase-sbt-plugin in your plugin definition file, project/plugins.sbt

     addSbtPlugin("com.github.sdb" %% "liquibase-sbt-plugin" % "0.0.6")
    
  2. Configure the LiquibasePlugin in your project file, e.g. build.sbt

    liquibaseOptions := Map("dev" -> Seq( com.github.sdb.sbt.liquibase.LiquibaseConfiguration(changeLogFile = new java.io.File("config/db/changelog/db.changelog-master.xml"), url = "jdbc:mysql://localhost/database", driver ="com.mysql.jdbc.Driver", username = Some("sa"), password = Some(""), contexts = None, defaultSchemaName = None), com.github.sdb.sbt.liquibase.LiquibaseConfiguration(changeLogFile = new java.io.File("config/db/changelog/db2.changelog-master.xml"), url = "jdbc:mysql://localhost/database2", driver ="com.mysql.jdbc.Driver", username = Some("sa"), password = Some(""), contexts = None, defaultSchemaName = None)) , test -> .... )

    //Optional - to run before tests liquibaseTestConfig := Some("test")

#Usage#

The following actions are available:

  • liquibase update [config name]

    Applies un-run changes to the database.

  • liquibase update-count [config name] COUNT

    Applies the next number of change sets.

  • liquibase drop [config name] [SCHEMA]...

    Drops database objects owned by the current user.

  • liquibase tag [config name] TAG

    Tags the current database state for future rollback.

  • liquibase rollback [config name] TAG

    Rolls back the database to the state it was in when the tag was applied.

  • liquibase rollback-count [config name] COUNT

    Rolls back the last number of change sets.

  • liquibase rollback-date [config name] DATE

    Rolls back the database to the state it was in at the given date/time. The format of the date must match that of 'liquibaseDateFormat'.

  • liquibase validate [config name]

    Checks the changelog for errors.

  • liquibase clear-checksums [config name]

    Removes current checksums from database.

liquibase-sbt-plugin's People

Contributors

ericr3r avatar sdb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.