diff --git a/modules/Migration/schema/540_to_600RC.php b/modules/Migration/schema/540_to_600RC.php
index 2701ca42af5d1e3ead0533a369f4d9c4c8701e1d..4b36dbc63711b1a86c20a58a2b94c919c4744d37 100644
--- a/modules/Migration/schema/540_to_600RC.php
+++ b/modules/Migration/schema/540_to_600RC.php
@@ -697,9 +697,10 @@ Migration_Index_View::ExecuteQuery('UPDATE vtiger_field SET presence = 1 WHERE t
 
 Migration_Index_View::ExecuteQuery('UPDATE vtiger_users SET truncate_trailing_zeros = ?', array(1));
 
-//deleted the id column from the All filter
+//deleted the id column from the All filter (exclude custom modules)
 Migration_Index_View::ExecuteQuery("DELETE FROM vtiger_cvcolumnlist WHERE cvid IN
-			(SELECT cvid FROM vtiger_customview WHERE viewname='All' AND entitytype NOT IN
+			(SELECT cvid FROM vtiger_customview INNER JOIN vtiger_tab ON vtiger_tab.name=vtiger_customview.entitytype
+				WHERE vtiger_tab.customized=0 AND viewname='All' AND entitytype NOT IN
 				('Emails','Calendar','ModComments','ProjectMilestone','Project','SMSNotifier','PBXManager','Webmails'))
 			AND columnindex = 0", array());
 
@@ -2501,4 +2502,4 @@ Migration_Index_View::ExecuteQuery("CREATE TABLE IF NOT EXISTS vtiger_faqcf (
                                 faqid int(19), 
                                 PRIMARY KEY (faqid), 
                                 CONSTRAINT fk_1_vtiger_faqcf FOREIGN KEY (faqid) REFERENCES vtiger_faq(id) ON DELETE CASCADE 
-                ) ENGINE=InnoDB DEFAULT CHARSET=utf8", array()); 
\ No newline at end of file
+                ) ENGINE=InnoDB DEFAULT CHARSET=utf8", array());