You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/guide/generalUsage.adoc
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,10 +21,8 @@ You have a few options with `dbm-gorm-diff`:
21
21
22
22
Regardless of which approach you use, be sure to inspect generated changes and adjust as necessary.
23
23
24
-
25
24
=== Autorun on start
26
25
27
-
28
26
Since Liquibase maintains a record of changes that have been applied, you can avoid manually updating the database by taking advantage of the plugin's auto-run feature. By default this is disabled, but you can enable it by adding
@@ -20,8 +20,8 @@ It is also recommended to add a direct dependency to liquibase because Spring Bo
20
20
[source,groovy,subs="attributes"]
21
21
----
22
22
dependencies {
23
-
...
24
-
implementation 'org.liquibase:liquibase-core'
23
+
...
24
+
implementation 'org.liquibase:liquibase-core'
25
25
}
26
26
----
27
27
@@ -46,16 +46,17 @@ Next you'll need to create an initial changelog. You can use Liquibase XML or th
46
46
Depending on the state of your database and code, you have two options; either create a changelog from the database or create it from your domain classes. The decision tends to be based on whether you prefer to design the database and adjust the domain classes to work with it, or to design your domain classes and use Hibernate to create the corresponding database structure.
47
47
48
48
To create a changelog from the database, use the link:../ref/Rollback%20Scripts/dbm-generate-changelog.html[dbm-generate-changelog] script:
49
-
[source,groovy]
49
+
50
+
[source,console]
50
51
----
51
-
grace dbm-generate-changelog changelog.groovy
52
+
$ grace dbm-generate-changelog changelog.groovy
52
53
----
53
54
54
55
or
55
56
56
-
[source,groovy]
57
+
[source,console]
57
58
----
58
-
grace dbm-generate-changelog changelog.xml
59
+
$ grace dbm-generate-changelog changelog.xml
59
60
----
60
61
61
62
depending on whether you prefer the Groovy DSL or XML. The filename is relative to the changelog base folder, which defaults to `app/migrations`.
Since the database is already correct, run the link:../ref/Maintenance%20Scripts/dbm-changelog-sync.html[dbm-changelog-sync] script to record that the changes have already been applied:
70
-
[source,groovy]
71
+
[source,console]
71
72
----
72
-
grace dbm-changelog-sync
73
+
$ grace dbm-changelog-sync
73
74
----
74
75
75
76
Running this script is primarily a no-op except that it records the execution(s) in the Liquibase DATABASECHANGELOG table.
76
77
77
78
To create a changelog from your domain classes, use the link:../ref/Rollback%20Scripts/dbm-generate-gorm-changelog.html[dbm-generate-gorm-changelog] script:
NOTE: For the `dataSource` parameter, if the data source is configured as `reports` underneath the `dataSources` key in `application.[yml|groovy]`, the value should be `reports`.
Copy file name to clipboardExpand all lines: src/docs/ref/Diff Scripts/dbm-gorm-diff.adoc
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,9 @@ Doesn't modify any existing files - you need to manually merge the output into t
17
17
You can configure database objects to be ignored by this script - either in the GORM classes or in the target database. For example you may want domain objects that are transient, or you may have externally-managed tables, keys, etc. that you want left alone by the diff script. The configuration name for these ignored objects is `grails.plugin.databasemigration.ignoredObjects`, whose value is a list of strings.
NOTE: For the `dataSource` parameter, if the data source is configured as `reports` underneath the `dataSources` key in `application.[yml|groovy]`, the value should be `reports`.
Copy file name to clipboardExpand all lines: src/docs/ref/Documentation Scripts/dbm-db-doc.adoc
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ Generates Javadoc-like documentation based on current database and change log.
9
9
Writes to the folder specified by the `destination` parameter, or to the `grails.plugin.databasemigration.dbDocLocation` configuration option (defaults to `target/dbdoc`).
NOTE: For the `dataSource` parameter, if the data source is configured as `reports` underneath the `dataSources` key in `application.[yml|groovy]`, the value should be `reports`.
0 commit comments