roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r376981 - /incubator/roller/branches/roller_2.1/src/org/roller/business/utils/UpgradeDatabase.java
Date Sat, 11 Feb 2006 13:50:29 GMT
Author: snoopdave
Date: Sat Feb 11 05:50:28 2006
New Revision: 376981

URL: http://svn.apache.org/viewcvs?rev=376981&view=rev
Log:
Fix for PosgreSQL problem in 2.1 upgrade code

Modified:
    incubator/roller/branches/roller_2.1/src/org/roller/business/utils/UpgradeDatabase.java

Modified: incubator/roller/branches/roller_2.1/src/org/roller/business/utils/UpgradeDatabase.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.1/src/org/roller/business/utils/UpgradeDatabase.java?rev=376981&r1=376980&r2=376981&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.1/src/org/roller/business/utils/UpgradeDatabase.java
(original)
+++ incubator/roller/branches/roller_2.1/src/org/roller/business/utils/UpgradeDatabase.java
Sat Feb 11 05:50:28 2006
@@ -9,6 +9,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Date;
 import org.roller.pojos.PermissionsData;
 
 
@@ -271,8 +272,8 @@
             // insert a new template for a website
             PreparedStatement insertWeblogTemplate = con.prepareStatement(
                     "insert into webpage"+
-                    "(id, name, description, link, websiteid, template) "+
-                    "values(?,?,?,?,?,?)");
+                    "(id, name, description, link, websiteid, template, updatetime) "+
+                    "values(?,?,?,?,?,?,?)");
             
             // update the default page for a website
             PreparedStatement updateDefaultPage = con.prepareStatement(
@@ -282,6 +283,7 @@
             String description = "This template is used to render the main "+
                     "page of your weblog.";
             ResultSet websiteSet = selectUpdateWeblogs.executeQuery();
+            Date now = new Date();
             while (websiteSet.next()) {
                 String websiteid = websiteSet.getString(1);
                 String template = websiteSet.getString(2);
@@ -315,6 +317,7 @@
                     insertWeblogTemplate.setString( 4, "Weblog");
                     insertWeblogTemplate.setString( 5, websiteid);
                     insertWeblogTemplate.setString( 6, template);
+                    insertWeblogTemplate.setDate(   7, new java.sql.Date(now.getTime()));
                     insertWeblogTemplate.executeUpdate();
                     
                     // set the new default page id
@@ -380,3 +383,4 @@
         }
     }
 }
+



Mime
View raw message