You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by ja...@apache.org on 2025/09/20 00:25:49 UTC
(grails-core) branch include-migrations-in-resources updated (13d0a63cb7 -> 58fc3abf72)
This is an automated email from the ASF dual-hosted git repository.
jamesfredley pushed a change to branch include-migrations-in-resources
in repository https://gitbox.apache.org/repos/asf/grails-core.git
from 13d0a63cb7 Add 'migrations' to grailsAppResourceDirs
new 054c0472a0 Update migration plugin resource handling and docs
new 58fc3abf72 Remove outdated Gradle sourceSets configuration instructions
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../command/DatabaseMigrationCommand.groovy | 5 +----
.../docs/asciidoc/databaseMigration/gettingStarted.adoc | 14 --------------
grails-doc/src/en/guide/upgrading/upgrading60x.adoc | 17 +++++++++++++++++
3 files changed, 18 insertions(+), 18 deletions(-)
(grails-core) 01/02: Update migration plugin resource handling and docs
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesfredley pushed a commit to branch include-migrations-in-resources
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 054c0472a061e6bf95f8d4f0086a2d2cc60e9c02
Author: James Fredley <ja...@users.noreply.github.com>
AuthorDate: Fri Sep 19 20:25:33 2025 -0400
Update migration plugin resource handling and docs
Changed DatabaseMigrationCommand to use only ClassLoaderResourceAccessor, removing FileSystemResourceAccessor for changelog location. Updated upgrade guide to note that adding 'grails-app/migrations' to the main sourceSet is no longer necessary, as it is now handled automatically by the Gradle plugin.
---
.../command/DatabaseMigrationCommand.groovy | 5 +----
grails-doc/src/en/guide/upgrading/upgrading60x.adoc | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/grails-data-hibernate5/dbmigration/src/main/groovy/org/grails/plugins/databasemigration/command/DatabaseMigrationCommand.groovy b/grails-data-hibernate5/dbmigration/src/main/groovy/org/grails/plugins/databasemigration/command/DatabaseMigrationCommand.groovy
index 9b05c64f23..5d6dea51be 100644
--- a/grails-data-hibernate5/dbmigration/src/main/groovy/org/grails/plugins/databasemigration/command/DatabaseMigrationCommand.groovy
+++ b/grails-data-hibernate5/dbmigration/src/main/groovy/org/grails/plugins/databasemigration/command/DatabaseMigrationCommand.groovy
@@ -199,10 +199,7 @@ trait DatabaseMigrationCommand {
}
ResourceAccessor createResourceAccessor() {
- new CompositeResourceAccessor(
- new FileSystemResourceAccessor(changeLogLocation),
- new ClassLoaderResourceAccessor())
-
+ new ClassLoaderResourceAccessor()
}
void withDatabase(Map<String, String> dataSourceConfig = null, @ClosureParams(value = SimpleType, options = 'liquibase.database.Database') Closure closure) {
diff --git a/grails-doc/src/en/guide/upgrading/upgrading60x.adoc b/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
index e24764b15e..df26d4e735 100644
--- a/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
+++ b/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
@@ -522,3 +522,20 @@ grails {
----
NOTE: Expanded class files & resource files will only be used over the jar file if the plugin applies the gradle plugin `org.apache.grails.gradle.grails-exploded` & the plugin is a subproject of your Gradle build.
+
+===== 12.22 Database Migration Plugin migrations directory in the main sourceSet
+
+It is no longer necessary to add the `grails-app/migrations` directory to the `main` sourceSet in order for the Database Migration Plugin to find your changelogs.
+This is now done automatically by the `org.apache.grails.gradle.grails-plugin` Gradle plugin.
+
+[source,groovy]
+.build.gradle
+----
+sourceSets {
+ main {
+ resources {
+ srcDir 'grails-app/migrations'
+ }
+ }
+}
+----
\ No newline at end of file
(grails-core) 02/02: Remove outdated Gradle sourceSets configuration instructions
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesfredley pushed a commit to branch include-migrations-in-resources
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 58fc3abf725676e350b1d537760e422688420b54
Author: James Fredley <ja...@users.noreply.github.com>
AuthorDate: Fri Sep 19 20:25:43 2025 -0400
Remove outdated Gradle sourceSets configuration instructions
Deleted instructions about configuring the migrations folder in Gradle, as this step is no longer necessary or relevant for Grails 4 and above.
---
.../docs/asciidoc/databaseMigration/gettingStarted.adoc | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/grails-data-hibernate5/docs/src/docs/asciidoc/databaseMigration/gettingStarted.adoc b/grails-data-hibernate5/docs/src/docs/asciidoc/databaseMigration/gettingStarted.adoc
index bb33aafbcd..3292fa7750 100644
--- a/grails-data-hibernate5/docs/src/docs/asciidoc/databaseMigration/gettingStarted.adoc
+++ b/grails-data-hibernate5/docs/src/docs/asciidoc/databaseMigration/gettingStarted.adoc
@@ -47,20 +47,6 @@ dependencies {
}
----
-You should also tell Gradle about the migrations folder. If using Grails 4 or above, make sure the configuration below is BEFORE the
-`dependencies` configuration, so that the `sourceSets` declaration takes effect.
-
-[source,groovy,subs="attributes"]
-----
-sourceSets {
- main {
- resources {
- srcDir 'grails-app/migrations'
- }
- }
-}
-----
-
*Typical initial workflow*
Next you'll need to create an initial changelog. You can use Liquibase XML or the plugin's Groovy DSL for individual files. You can even mix and match; Groovy files can include other Groovy files and Liquibase XML files (but XML files can't include Groovy files).