Hey everyone, how’s it going? specs: Grails: 4.1....
# questions
u
Hey everyone, how’s it going? specs: Grails: 4.1.3 java 8.0.452-tem I’m trying to implement the database-migration 4.1.0 plugin using this guide as an example: https://grails.github.io/grails-database-migration/4.0.0-RC1/index.html. Here are some of the configurations I’ve made:
Copy code
buildscript {
    repositories {
        ...
    }
    dependencies {
	...
        classpath 'org.grails.plugins:database-migration:4.1.0'
    }
}
...
sourceSets {
    main {
        resources {
            srcDir 'grails-app/migrations'
        }
    }
}

dependencies {
    ...

    implementation 'org.grails.plugins:database-migration:4.1.0'
    implementation 'org.liquibase:liquibase-core:4.19.0'
}
The folder structure is created correctly (
grails-app/migrations/changelog.groovy
), but even if it’s not, there are no failures in the build process, however, it just silently doesn’t run. Could anyone tell me what’s missing?
g
You need to manually execute the migrations tasks(some of them are listed in the document, others you can find out by look into the gradle view of intelliJ)
u
After running these tasks manually, will the automatic update on application start (
updateOnStart = true
) work as expected, or do I need to keep running them manually each time?
a
The migrations do not run as part of the Build process. They either run by manually invoking them or at application startup when you have
updateOnStart=true
. We put a step in our CI build pipeline that invokes the migrations to validate that they are working correctly.
u
I realize I got confused, my intention is indeed to have the migrations run at application startup. With this configuration, it doesn’t seem to work.
u
When I use version 3.0.0, all
dbm
commands appear and work as expected. However, after upgrading to version 4.0.0, the
dbm
commands no longer show up.
s
Have you checked if 4.0.0 can be used with Grails 4.1.x?
u
I was basing my assumptions on the documentation I mentioned earlier, which even includes a section specific to Grails 4. This led me to believe that both versions were compatible. However, they are not. I downgraded to version 3.1.0, and it worked. Thanks everyone for your input and collaboration!
s
@User good that you got it working. Now I do need to mention, that Grails 4.1.x has been EOL for quite some time (6 years) ago https://endoflife.date/grails and that you really should consider moving to Grails 7
u
Yes, we are aware of this. It is a product with years of development, and we are carrying out a task force to migrate from Grails 2.5.6 to Grails 4.1.3, so that we can gradually evolve the product version.