It seems like either I have managed to disable the constraints on domain classes or Grails 1.2 M4 is not working correctly. But I can pretty much create a blank record for any kind of domain classes, e.g., TekEvent, TekUser etc. Does anyone know what could be wrong? Bharat
I haven’t tried starting from scratch with Grails 1.2 yet, but will shortly.
One thought comes to mind though. Grails will not change the constraints on an existing table/column if there is a chance that it could cause data loss or leave data in an invalid state. So, for example, if you create a domain class with nullalbe:true and then later change it to nullable:false, it won’t make that change unless you drop and recreate the corresponding table. Not sayin that this is the situation you are in, but it might give you some ideas of things to look at.
Are you using a database (MySQL, PostgreSQL, etc.) or the in-memory HSQL DB?
“So, for example, if you create a domain class with nullalbe:true and then later change it to nullable:false, it won’t make that change unless you drop and recreate the corresponding table.”
That was the problem. Thanks. I am using MySQL.
using 1.2, i was able to create tek events with a blank name or city. explicitly adding (nullable:false,blank:false) fixed this.