Changeset 1407


Ignore:
Timestamp:
Jan 18, 2011, 1:43:11 PM (9 years ago)
Author:
work@…
Message:
  • fixes an issue with database upgrade script
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/DatabaseUpgrade.groovy

    r1406 r1407  
    2929
    3030                // execute per-change check and upgrade code
    31                 changeStudyDescription(sql, db)                 // r1245 / r1246
    32                 changeStudyDescriptionToText(sql, db)   // r1327
    33                 changeTemplateTextFieldSignatures(sql, db) // prevent Grails issue, see http://jira.codehaus.org/browse/GRAILS-6754
     31                changeStudyDescription(sql, db)                         // r1245 / r1246
     32                changeStudyDescriptionToText(sql, db)           // r1327
     33                changeTemplateTextFieldSignatures(sql, db)      // prevent Grails issue, see http://jira.codehaus.org/browse/GRAILS-6754
    3434        }
    3535
     
    107107        /**
    108108         * it appears that some TEXT template fields are not of type 'text'
    109          * which results in the '255' character issue
     109         * due to an issue in how Grails' GORM works with domain inheritance
     110         * (see http://jira.codehaus.org/browse/GRAILS-6754)
    110111         * @param sql
    111112         * @param db
     
    119120                                try {
    120121                                        // change the datatype of text fields to text
    121                                         sql.execute("ALTER TABLE ${row.tablename.toString()} ALTER COLUMN template_text_fields_elt TYPE text")
    122                                         sql.execute("ALTER TABLE ${row.tablename.toString()} ALTER COLUMN template_text_fields_string TYPE text")
     122                                        sql.execute(sprintf("ALTER TABLE %s ALTER COLUMN template_text_fields_elt TYPE text", row.tablename))
     123                                        sql.execute(sprintf("ALTER TABLE %s ALTER COLUMN template_text_fields_string TYPE text", row.tablename))
    123124
    124125                                } catch (Exception e) {
Note: See TracChangeset for help on using the changeset viewer.