I have an applicaton that contains some tables that are auto-generated from Grails domain classes and one legacy table (say table legacy) that have been created outside of Grails but are being mapped by Grails domain classes. Mapping the columns in the legacy database is trivial, but I would like to disable the adding of extra fields and indexes that Grails tries to take care of for said table.
My question is: How do I instruct Grails not to make any table changes to the legacy table (changes such as adding indexes, foreign keys, version columns, etc.)?
Please note that I do not want to disable the automatic schema generation/updating for all tables, only for the mapped table legacy.
The only way I’ve been able to do stuff like this is a custom Configuration class:
Put this in src/java (it can’t be written in Groovy because of a weird compilation error) and register it in DataSource.groovy using the ‘configClass’ attribute: