I can’t figure how what the “standard practice” is for modifying a Domain Class after it has automatically created the corresponding database table.
There’s no “migration” in Grails, and there’s no way that I can find to tell it to output the new SQL it would generate so you can compare it to the previous table definition and manually issue your own ALTER TABLE command (that’s what I do in django).
I just got the book “The Definitive Guide to Grails” and it is silent on the subject, and I can’t find anything on the Grails website.
This is a weak point of grails and I don’t know a good way to deal with it. What I do is create a copy of the modified domain class, then compare the SQL schema of the table of the modified domain class to that generated by the copy of the domain class. Then you have to manually make what ever alterations are necessary to your original table. I’ve found that things such as relationships tend to change when the domain class does, but things such as adding a constraint to force a field to be a text type don’t always get changed…….