Changeset 1249


Ignore:
Timestamp:
Dec 9, 2010, 4:17:40 PM (7 years ago)
Author:
work@…
Message:
  • finalizing database upgrade script with delete statements
File:
1 edited

Legend:

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

    r1248 r1249  
    2020         */
    2121        public static void handleUpgrades(dataSource) {
    22                 // gromming debug message
    23                 "handeling database upgrades".grom()
    24 
    2522                // get a sql instance
    2623                groovy.sql.Sql sql = new groovy.sql.Sql(dataSource)
    2724
    28                 // check for study description change from template
    29                 // to required domain field (r1245 and r1246)
    30                 changeStudyDescription(sql)
     25                // execute per-change check and upgrade code
     26                changeStudyDescription(sql)                     // r1245 / r1246
    3127        }
    3228
     
    4339                        // database upgrade required
    4440                        try {
    45                                 println "PERFORMING DATABASE UPGRADE!!!"
    4641                                // get the template field id
    4742                                def id = sql.firstRow("SELECT id FROM template_field WHERE templatefieldentity='dbnp.studycapturing.Study' AND templatefieldname='Description'").id
     
    5954
    6055                                // delete all obsolete descriptions
    61                                 //sql.execute("DELETE FROM study_template_text_fields WHERE template_text_fields_idx='Description'")
     56                                sql.execute("DELETE FROM study_template_text_fields WHERE template_text_fields_idx='Description'")
    6257
    6358                                // and delete the obsolete template field
    64                                 //sql.execute("DELETE FROM template_field WHERE id=${id}")
     59                                sql.execute("DELETE FROM template_field WHERE id=${id}")
    6560                        } catch (Exception e) {
    6661                                "changeStudyDescription database upgrade failed: " + e.getMessage()
Note: See TracChangeset for help on using the changeset viewer.