Monday, 15 July 2013

gorm - Grails db migration not being applied -



gorm - Grails db migration not being applied -

i using grails 2.4.3 , database-migration:1.4.0 plugin.

i have created simple domain class called mod. able create groovy based changelog using dbm-generate-gorm-changelog changelog.groovy. correctly generates file. execute dbm-update reports:

|starting dbm-update database sa @ jdbc:h2:mem:devdb;mvcc=true;lock_timeout=10000 |finished dbm-update

however, there no table created in database , running dvm-status returns:

|starting dbm-status database sa @ jdbc:h2:mem:devdb;mvcc=true;lock_timeout=10000;db_close_on_exit=false 1 alter sets have not been applied sa@jdbc:h2:mem:devdb changelog.groovy::1413897188349-1::clarkrichey (generated) |finished dbm-status

my development environment configuration datasource.groovy follows:

development { datasource { // dbcreate = "create-drop" // 1 of 'create', 'create-drop', 'update', 'validate', '' url = "jdbc:h2:mem:devdb;mvcc=true;lock_timeout=10000;db_close_on_exit=false" } }

the issue centers around fact using in-memory instance of h2. thus, nil saved between application launches. if want persistent database alter url utilize file based instance.

development { datasource { dbcreate = "none" // 1 of 'create', 'create-drop', 'update', 'validate', '' url = "jdbc:h2:file:/path/to/save/to/devdb;mvcc=true;lock_timeout=10000;db_close_on_exit=false" } }

grails gorm

No comments:

Post a Comment