Changeset 1404
- Timestamp:
- Jan 18, 2011, 10:52:46 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/DatabaseUpgrade.groovy
r1403 r1404 106 106 if (db == "org.postgresql.Driver") { 107 107 // check if any TEXT template fields are of type 'text' 108 sql.eachRow("SELECT columns.table_name FROM information_schema.columns WHERE columns.table_schema::text = 'public'::text AND column_name='template_text_fields_elt' AND data_type != 'text';")108 sql.eachRow("SELECT columns.table_name as tablename FROM information_schema.columns WHERE columns.table_schema::text = 'public'::text AND column_name='template_text_fields_elt' AND data_type != 'text';") 109 109 { row -> 110 "performing database upgrade: ${row.table _name} template_text_fields_string/elt to text".grom()110 "performing database upgrade: ${row.tablename} template_text_fields_string/elt to text".grom() 111 111 try { 112 112 // change the datatype of study::description to text 113 sql.execute("ALTER TABLE ${row.table _name} ALTER COLUMN template_text_fields_elt TYPE text")114 sql.execute("ALTER TABLE ${row.table _name} ALTER COLUMN template_text_fields_string TYPE text")113 sql.execute("ALTER TABLE ${row.tablename} ALTER COLUMN template_text_fields_elt TYPE text") 114 sql.execute("ALTER TABLE ${row.tablename} ALTER COLUMN template_text_fields_string TYPE text") 115 115 116 116 } catch (Exception e) {
Note: See TracChangeset
for help on using the changeset viewer.