Return-Path: X-Original-To: apmail-roller-commits-archive@www.apache.org Delivered-To: apmail-roller-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 12DCC1035A for ; Sat, 22 Feb 2014 23:58:28 +0000 (UTC) Received: (qmail 27147 invoked by uid 500); 22 Feb 2014 23:58:27 -0000 Delivered-To: apmail-roller-commits-archive@roller.apache.org Received: (qmail 27097 invoked by uid 500); 22 Feb 2014 23:58:27 -0000 Mailing-List: contact commits-help@roller.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@roller.apache.org Delivered-To: mailing list commits@roller.apache.org Received: (qmail 27088 invoked by uid 99); 22 Feb 2014 23:58:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Feb 2014 23:58:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Feb 2014 23:58:22 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D007423889D5; Sat, 22 Feb 2014 23:58:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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 Date: Sat, 22 Feb 2014 23:58:00 -0000 To: commits@roller.apache.org From: gmazza@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140222235800.D007423889D5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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,