[jboss-svn-commits] JBL Code SVN: r23753 - labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Nov 6 07:22:48 EST 2008


Author: szimano
Date: 2008-11-06 07:22:47 -0500 (Thu, 06 Nov 2008)
New Revision: 23753

Modified:
   labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/migrate-custom.sql
   labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/migrate.sql
   labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/sedit.sh
Log:
no more procedures

Modified: labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/migrate-custom.sql
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/migrate-custom.sql	2008-11-06 12:07:56 UTC (rev 23752)
+++ labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/migrate-custom.sql	2008-11-06 12:22:47 UTC (rev 23753)
@@ -7,9 +7,16 @@
 -- 6) Fix posts modify date
 
 -- put forums
+SELECT j.lft INTO @count from ${CS}.jiveCommunity j WHERE j.name = "forum";
 insert into ${CS}.jiveCommunity 
 	(communityID, name, displayName, description, creationDate, modificationDate, lft, rgt, localeCode, workflowID, modDfltThreadVal, modDfltMsgVal, contentTypes) 
-	select n.forum_id, n.forum_name, n.forum_name, n.forum_desc, 0,0,1,6,NULL, -1,1,1,7 from ${NUKES3}.phpbb_forums n;
+	select n.forum_id, n.forum_name, n.forum_name, n.forum_desc, 0,0, at count:=@count+1, at count:=@count+1,NULL, -1,1,1,7 from nukes3.phpbb_forums n;
+	
+-- update forum rgt
+	update ${CS}.jiveCommunity SET rgt=@count:=@count+1 where ${CS}.jiveCommunity.name = "forum";
+	
+-- update main rgt
+	update ${CS}.jiveCommunity SET rgt=@count:=@count+1 where ${CS}.jiveCommunity.communityID = 1;
 
 
 -- put topics

Modified: labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/migrate.sql
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/migrate.sql	2008-11-06 12:07:56 UTC (rev 23752)
+++ labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/migrate.sql	2008-11-06 12:22:47 UTC (rev 23753)
@@ -1,17 +1,25 @@
 --How to
 -- 1) put forums
--- 2) Update forums number with procedure countForums(from, to)
 -- 3) Put topics(thread)
 -- 4) Check nonexisting users and migrate them
 -- 5) Get posts
 -- 6) Fix posts modify date
 
 -- put forums
+SELECT j.lft INTO @count from cs.jiveCommunity j WHERE j.name = "forum";
 insert into cs.jiveCommunity 
 	(communityID, name, displayName, description, creationDate, modificationDate, lft, rgt, localeCode, workflowID, modDfltThreadVal, modDfltMsgVal, contentTypes) 
-	select n.forum_id, n.forum_name, n.forum_name, n.forum_desc, 0,0,1,6,NULL, -1,1,1,7 from nukes3.phpbb_forums n;
+	select n.forum_id, n.forum_name, n.forum_name, n.forum_desc, 0,0, at count:=@count+1, at count:=@count+1,NULL, -1,1,1,7 from nukes3.phpbb_forums n;
+	
+-- update forum rgt
+	update cs.jiveCommunity SET rgt=@count:=@count+1 where cs.jiveCommunity.name = "forum";
+	
+-- update main rgt
+	update cs.jiveCommunity SET rgt=@count:=@count+1 where cs.jiveCommunity.communityID = 1;
 
+-- end put forums
 
+	
 -- put topics
 insert into cs.jiveThread
 	(threadID, containerType, containerID, rootMessageID, modValue, rewardPoints, creationDate, modificationDate, status)

Modified: labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/sedit.sh
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/sedit.sh	2008-11-06 12:07:56 UTC (rev 23752)
+++ labs/jbosslabs/trunk/portal-extensions/jboss-forums-migration/sedit.sh	2008-11-06 12:22:47 UTC (rev 23753)
@@ -3,4 +3,4 @@
 NUKES="s/\${NUKES3}/$2/g"
 
 sed $CS migrate-custom.sql | sed $NUKES > new_migrate.sql
-sed $CS procedure.sql > new_proc.sql
+




More information about the jboss-svn-commits mailing list