Changelog.groovy changelog not found

I created a new Grails project in IntellijIDEA 11.1.3 and try to run it.

When I open http://localhost:8080/application/dbdoc (access to the grails.plugin.databasemigration.DbdocController controller default grails.plugin.databasemigration.DbdocController ), I continue to receive the message:

 Changelog changelog.groovy not found 

Although the changelog.groovy file exists on the file system of my project in the ./grails-app/migrations folder. I created it using the command:

 grails dbm-create-changelog changelog.groovy 

And now it has the following content:

 databaseChangeLog = { changeSet(author: "Edward (generated)", id: "changelog") { // TODO add changes and preconditions here } } 

What do I need to do to make it work?

+6
source share
1 answer

I am also running IntelliJ 11.1.3. I am working with Grails 2.1 and database-migration:1.1 .

The database migration plugin is used to create Groovy change lists that can be used to migrate the database at point X over time to be compatible with the new code changes you have made to your Grails application.

For example, if your Grails application is in production today, with your domain classes, tables, etc., and you run grails dbm-create-changelog changelog.groovy , this will give you a basic replacement for the changelog.groovy script. Then you should run grails dbm-changelog-sync to indicate that you are updated.

Let's say that you added new domain classes and changed fields to existing ones. If you saved your changes and ran grails dbm-update , the Database Migration plugin will update your database schema based on these change sets.

Here is a great tutorial (not mine) that I read / follow to learn more about the database migration plugin: Tutorial on connecting Grails DB-Migration modules

+6
source

Source: https://habr.com/ru/post/923246/


All Articles