tags:

views:

23

answers:

1

Hi, I have this domain class:

class Requestmap {

    String url
    String configAttribute

    static constraints = {
        url(blank: false, unique: true)
    configAttribute(blank: false)
    }
}

Its DB Table corresponds to

      Column      |          Type          | Modifiers 
------------------+------------------------+-----------
 id               | bigint                 | not null
 version          | bigint                 | not null
 config_attribute | character varying(255) | not null
 url              | character varying(255) | not null
Indexes:
    "requestmap_pkey" PRIMARY KEY, btree (id)
    "requestmap_url_key" UNIQUE, btree (url)

The question is: Is there a way for GORM to force the column creation order in the table ? I need url to be the third column and config_attribute the fourth (DB restore reasons).

Thanks

A: 

At least a workaround: use 'grails schema-export' to generate a DDL file (target/ddl.sql), modify that manually and apply it to the DB.

Stefan