Closed jmiranda closed 10 years ago
Install database migration plugin Add the following runtime plugin dependency to BuildConfig.groovy
plugins { ... runtime ':database-migration:1.3.8' ... }
Configure plugin to run new migrations on startup
grails.plugin.databasemigration.updateOnStart = true grails.plugin.databasemigration.updateOnStartFileNames = ["changelog.groovy"]
Generate initial changelog The following is a simplified version of the command. I actually move the generated changelog.groovy file into a file called create-schema.groovy and included that file within the changelog.groovy file.
changelog.groovy
create-schema.groovy
$ grails dbm-gorm-diff changelog.groovy
Ensure that the database engine is set to InnoDB
mysql> show table status;
Fixed
Install database migration plugin Add the following runtime plugin dependency to BuildConfig.groovy
Configure plugin to run new migrations on startup
Generate initial changelog The following is a simplified version of the command. I actually move the generated
changelog.groovy
file into a file calledcreate-schema.groovy
and included that file within thechangelog.groovy
file.Ensure that the database engine is set to InnoDB