====== LiquiBase Grails Integration ====== LiquiBase can be used as a [[http://grails.codehaus.org/|Grails]] plug-in. To install, simply run grails install-plugin liquibase and create your [[databasechangelog|change log XML file]] in grails-app/migrations/changelog.xml Run the following command in your project folder to install LiquiBase plugin: ''grails install-plugin liquibase'' To run any command, simply execute ''grails '' in root folder of your project. ===== Is there a non-XML way to write change logs? ===== Currently not, althouh we are working on a LiquiBase domain specific language alternative to XML. If you really don't like working with XML, you may want to look at the [[../ide/home|LiquiBase IDE or Eclipse Plugin]] ===== Update/Rollback Commands ===== ^ migrate | Updates database to current version | ^ migrate-sql | Writes SQL to update database to current version to STDOUT | ^ migrate-count | Applies changes to the database | ^ migrate-count-sql | Writes SQL to apply the next changes to STDOUT | ^ rollback | Rolls back the database to the the state is was when the tag was applied | ^ rollback-sql | Writes SQL to roll back the database to that state it was in when the tag was applied to STDOUT | ^ rollback-count | Rolls back the last change sets applied to the database | ^ rollback-count-sql | Writes SQL to roll back the last change sets to STDOUT applied to the database | ^ rollback-to-date | Rolls back the database to the the state is was at the given date/time. Date Format: yyyy-MM-dd HH:mm:ss | ^ rollback-to-date-sql | Writes SQL to roll back the database to that state it was in at the given date/time version to STDOUT | ^ future-rollback-sql | Writes SQL to roll back the database to the current state after the changes in the changelog have been applied | ===== Misc Commands ===== ^ db-doc | Generates Javadoc-like documentation based on current database and change log | ^ generate-changelog | Writes Change Log XML to copy the current state of the database to standard out | ===== Maintenance Commands ===== ^ tag | 'Tags' the current database state for future rollback | ^ changelog-sync-sql | Writes SQL to mark all changes as executed in the database to STDOUT | ^ clear-checksums | Removes all saved checksums from database log. Useful for 'MD5Sum Check Failed' errors | ^ drop-all | Drop all database objects owned by user | ^ list-locks | Lists who currently has locks on the database changelog | ^ release-locks | Releases all locks on the database changelog | ^ status | Outputs list of unrun changesets | ^ validate-changelog | Checks changelog for errors | ^ db-diff | Generate changeSet(s) to make Test DB match Development | ===== Version Naming Convention ===== The Grails plugin is versioned based off the core LiquiBase version. For example, a Grails plug-in version of "1.3.2.0" is the first Grails plug-in release based on the 1.3.2 version of LiquiBase. If there is a patch to the Grails plug-in, but not the core LiquiBase library, the version will change to "1.3.2.1".