Giter VIP home page Giter VIP logo

grails-database's Introduction

A script for Grails application to apply and revert a database patches.

Setup
-----

Copy database.groovy script to the scripts/ directory of grails project.
Recreate a patch directory structure like this:
your-project/
    db/
	patch/
	    v0.1/
        	01_PatchA.sql
        	01_PatchA_revert.sql
        	02_PatchB_dev.sql
        	02_PatchB_revert_dev.sql

Environments
------------
Supports two different environments:
 * dev - development and staging environment,
 * prod - production environment

To create a different patches for environments, just end the patch name with an appropriate suffix, like:
 * 01_UserData_dev.sql and 01_UserData_revert_dev.sql
 * 01_UserData_prod.sql and 01_UserData_revert_prod.sql

Such it is possible to have different data in dev and production databases.

Command usage format:
$ grails database <action> <args>

View help:
$ grails database help

Apply patches from specified version:
$ grails database apply dev 0.2

Apply all patches:
$ grails database apply all

Recreate database completely:
$ grails database repatch dev all

Revert changes from version 0.2 and then re-apply them again:
$ grails database repatch dev 0.2

grails-database's People

Contributors

rkhmelyuk avatar

Stargazers

 avatar

Watchers

 avatar James Cloos 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.