Index: lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/dbupdates/patch20140401.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/dbupdates/Attic/patch20140401.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/dbupdates/patch20140401.sql 2 Apr 2014 12:21:15 -0000 1.1 @@ -0,0 +1,45 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3123 Make all DB tables names to be lowercase +SELECT DATABASE() INTO @db_name FROM DUAL; + +SELECT Count(*) +INTO @exists +FROM information_schema.tables +WHERE table_schema = @db_name + AND table_type = 'BASE TABLE' + AND BINARY table_name = 'tl_laimag10_imageGallery'; + +SET @query = If(@exists>0, + 'RENAME TABLE tl_laimag10_imageGallery TO tl_laimag10_imagegallery', + 'SELECT \'nothing to rename\' status'); + +PREPARE stmt FROM @query; + +EXECUTE stmt; + + +SELECT Count(*) +INTO @exists +FROM information_schema.tables +WHERE table_schema = @db_name + AND table_type = 'BASE TABLE' + AND BINARY table_name = 'tl_laimag10_imageGallery_item'; + +SET @query = If(@exists>0, + 'RENAME TABLE tl_laimag10_imageGallery_item TO tl_laimag10_imagegallery_item', + 'SELECT \'nothing to rename\' status'); + +PREPARE stmt FROM @query; + +EXECUTE stmt; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/dbupdates/patch20140401.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/dbupdates/Attic/patch20140401.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/dbupdates/patch20140401.sql 2 Apr 2014 12:21:17 -0000 1.1 @@ -0,0 +1,45 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3123 Make all DB tables names to be lowercase +SELECT DATABASE() INTO @db_name FROM DUAL; + +SELECT Count(*) +INTO @exists +FROM information_schema.tables +WHERE table_schema = @db_name + AND table_type = 'BASE TABLE' + AND BINARY table_name = 'tl_laimsc11_commonCartridge'; + +SET @query = If(@exists>0, + 'RENAME TABLE tl_laimsc11_commonCartridge TO tl_laimsc11_commoncartridge', + 'SELECT \'nothing to rename\' status'); + +PREPARE stmt FROM @query; + +EXECUTE stmt; + + +SELECT Count(*) +INTO @exists +FROM information_schema.tables +WHERE table_schema = @db_name + AND table_type = 'BASE TABLE' + AND BINARY table_name = 'tl_laimsc11_commonCartridge_item'; + +SET @query = If(@exists>0, + 'RENAME TABLE tl_laimsc11_commonCartridge_item TO tl_laimsc11_commoncartridge_item', + 'SELECT \'nothing to rename\' status'); + +PREPARE stmt FROM @query; + +EXECUTE stmt; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dbupdates/patch20140401.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dbupdates/Attic/patch20140401.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dbupdates/patch20140401.sql 2 Apr 2014 12:21:13 -0000 1.1 @@ -0,0 +1,45 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3123 Make all DB tables names to be lowercase +SELECT DATABASE() INTO @db_name FROM DUAL; + +SELECT Count(*) +INTO @exists +FROM information_schema.tables +WHERE table_schema = @db_name + AND table_type = 'BASE TABLE' + AND BINARY table_name = 'tl_latask10_taskList'; + +SET @query = If(@exists>0, + 'RENAME TABLE tl_latask10_taskList TO tl_latask10_tasklist', + 'SELECT \'nothing to rename\' status'); + +PREPARE stmt FROM @query; + +EXECUTE stmt; + + +SELECT Count(*) +INTO @exists +FROM information_schema.tables +WHERE table_schema = @db_name + AND table_type = 'BASE TABLE' + AND BINARY table_name = 'tl_latask10_taskList_item'; + +SET @query = If(@exists>0, + 'RENAME TABLE tl_latask10_taskList_item TO tl_latask10_tasklist_item', + 'SELECT \'nothing to rename\' status'); + +PREPARE stmt FROM @query; + +EXECUTE stmt; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/patch20140401.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/Attic/patch20140401.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/patch20140401.sql 2 Apr 2014 12:21:11 -0000 1.1 @@ -0,0 +1,29 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3123 Make all DB tables names to be lowercase +SELECT DATABASE() INTO @db_name FROM DUAL; + +SELECT Count(*) +INTO @exists +FROM information_schema.tables +WHERE table_schema = @db_name + AND table_type = 'BASE TABLE' + AND BINARY table_name = 'tl_lavidr10_videoRecorder'; + +SET @query = If(@exists>0, + 'RENAME TABLE tl_lavidr10_videoRecorder TO tl_lavidr10_videorecorder', + 'SELECT \'nothing to rename\' status'); + +PREPARE stmt FROM @query; + +EXECUTE stmt; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file