Changeset 2228
- Timestamp:
- May 8, 2012, 4:57:55 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/application.properties
r2226 r2228 12 12 plugins.crypto=2.0 13 13 plugins.famfamfam=1.0.1 14 plugins.gdt=0.2. 014 plugins.gdt=0.2.1 15 15 plugins.gdtimporter=0.4.6.7 16 16 plugins.grails-melody=1.11 -
trunk/grails-app/conf/dbnp/configuration/DatabaseUpgrade.groovy
r2089 r2228 43 43 // GdtImporter now by default uses 'columnindex' as domain field name 44 44 fixShibbolethSecUser(sql, db) // fix shibboleth user 45 changeOntologyDescriptionType(sql, db) // change ontology description type to text 45 46 } 46 47 … … 426 427 } 427 428 } 429 430 /** 431 * Make sure the ontology's description is of type text instead of varchar 432 * @param sql 433 * @param db 434 */ 435 public static void changeOntologyDescriptionType(sql, db) { 436 // are we running postgreSQL? 437 if (db == "org.postgresql.Driver") { 438 if (sql.firstRow("SELECT * FROM information_schema.columns WHERE columns.table_name='study' AND columns.column_name='code' AND columns.data_type='character varying'")) { 439 if (String.metaClass.getMetaMethod("grom")) "performing database upgrade: change ontology description type".grom() 440 441 try { 442 // change the datatype of the ontology's description to text 443 sql.execute("ALTER TABLE ontology ALTER COLUMN description TYPE text") 444 } catch (Exception e) { 445 println "changeOntologyDescriptionType database upgrade failed: " + e.getMessage() 446 } 447 } 448 } 449 } 428 450 }
Note: See TracChangeset
for help on using the changeset viewer.