I have a 9 character string I want to store in Postgresql (9.3) as character(9). Just as important, I want it to validate correctly if the database is correct, which is not happening. I am generating the schema using the Database Migration plugin, which uses Hibernate tools. Here's what I've tried so far:
static mapping = {
poleID column: "pole_id", sqlType: "character", length: 9
}
That is exactly how it is created in the DB, however when I do a dbm-gorm-diff, it tries to modify the column thusly:
changeSet(author: "phil (generated)", id: "1401652394765-3") {
modifyDataType(columnName: "pole_id", newDataType: "character", tableName: "unit")
}
You can see length is ignored. I also tried specifying it with:
static mapping = {
poleID column: "pole_id", sqlType: "character(9)"
}
Again, it tries to modify that column, which is already correct, to character(9). How do I specify the mapping so it sees that the DB is already correct?