Changeset 2089
- Timestamp:
- Nov 7, 2011, 2:22:20 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/dbnp/configuration/DatabaseUpgrade.groovy
r1957 r2089 42 42 renameGdtMappingColumnIndex(sql, db) // 'index' column in GdtImporter MappingColumn is a reserved keyword in MySQL 43 43 // GdtImporter now by default uses 'columnindex' as domain field name 44 fixShibbolethSecUser(sql, db) // fix shibboleth user 44 45 } 45 46 … … 327 328 } catch (Exception e) { 328 329 println "dropAssayModulePlatform database upgrade failed: " + e.getMessage() 330 } 331 } 332 } 333 } 334 335 /** 336 * After adding shibboleth support, a boolean field should be set to false 337 * @param sql 338 * @param db 339 */ 340 public static void fixShibbolethSecUser(sql, db) { 341 if (db == "org.postgresql.Driver") { 342 // do we have shibboleth support available 343 if (sql.firstRow("SELECT * FROM information_schema.columns WHERE columns.table_name='sec_user' AND columns.column_name='shibboleth_user'")) { 344 // do we have null values? 345 if (sql.firstRow("SELECT * FROM sec_user WHERE shibboleth_user IS NULL")) { 346 // update null values to false 347 if (String.metaClass.getMetaMethod("grom")) "performing database upgrade: setting shibboleth boolean to false (default)".grom() 348 349 try { 350 sql.execute("UPDATE sec_user SET shibboleth_user='f' WHERE shibboleth_user IS NULL") 351 } catch (Exception e) { 352 println "fixShibbolethSecUser database upgrade failed: " + e.getMessage() 353 } 329 354 } 330 355 }
Note: See TracChangeset
for help on using the changeset viewer.