When changing a domain model, Grails automatically modifies the schema (including index / foreign key updates). This is usually normal, but when working with legacy databases, I would like to completely disable all table changes.
How do I prevent Grails from changing the table structure (including indexes and foreign key constraints)?
Here's how I set up the display now:
class ClassName { String string1 String string2 AnotherClass anotherClass static mapping = { version(false) table("legacy_table") string1(column: "some_legacy_field_1") string2(column: "some_legacy_field_2") anotherClass(column: "another_class_id", nullable: true, ignoreNotFound: true) } }
source share