You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by gm...@apache.org on 2014/02/23 00:58:00 UTC

svn commit: r1570943 - in /roller/trunk/app/src/main: java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java resources/sql/400-to-500-migration.vm resources/sql/500-to-510-migration.vm resources/sql/createdb.vm

Author: gmazza
Date: Sat Feb 22 23:58:00 2014
New Revision: 1570943

URL: http://svn.apache.org/r1570943
Log:
Dropped unused weblogcategoryassoc table, removed parentid and path columns and added position column to weblogcategory table; tested 5.0 to 5.1 migration using MySQL database.

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
    roller/trunk/app/src/main/resources/sql/400-to-500-migration.vm
    roller/trunk/app/src/main/resources/sql/500-to-510-migration.vm
    roller/trunk/app/src/main/resources/sql/createdb.vm

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java?rev=1570943&r1=1570942&r2=1570943&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java Sat Feb 22 23:58:00 2014
@@ -258,7 +258,7 @@ public class DatabaseInstaller {
     }
 
     /**
-     * Upgrade database for Roller 4.0.0
+     * Upgrade database to Roller 4.0.0
      */
     private void upgradeTo400(Connection con, boolean runScripts) throws StartupException {
         
@@ -701,7 +701,7 @@ public class DatabaseInstaller {
     
     
     /**
-     * Upgrade database for Roller 4.1.0
+     * Upgrade database to Roller 5.0
      */
     private void upgradeTo500(Connection con, boolean runScripts) throws StartupException {
         
@@ -727,6 +727,9 @@ public class DatabaseInstaller {
         }        
     }
 
+    /**
+     * Upgrade database to Roller 5.1
+     */
 	private void upgradeTo510(Connection con, boolean runScripts) throws StartupException {
         
         // first we need to run upgrade scripts 

Modified: roller/trunk/app/src/main/resources/sql/400-to-500-migration.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/400-to-500-migration.vm?rev=1570943&r1=1570942&r2=1570943&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/sql/400-to-500-migration.vm (original)
+++ roller/trunk/app/src/main/resources/sql/400-to-500-migration.vm Sat Feb 22 23:58:00 2014
@@ -39,7 +39,7 @@ insert into roller_permission (id,userna
       from rolleruser as u, website as w, roller_user_permissions as p
       where p.user_id = u.id and p.website_id = w.id and permission_mask = 3;
 
--- User management can now be exernalized, so no more relations with user table
+-- User management can now be externalized, so no more relations with user table
 
 #dropNotNullFromColumn("userrole" "userid" "varchar(48)")
 

Modified: roller/trunk/app/src/main/resources/sql/500-to-510-migration.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/500-to-510-migration.vm?rev=1570943&r1=1570942&r2=1570943&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/sql/500-to-510-migration.vm (original)
+++ roller/trunk/app/src/main/resources/sql/500-to-510-migration.vm Sat Feb 22 23:58:00 2014
@@ -23,3 +23,11 @@ create table rol_templatecode (
 
 #addColumnNull("webpage" "type"  "varchar(16)")
 #addColumnNull("weblogentry" "search_description"  "varchar(255)")
+
+-- Removal of subcategories means no more path and parentid columns
+delete from weblogcategory where name = 'root' and parentid is null;
+#dropColumn("weblogcategory" 'parentid')
+#dropColumn("weblogcategory" 'path')
+
+-- Allow users to order their weblog categories (zero-based)
+#addColumnNotNull("weblogcategory" "position" "integer" "0")

Modified: roller/trunk/app/src/main/resources/sql/createdb.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/createdb.vm?rev=1570943&r1=1570942&r2=1570943&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/sql/createdb.vm (original)
+++ roller/trunk/app/src/main/resources/sql/createdb.vm Sat Feb 22 23:58:00 2014
@@ -195,27 +195,14 @@ create table bookmark (
 create index bm_folderid_idx on bookmark( folderid );
 
 create table weblogcategory (
-    id               varchar(48)  not null primary key,
+    id               varchar(48) not null primary key,
     name             varchar(255) not null,
     description      varchar(255),
     websiteid        varchar(48) not null,
     image            varchar(255),
-    parentid         varchar(48),
-    path             varchar(255)
+    position         integer default 0 not null
 );
 create index wc_websiteid_idx on weblogcategory( websiteid );
-create index ws_parentid_idx on weblogcategory( parentid );
-create index ws_path_idx on weblogcategory( path );
-
-create table weblogcategoryassoc (
-    id               varchar(48) not null primary key,
-    categoryid       varchar(48) not null,
-    ancestorid       varchar(40),
-    relation         varchar(20) not null
-);
-create index wca_categoryid_idx on weblogcategoryassoc( categoryid );
-create index wca_ancestorid_idx on weblogcategoryassoc( ancestorid );
-create index wca_relation_idx on weblogcategoryassoc( relation );
 
 create table weblogentry (
     id              varchar(48)  not null primary key,