You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2010/05/10 14:00:43 UTC

svn commit: r942714 - in /incubator/lcf/trunk: CHANGES.txt modules/framework/pull-agent/org/apache/lcf/crawler/repository/RepositoryHistoryManager.java

Author: kwright
Date: Mon May 10 12:00:42 2010
New Revision: 942714

URL: http://svn.apache.org/viewvc?rev=942714&view=rev
Log:
Double width of repohistory table activity type column, since activity types include output connection names now and 32 was too narrow.  Upgrade code has also been added.

Modified:
    incubator/lcf/trunk/CHANGES.txt
    incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/repository/RepositoryHistoryManager.java

Modified: incubator/lcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/CHANGES.txt?rev=942714&r1=942713&r2=942714&view=diff
==============================================================================
--- incubator/lcf/trunk/CHANGES.txt (original)
+++ incubator/lcf/trunk/CHANGES.txt Mon May 10 12:00:42 2010
@@ -22,3 +22,7 @@ $Id$
 (17) Rename lucene connector in svn to be SOLR connector.
 (18) Add eol-style and keywords "Id" properties, where appropriate.
 
+5/10/2010, 07:58 EDT
+
+- Schema change to the repohistory table; the activitytype column was too narrow
+  to contain both a 32-character connection name and an activity string.

Modified: incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/repository/RepositoryHistoryManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/repository/RepositoryHistoryManager.java?rev=942714&r1=942713&r2=942714&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/repository/RepositoryHistoryManager.java (original)
+++ incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/repository/RepositoryHistoryManager.java Mon May 10 12:00:42 2010
@@ -74,7 +74,7 @@ public class RepositoryHistoryManager ex
         map.put(startTimeField,new ColumnDescription("BIGINT",false,false,null,null,false));
         map.put(endTimeField,new ColumnDescription("BIGINT",false,false,null,null,false));
         map.put(dataSizeField,new ColumnDescription("BIGINT",false,false,null,null,false));
-        map.put(activityTypeField,new ColumnDescription("VARCHAR(32)",false,false,null,null,false));
+        map.put(activityTypeField,new ColumnDescription("VARCHAR(64)",false,false,null,null,false));
         map.put(entityIdentifierField,new ColumnDescription("LONGTEXT",false,false,null,null,false));
         map.put(resultCodeField,new ColumnDescription("VARCHAR(255)",false,true,null,null,false));
         map.put(resultDescriptionField,new ColumnDescription("LONGTEXT",false,true,null,null,false));
@@ -82,7 +82,14 @@ public class RepositoryHistoryManager ex
       }
       else
       {
-        // Upgrade code, if needed.
+        // Upgrade code.
+	ColumnDescription cd = (ColumnDescription)existing.get(activityTypeField);
+	if (cd.getTypeString().toUpperCase().equals("VARCHAR(32)"))
+	{
+	  HashMap alterMap = new HashMap();
+	  alterMap.put(activityTypeField,new ColumnDescription("VARCHAR(64)",false,false,null,null,false));
+	  performAlter(null,alterMap,null,null);
+	}
       }
 
       // Index management