开发者

DB column order creation in Grails

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: 开发者_StackOverflow中文版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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜