Firstly, we deleted the database, and then launched our application using dbCreate="update"to create a good working database.
Then we ran:
grails dbm-generate-changelog baseline.xml
To create a script to create our schema. We removed dbCreate=xxxfrom DataSource.groovyand added the following to ours Config.groovy:
grails.plugin.databasemigration.updateOnStart = true
grails.plugin.databasemigration.updateOnStartFileNames = ['changelog.groovy']
Then we launched our application that created the database, this time from Liquibase, and everything was fine, what we thought about.
Then we did not change anything (no changes in the source code) and did not:
grails dbm-gorm-diff should_be_empty.xml --add
To our surprise, this generated 9 additional changeSets, all for indexes.
eg:
<changeSet author="me(generated)" id="1438097433176-1">
<createIndex indexName="site_id_uniq_1438097432189" tableName="adobe_message_service_config" unique="true">
<column name="site_id"/>
</createIndex>
</changeSet>
<changeSet author="me(generated)" id="1438097433176-4">
<createIndex indexName="IX_note_player" tableName="note">
<column name="player_id"/>
</createIndex>
</changeSet>
, ? , , 9 .
, , :
grails dbm-gorm-diff should_be_empty_this_time.xml --add
5 , , 9, . , , . , , changeSets , , dbm-generate-changelog
?