Changeset 1689 for trunk/grails-app/conf/DatabaseUpgrade.groovy
- Timestamp:
- Apr 4, 2011, 11:54:25 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/DatabaseUpgrade.groovy
r1657 r1689 37 37 alterStudyAndAssay(sql, db) // r1594 38 38 fixDateCreatedAndLastUpdated(sql, db) 39 dropAssayModulePlatform(sql, db) // r1689 39 40 } 40 41 … … 283 284 } 284 285 } 286 287 288 /** 289 * drops the field platform from assay modules 290 * @param sql 291 * @param db 292 */ 293 public static void dropAssayModulePlatform(sql, db) { 294 // are we running postgreSQL? 295 if (db == "org.postgresql.Driver") { 296 // do we need to perform this update? 297 if (sql.firstRow("SELECT * FROM information_schema.columns WHERE columns.table_name='assay_module' AND columns.column_name='platform'")) { 298 if (String.metaClass.getMetaMethod("grom")) "performing database upgrade: removing assayModule platform".grom() 299 300 try { 301 sql.execute("ALTER TABLE assay_module DROP COLUMN platform") 302 } catch (Exception e) { 303 println "dropAssayModulePlatform database upgrade failed: " + e.getMessage() 304 } 305 } 306 } 307 } 285 308 }
Note: See TracChangeset
for help on using the changeset viewer.