roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r574446 - in /roller/trunk/apps/weblogger: src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java src/sql/310-to-400-migration.vm web/WEB-INF/jsps/core/UpgradeDatabase.jsp
Date Tue, 11 Sep 2007 04:24:03 GMT
Author: snoopdave
Date: Mon Sep 10 21:24:00 2007
New Revision: 574446

URL: http://svn.apache.org/viewvc?rev=574446&view=rev
Log:
Fixes for http://opensource.atlassian.com/projects/roller/browse/ROL-1548

Multiple problems with database upgrade process, regression introduced by final changes to
bootstrapping process and last couple of features added in 4.0.

Upgrade from 2.0 to 4.0 tested with Derby
Need to test with PostgreSQL and retest with MySQL

Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java
    roller/trunk/apps/weblogger/src/sql/310-to-400-migration.vm
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/core/UpgradeDatabase.jsp

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java?rev=574446&r1=574445&r2=574446&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java
Mon Sep 10 21:24:00 2007
@@ -230,6 +230,10 @@
         return stackTrace;
     }
 
+    public boolean isUpgradeRequired() {
+        return WebloggerStartup.isDatabaseUpgradeRequired();
+    }
+        
     public boolean isError() {
         return error;
     }

Modified: roller/trunk/apps/weblogger/src/sql/310-to-400-migration.vm
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/sql/310-to-400-migration.vm?rev=574446&r1=574445&r2=574446&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/sql/310-to-400-migration.vm (original)
+++ roller/trunk/apps/weblogger/src/sql/310-to-400-migration.vm Mon Sep 10 21:24:00 2007
@@ -78,7 +78,7 @@
 -- better support for doing scheduled entries
 
 -- add new status option 'SCHEDULED' for future published entries
-update weblogentry set status = 'SCHEDULED', pubtime=pubtime, updatetime=updatetime where
pubtime > now();
+update weblogentry set status = 'SCHEDULED', pubtime=pubtime, updatetime=updatetime where
pubtime > current_timestamp;
 
 -- add new client column to roller_tasklock table
 #addColumnNull("roller_tasklock" "client" "varchar(255)")
@@ -124,42 +124,47 @@
 create index we_combo2_idx on weblogentry(websiteid, pubtime, status);
 create index co_combo1_idx on roller_comment(status, posttime);
 
+
 -- remove old indexes that are no longer of value
-drop index we_pubtime_idx on weblogentry;
-drop index we_pubentry_idx on weblogentry;
--- drop index co_pending_idx on roller_comment;
--- drop index co_approved_idx on roller_comment;
+#dropIndex('index_we_pubtime_idx' 'weblogentry')
+#dropIndex('we_pubentry_idx' 'weblogentry')
+-- #dropIndex('co_pending_idx' 'roller_comment')
+-- #dropIndex('co_approved_idx' 'roller_comment')
+
 
 -- fix wacky indexs which ended up with a size constraint
-drop index rage_sid_idx on rag_entry;
+#dropIndex('rage_sid_idx' 'rag_entry')
 create index rage_sid_idx on rag_entry(subscription_id);
-drop index raggs_gid_idx on rag_group_subscription;
+
+#dropIndex('raggs_gid_idx' 'rag_group_subscription')
 create index raggs_gid_idx on rag_group_subscription(group_id);
-drop index raggs_sid_idx on rag_group_subscription;
-create index raggs_sid_idx on rag_group_subscription(subscription_id);
 
+#dropIndex('raggs_sid_idx' 'rag_group_subscription')
+create index raggs_sid_idx on rag_group_subscription(subscription_id);
 
--- remove old usercookie table which has been unused since 0.x?
-drop table if exists usercookie;
 
--- remove old assoc tables which were EOLed in 3.2
-drop table if exists folderassoc;
-drop table if exists weblogcategoryassoc;
+-- remove no-longer-used needed tables
+#dropTableIfExists('usercookie')
+#dropTableIfExists('rag_config')
+#dropTableIfExists('folderassoc')
+#dropTableIfExists('weblogcategoryassoc')
 
 -- remove old rollerconfig table which has been deprecated since 1.2
 -- NOTE: since this breaks the pre-1.2 -> 4.0+ direct upgrade path then
---       maybe we want to attempt to fix that by doing that upgrade via sql?
-drop table if exists rollerconfig;
+-- maybe we want to attempt to fix that by doing that upgrade via sql?
+#dropTableIfExists('rollerconfig')
+
+--- remove old id column of group subscription table
+#dropColumn('rag_group_subscription' 'id')
 
 -- remove old approved, spam, pending columns from comment table
-alter table roller_comment drop column approved;
-alter table roller_comment drop column spam;
-alter table roller_comment drop column pending;
-
--- remove bastard columns from various tables
--- NOTE: these are only here as options, we don't *have* to do them
---alter table website drop column userid;
---alter table website drop column weblogdayid;
---alter table weblogentry drop column publishentry;
---alter table weblogentry drop column link;
+#dropColumn('roller_comment' 'approved')
+#dropColumn('roller_comment' 'spam')
+#dropColumn('roller_comment' 'pending')
+
+-- remove bastard columns from various tables (optional)
+-- #dropColumn('website' 'userid')
+-- #dropColumn('website' 'weblogdayid')
+-- #dropColumn('weblogentry' 'publishentry')
+-- #dropColumn('weblogentry' 'link')
 

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/core/UpgradeDatabase.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/core/UpgradeDatabase.jsp?rev=574446&r1=574445&r2=574446&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/core/UpgradeDatabase.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/core/UpgradeDatabase.jsp Mon Sep 10 21:24:00
2007
@@ -38,7 +38,7 @@
     </p>
     <p><s:text name="installer.upgradeTables" /></p>
 
-    <s:form action="upgradeDatabase!upgrade">
+    <s:form action="install!upgrade">
         <s:submit key="installer.yesUpgradeTables" />
     </s:form>
 
@@ -50,7 +50,7 @@
     <p><s:text name="installer.tablesUpgradedExplanation" /></p>
     <p>
         <s:text name="installer.tryBootstrapping">
-            <s:param><s:url value="/"/></s:param>
+            <s:param><s:url action="install!bootstrap"/></s:param>
         </s:text>
     </p>
     



Mime
View raw message