dataSource:
pooled: true
jmxExport: true
driverClassName: org.h2.Driver
username: sa
password:
dbCreate: none
url: jdbc:h2:file:./multipleFirstDb
logSql: true
formatSql: true
dataSources:
second:
pooled: true
jmxExport: true
driverClassName: org.h2.Driver
username: sa
password:
dbCreate: none
url: jdbc:h2:file:./multipleSecondDb
3 Configuration
Version: 6.3.0-SNAPSHOT
3 Configuration
There are a few configuration options for the plugin. All configurations are prefixed with grails.plugin.databasemigration
:
Property | Default | Meaning |
---|---|---|
changelogLocation |
|
the folder containing the main changelog file (which can include one or more other files) |
changelogFileName |
|
the name of the main changelog file |
changelogProperties |
none |
a map of properties to use for property substitution in Groovy DSL changelogs |
contexts |
none |
A comma-delimited list of context names. If specified, only changesets tagged with one of the context names will be run |
dbDocLocation |
|
the directory where the output from the dbm-db-doc script is written |
dbDocController.enabled |
|
whether the /dbdoc/ url is accessible at runtime |
dropOnStart |
|
if |
updateOnStart |
|
if |
updateOnStartFileName |
none |
the file name (relative to |
updateOnStartDefaultSchema |
none |
the default schema to use when running auto-migrate on start |
updateOnStartContexts |
none |
A comma-delimited list of context names. If specified, only changesets tagged with one of the context names will be run |
updateAllOnStart |
false |
if |
autoMigrateScripts |
['RunApp'] |
the scripts when running auto-migrate. Useful to run auto-migrate during test phase with: ['RunApp', 'TestApp'] |
excludeObjects |
none |
A comma-delimited list of database object names to ignore while performing a dbm-gorm-diff or dbm-generate-gorm-changelog |
includeObjects |
none |
A comma-delimited list of database object names to look for while performing a dbm-gorm-diff or dbm-generate-gorm-changelog |
databaseChangeLogTableName |
'databasechangelog' |
the Liquibase changelog record table name |
databaseChangeLogLockTableName |
'databasechangeloglock' |
the Liquibase lock table name |
All the above configs can be used for multiple datasources |
Multiple DataSource Example:
If secondary dataSource named "second" is configured in application.yml
The configuration for this data source would be:
grails.plugin.databasemigration.reports.updateOnStart = true
grails.plugin.databasemigration.reports.changelogFileName = changelog-second.groovy
The configuration for all data sources with same db schema would be:
grails.plugin.databasemigration.updateAllOnStart = true
grails.plugin.databasemigration.changelogFileName = changelog.groovy