Search code examples
grailschangelog

does changing constraint of the domain not generate any new changelog lines?


I had first run the application with empty constraints for this domain. I decided on adding two constraints on "title" and "body" property. I then ran dbm-gorm-diff in grails console to generate the new changelog lines to append them to changelog file but no new changelog lines were generated so i was wondering if it is true in general that adding constraints to a domain will not generate any new changelog lines? I appreciate any help.

class Donation implements Serializable{

    String title
    String body
    Integer customDonationMin
    Integer customDonationMax   

    static mapping = {  

    }   

    static constraints = {

        title blank: false, nullable: false
        body blank: false, nullable: false      

    }


}

Solution

  • blank is just an in-memory constraint, but nullable does affect the database schema. But all domain class properties are not-null by default, so the reason there wasn't anything in the diff was that you didn't change anything that affected the schema.