I am trying to move an already existing PHP application into grails.
I have created the domains based on the existing database and the code worked perfectly.
The issue arises when I need to add an additional boolean field in my domain.
I am getting the following error.
2014-06-10 16:24:54,146 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate - Unsuccessful: alter table entry add expedite tinyint not null
Error |
2014-06-10 16:24:54,163 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate - ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column 'expedite' cannot be added to non-empty table 'entry' because it does not satisfy these conditions.
I have tried to specify default values in the variable itself.
boolean expedite = false
I also tried to add default values in static mapping as below:
static mapping = {
table 'entry'
expedite defaultValue: false
version false
}
But still the error crops up. Any idea where I am going wrong? I am using sql server 2012.