You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2005/12/05 04:11:59 UTC

svn commit: r353964 - in /incubator/roller/trunk: metadata/database/ src/org/roller/business/utils/

Author: snoopdave
Date: Sun Dec  4 19:11:54 2005
New Revision: 353964

URL: http://svn.apache.org/viewcvs?rev=353964&view=rev
Log:
Fix for ROL-910, needs to be backported to roller_2.0 branch

Modified:
    incubator/roller/trunk/metadata/database/130-to-200-migration-raw.sql
    incubator/roller/trunk/metadata/database/200-to-210-migration-raw.sql
    incubator/roller/trunk/metadata/database/db_db2.properties
    incubator/roller/trunk/metadata/database/db_derby.properties
    incubator/roller/trunk/metadata/database/db_hsql.properties
    incubator/roller/trunk/metadata/database/db_mysql.properties
    incubator/roller/trunk/metadata/database/db_oracle.properties
    incubator/roller/trunk/metadata/database/db_postgresql.properties
    incubator/roller/trunk/src/org/roller/business/utils/UpgradeDatabase.java

Modified: incubator/roller/trunk/metadata/database/130-to-200-migration-raw.sql
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/130-to-200-migration-raw.sql?rev=353964&r1=353963&r2=353964&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/130-to-200-migration-raw.sql (original)
+++ incubator/roller/trunk/metadata/database/130-to-200-migration-raw.sql Sun Dec  4 19:11:54 2005
@@ -11,9 +11,19 @@
 );
 
 -- Add new handle field to uniquely identify websites in URLs
-alter table website add column handle varchar(255) @ALTER_TABLE_NOT_NULL@;
-alter table website add column datecreated  timestamp @ALTER_TABLE_NOT_NULL@;
-alter table website add column emailaddress varchar(255) @ALTER_TABLE_NOT_NULL@;
+
+alter table website add column handle varchar(255);
+@ALTER_TABLE_WEBSITE_HANDLE_DEFAULT@;
+@ALTER_TABLE_WEBSITE_HANDLE_NOT_NULL@;
+
+alter table website add column datecreated timestamp;
+@ALTER_TABLE_WEBSITE_DATECREATED_DEFAULT@;
+@ALTER_TABLE_WEBSITE_DATECREATED_NOT_NULL@;
+
+alter table website add column emailaddress varchar(255);
+@ALTER_TABLE_WEBSITE_EMAILADDRESS_DEFAULT@;
+@ALTER_TABLE_WEBSITE_EMAILADDRESS_NOT_NULL@;
+
 create index website_handle_index on website(handle);
 
 -- this constraint won't work for upgrades until the handle column is
@@ -22,13 +32,28 @@
 -- alter table website add constraint website_handle_uq unique (handle@INDEXSIZE@);
 
 -- Add userid to weblogentry so we can track original creator of entry
-alter table weblogentry add column userid varchar(48) @ALTER_TABLE_NOT_NULL@;
-alter table weblogentry add column status varchar(20) @ALTER_TABLE_NOT_NULL@;
+alter table weblogentry add column userid varchar(48);
+@ALTER_TABLE_WEBLOGENTY_USERID_DEFAULT@;
+@ALTER_TABLE_WEBLOGENTY_USERID_NOT_NULL@;
+
+alter table weblogentry add column status varchar(20);
+@ALTER_TABLE_WEBLOGENTRY_STATUS_DEFAULT@;
+@ALTER_TABLE_WEBLOGENTRY_STATUS_NOT_NULL@;
+
 create index weblogentry_userid_index on weblogentry(userid);
 
-alter table rolleruser add column isenabled @BOOLEAN_SQL_TYPE_TRUE@ @ALTER_TABLE_NOT_NULL@;
-alter table rolleruser add column locale varchar(50) @ALTER_TABLE_NOT_NULL@;
-alter table rolleruser add column timezone varchar(50) @ALTER_TABLE_NOT_NULL@;
+alter table rolleruser add column isenabled @BOOLEAN_SQL_TYPE@;
+@ALTER_TABLE_ROLLERUSER_ISENABLED_DEFAULT@;
+@ALTER_TABLE_ROLLERUSER_ISENABLED_NOT_NULL@;
+
+alter table rolleruser add column locale varchar(50);
+@ALTER_TABLE_ROLLERUSER_LOCALE_DEFAULT@;
+@ALTER_TABLE_ROLLERUSER_LOCALE_NOT_NULL@;
+
+alter table rolleruser add column timezone varchar(50);
+@ALTER_TABLE_ROLLERUSER_TIMEZONE_DEFAULT@;
+@ALTER_TABLE_ROLLERUSER_TIMEZONE_NOT_NULL@;
+
 create index user_isenabled_index on rolleruser( isenabled );
 
 -- -----------------------------------------------------
@@ -56,7 +81,6 @@
 -- 
 -- sadly this needs to be done in a specific manner for each db, so check
 -- the db_*.properties file for each db to see how it's done.
-
 @ALTER_PUBTIME_ALLOW_NULL@;
 
 
@@ -68,7 +92,9 @@
 
 -- Create the new column.  If your database will not autopopulate new columns with default values, you may
 -- have to remove the "not null" clause here.
-alter table pingtarget add column conditioncode integer default 0 not null;
+alter table pingtarget add column conditioncode integer;
+@ALTER_TABLE_PINGTARGET_CONDITIONCODE_DEFAULT_0@;
+@ALTER_TABLE_PINGTARGET_CONDITIONCODE_NOT_NULL@;
 
 -- Transfer old column data to the new column.  This is not critical as currently it is not used, and
 -- later the data will be generated by usage in the ping processor.

Modified: incubator/roller/trunk/metadata/database/200-to-210-migration-raw.sql
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/200-to-210-migration-raw.sql?rev=353964&r1=353963&r2=353964&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/200-to-210-migration-raw.sql (original)
+++ incubator/roller/trunk/metadata/database/200-to-210-migration-raw.sql Sun Dec  4 19:11:54 2005
@@ -1,10 +1,12 @@
 
 -- Add to roller_comment table: approved and pending fields
 
-alter table roller_comment add column approved @BOOLEAN_SQL_TYPE_FALSE@;
+alter table roller_comment add column approved @BOOLEAN_SQL_TYPE@;
+@ALTER_TABLE_ROLLER_COMMENT_APPROVED_DEFAULT_FALSE@;
 @ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL@;
 
-alter table roller_comment add column pending @BOOLEAN_SQL_TYPE_TRUE@;
+alter table roller_comment add column pending @BOOLEAN_SQL_TYPE@;
+@ALTER_TABLE_ROLLER_COMMENT_PENDING_DEFAULT_FALSE@;
 @ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL@;
 
 update roller_comment set approved=1, pending=0, posttime=posttime;
@@ -12,13 +14,16 @@
 
 -- Add to website table: commentmod, blacklist, defaultallowcomments and defaultcommentdays 
 
-alter table website add column commentmod @BOOLEAN_SQL_TYPE_FALSE@;
+alter table website add column commentmod @BOOLEAN_SQL_TYPE@;
+@ALTER_TABLE_WEBSITE_COMMENTMOD_DEFAULT_FALSE@;
 @ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL@;
 
-alter table website add column defaultallowcomments @BOOLEAN_SQL_TYPE_TRUE@;
+alter table website add column defaultallowcomments @BOOLEAN_SQL_TYPE@;
+@ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_DEFAULT_TRUE@;
 @ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL@;
 
 alter table website add column defaultcommentdays integer;
+@ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_DEFAULT_7@;
 @ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL@;
 
 alter table website add column blacklist @TEXT_SQL_TYPE@;

Modified: incubator/roller/trunk/metadata/database/db_db2.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/db_db2.properties?rev=353964&r1=353963&r2=353964&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/db_db2.properties (original)
+++ incubator/roller/trunk/metadata/database/db_db2.properties Sun Dec  4 19:11:54 2005
@@ -1 +1 @@
-TEXT_SQL_TYPE=clob(102400)
BOOLEAN_SQL_TYPE_FALSE=smallint default 0
BOOLEAN_SQL_TYPE_TRUE=smallint default 1
BOOLEAN_SQL_TYPE=smallint
BOOLEAN_FALSE=0
BOOLEAN_TRUE=1
INDEXSIZE=
INDEXSIZE_LARGE=
ALTER_TABLE_NOT_NULL= not null
ADDL_FK_PARAMS=on delete no action on update no action enforced enable query optimization
TIMESTAMP_SQL_TYPE_NULL=timestamp null
ALTER_PUBTIME_ALLOW_NULL=
ALTER_DEFAULTPAGEID_ALLOW_NULL=alter table website alter column defaultpageid drop not null
ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=alter table roller_comment alter approved add NOT NULL
ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=alter table roller_comment alter pending add NOT NULL
ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=alter table website alter commentmod add NOT NULL
ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=alter table website alter defaultallowcomments add NOT NULL
ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=alter table website alter defaultcommentdays add NOT NULL
\ No newline at end of file
+TEXT_SQL_TYPE=clob(102400)
BOOLEAN_SQL_TYPE_FALSE=smallint default 0
BOOLEAN_SQL_TYPE_TRUE=smallint default 1
BOOLEAN_SQL_TYPE=smallint
BOOLEAN_FALSE=0
BOOLEAN_TRUE=1
INDEXSIZE=
INDEXSIZE_LARGE=
ALTER_TABLE_NOT_NULL= not null
ADDL_FK_PARAMS=on delete no action on update no action enforced enable query optimization
TIMESTAMP_SQL_TYPE_NULL=timestamp null
ALTER_PUBTIME_ALLOW_NULL=
ALTER_DEFAULTPAGEID_ALLOW_NULL=alter table website alter column defaultpageid drop not null

ALTER_TABLE_PINGTARGET_CONDITIONCODE_NOT_NULL=alter table pingtarget modify conditioncode set not null
ALTER_TABLE_PINGTARGET_CONDITIONCODE_DEFAULT_0=alter table pingtarget modify conditioncode set default 0

ALTER_TABLE_WEBSITE_HANDLE_DEFAULT=alter table website alter handle varchar(255) set default ''
ALTER_TABLE_WEBSITE_HANDLE_NOT_NULL=alter table website alter handle varchar(255) not null 

ALTER_TABLE_WEBSITE_DATECREATED_DEFAULT=alter table website alter datecreated timestamp set default '20050101'
ALTER_
 TABLE_WEBSITE_DATECREATED_NOT_NULL=alter table website alter datecreated timestamp not null

ALTER_TABLE_WEBSITE_EMAILADDRESS_DEFAULT=alter table website alter emailaddress varchar(255) set default ''
ALTER_TABLE_WEBSITE_EMAILADDRESS_NOT_NULL=alter table website alter handle varchar(255) not null

ALTER_TABLE_WEBLOGENTY_USERID_DEFAULT=alter table weblogentry alter userid varchar(48) set default ''
ALTER_TABLE_WEBLOGENTY_USERID_NOT_NULL=alter table weblogentry alter userid varchar(48) not null

ALTER_TABLE_WEBLOGENTRY_STATUS_DEFAULT=alter table weblogentry alter status varchar(20) set default ''
ALTER_TABLE_WEBLOGENTRY_STATUS_NOT_NULL=alter table weblogentry alter status varchar(20) not null

ALTER_TABLE_ROLLERUSER_ISENABLED_DEFAULT=alter table rolleruser alter isenabled boolean set default 1
ALTER_TABLE_ROLLERUSER_ISENABLED_NOT_NULL=alter table rolleruser alter isenabled boolean not null

ALTER_TABLE_ROLLERUSER_LOCALE_DEFAULT=alter table rolleruser alter locale varchar(50) s
 et default ''
ALTER_TABLE_ROLLERUSER_LOCALE_NOT_NULL=alter table rolleruser alter locale varchar(50) not null

ALTER_TABLE_ROLLERUSER_TIMEZONE_DEFAULT=alter table rolleruser alter timezone varchar(50) set default ''
ALTER_TABLE_ROLLERUSER_TIMEZONE_NOT_NULL=alter table rolleruser alter timezone varchar(50) not null

ALTER_TABLE_ROLLER_COMMENT_APPROVED_DEFAULT_FALSE=  alter table roller_comment alter approved set default false
ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=      alter table roller_comment alter approved set not null

ALTER_TABLE_ROLLER_COMMENT_PENDING_DEFAULT_FALSE=   alter table roller_comment alter pending set default false
ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=       alter table roller_comment alter pending set not null

ALTER_TABLE_WEBSITE_COMMENTMOD_DEFAULT_FALSE=       alter table website alter commendmod set default false
ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=           alter table website alter commendmod set not null;

ALTER_TABLE_WEBSITE_DEFAUL
 TALLOWCOMMENTS_DEFAULT_TRUE=alter table website alter defaultallowcomments set default true
ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=    alter table website alter defaultallowcomments set not null

ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_DEFAULT_7= alter table website alter defaultcommentdays set default 7
ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=     alter table website alter defaultcommentdays set not null
\ No newline at end of file

Modified: incubator/roller/trunk/metadata/database/db_derby.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/db_derby.properties?rev=353964&r1=353963&r2=353964&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/db_derby.properties (original)
+++ incubator/roller/trunk/metadata/database/db_derby.properties Sun Dec  4 19:11:54 2005
@@ -1 +1 @@
-TEXT_SQL_TYPE=clob(102400)
BOOLEAN_SQL_TYPE_FALSE=smallint default 0
BOOLEAN_SQL_TYPE_TRUE=smallint default 1
BOOLEAN_SQL_TYPE=smallint
BOOLEAN_FALSE=0
BOOLEAN_TRUE=1
INDEXSIZE=
INDEXSIZE_LARGE=
ALTER_TABLE_NOT_NULL= not null
ADDL_FK_PARAMS=
TIMESTAMP_SQL_TYPE_NULL=timestamp null
ALTER_PUBTIME_ALLOW_NULL=
ALTER_DEFAULTPAGEID_ALLOW_NULL=alter table website alter column defaultpageid drop not null
ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=alter table roller_comment alter approved add NOT NULL
ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=alter table roller_comment alter pending add NOT NULL
ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=alter table website alter commentmod add NOT NULL
ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=alter table website alter defaultallowcomments add NOT NULL
ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=alter table website alter defaultcommentdays add NOT NULL
\ No newline at end of file
+TEXT_SQL_TYPE=clob(102400)
BOOLEAN_SQL_TYPE_FALSE=smallint default 0
BOOLEAN_SQL_TYPE_TRUE=smallint default 1
BOOLEAN_SQL_TYPE=smallint
BOOLEAN_FALSE=0
BOOLEAN_TRUE=1
INDEXSIZE=
INDEXSIZE_LARGE=
ALTER_TABLE_NOT_NULL= not null
ADDL_FK_PARAMS=
TIMESTAMP_SQL_TYPE_NULL=timestamp null
ALTER_PUBTIME_ALLOW_NULL=
ALTER_DEFAULTPAGEID_ALLOW_NULL=alter table website alter column defaultpageid drop not null

ALTER_TABLE_PINGTARGET_CONDITIONCODE_NOT_NULL= alter table pingtarget modify conditioncode set not null;
ALTER_TABLE_PINGTARGET_CONDITIONCODE_DEFAULT_0=alter table pingtarget modify conditioncode set default 0;

ALTER_TABLE_WEBSITE_HANDLE_DEFAULT=alter table website alter handle varchar(255) default ''
ALTER_TABLE_WEBSITE_HANDLE_NOT_NULL=alter table website alter handle varchar(255) not null 

ALTER_TABLE_WEBSITE_DATECREATED_DEFAULT=alter table website alter datecreated timestamp default '20050101'
ALTER_TABLE_WEBSITE_DATECREATED_NOT_NULL=alter table website alter datecreated timest
 amp not null

ALTER_TABLE_WEBSITE_EMAILADDRESS_DEFAULT=alter table website alter emailaddress varchar(255) default ''
ALTER_TABLE_WEBSITE_EMAILADDRESS_NOT_NULL=alter table website alter handle varchar(255) not null

ALTER_TABLE_WEBLOGENTY_USERID_DEFAULT=alter table weblogentry alter userid varchar(48) default ''
ALTER_TABLE_WEBLOGENTY_USERID_NOT_NULL=alter table weblogentry alter userid varchar(48) not null

ALTER_TABLE_WEBLOGENTRY_STATUS_DEFAULT=alter table weblogentry alter status varchar(20) default ''
ALTER_TABLE_WEBLOGENTRY_STATUS_NOT_NULL=alter table weblogentry alter status varchar(20) not null

ALTER_TABLE_ROLLERUSER_ISENABLED_DEFAULT=alter table rolleruser alter isenabled boolean default true
ALTER_TABLE_ROLLERUSER_ISENABLED_NOT_NULL=alter table rolleruser alter isenabled boolean not null

ALTER_TABLE_ROLLERUSER_LOCALE_DEFAULT=alter table rolleruser alter locale varchar(50) default ''
ALTER_TABLE_ROLLERUSER_LOCALE_NOT_NULL=alter table rolleruser alter locale varchar
 (50) not null

ALTER_TABLE_ROLLERUSER_TIMEZONE_DEFAULT=alter table rolleruser alter timezone varchar(50) default ''
ALTER_TABLE_ROLLERUSER_TIMEZONE_NOT_NULL=alter table rolleruser alter timezone varchar(50) not null

ALTER_TABLE_ROLLER_COMMENT_APPROVED_DEFAULT_FALSE=  alter table roller_comment alter approved set default false
ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=      alter table roller_comment alter approved set not null

ALTER_TABLE_ROLLER_COMMENT_PENDING_DEFAULT_FALSE=   alter table roller_comment alter pending set default false
ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=       alter table roller_comment alter pending set not null

ALTER_TABLE_WEBSITE_COMMENTMOD_DEFAULT_FALSE=alter table website alter commendmod set default false
ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=     alter table website alter commendmod set not null;

ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_DEFAULT_TRUE=alter table website alter defaultallowcomments set default true
ALTER_TABLE_WEBSITE_D
 EFAULTALLOWCOMMENTS_NOT_NULL=    alter table website alter defaultallowcomments set not null

ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_DEFAULT_7= alter table website alter defaultcommentdays set default 7
ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=     alter table website alter defaultcommentdays set not null
\ No newline at end of file

Modified: incubator/roller/trunk/metadata/database/db_hsql.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/db_hsql.properties?rev=353964&r1=353963&r2=353964&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/db_hsql.properties (original)
+++ incubator/roller/trunk/metadata/database/db_hsql.properties Sun Dec  4 19:11:54 2005
@@ -10,9 +10,46 @@
 ADDL_FK_PARAMS=
 TIMESTAMP_SQL_TYPE_NULL=timestamp null
 ALTER_PUBTIME_ALLOW_NULL=
-ALTER_DEFAULTPAGEID_ALLOW_NULL=alter table website alter column defaultpageid drop not null
-ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=alter table roller_comment alter approved add NOT NULL
-ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=alter table roller_comment alter pending add NOT NULL
-ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=alter table website alter commentmod add NOT NULL
-ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=alter table website alter defaultallowcomments add NOT NULL
-ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=alter table website alter defaultcommentdays add NOT NULL
\ No newline at end of file
+ALTER_DEFAULTPAGEID_ALLOW_NULL=               alter table website alter column defaultpageid drop not null
+
+ALTER_TABLE_PINGTARGET_CONDITIONCODE_NOT_NULL=      alter table pingtarget alter conditioncode set not null
+ALTER_TABLE_PINGTARGET_CONDITIONCODE_DEFAULT_0=     alter table pingtarget alter conditioncode set default 0
+
+ALTER_TABLE_WEBSITE_HANDLE_DEFAULT=alter table website alter handle varchar(255) default ''
+ALTER_TABLE_WEBSITE_HANDLE_NOT_NULL=alter table website alter handle varchar(255) not null 
+
+ALTER_TABLE_WEBSITE_DATECREATED_DEFAULT=alter table website alter datecreated timestamp default '20050101'
+ALTER_TABLE_WEBSITE_DATECREATED_NOT_NULL=alter table website alter datecreated timestamp not null
+
+ALTER_TABLE_WEBSITE_EMAILADDRESS_DEFAULT=alter table website alter emailaddress varchar(255) default ''
+ALTER_TABLE_WEBSITE_EMAILADDRESS_NOT_NULL=alter table website alter handle varchar(255) not null
+
+ALTER_TABLE_WEBLOGENTY_USERID_DEFAULT=alter table weblogentry alter userid varchar(48) default ''
+ALTER_TABLE_WEBLOGENTY_USERID_NOT_NULL=alter table weblogentry alter userid varchar(48) not null
+
+ALTER_TABLE_WEBLOGENTRY_STATUS_DEFAULT=alter table weblogentry alter status varchar(20) default ''
+ALTER_TABLE_WEBLOGENTRY_STATUS_NOT_NULL=alter table weblogentry alter status varchar(20) not null
+
+ALTER_TABLE_ROLLERUSER_ISENABLED_DEFAULT=alter table rolleruser alter isenabled boolean default true
+ALTER_TABLE_ROLLERUSER_ISENABLED_NOT_NULL=alter table rolleruser alter isenabled boolean not null
+
+ALTER_TABLE_ROLLERUSER_LOCALE_DEFAULT=alter table rolleruser alter locale varchar(50) default ''
+ALTER_TABLE_ROLLERUSER_LOCALE_NOT_NULL=alter table rolleruser alter locale varchar(50) not null
+
+ALTER_TABLE_ROLLERUSER_TIMEZONE_DEFAULT=alter table rolleruser alter timezone varchar(50) default ''
+ALTER_TABLE_ROLLERUSER_TIMEZONE_NOT_NULL=alter table rolleruser alter timezone varchar(50) not null
+
+ALTER_TABLE_ROLLER_COMMENT_APPROVED_DEFAULT_FALSE=  alter table roller_comment alter approved set default false
+ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=      alter table roller_comment alter approved set not null
+
+ALTER_TABLE_ROLLER_COMMENT_PENDING_DEFAULT_FALSE=   alter table roller_comment alter pending set default false
+ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=       alter table roller_comment alter pending set not null
+
+ALTER_TABLE_WEBSITE_COMMENTMOD_DEFAULT_FALSE=alter table website alter commendmod set default false
+ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=     alter table website alter commendmod set not null;
+
+ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_DEFAULT_TRUE=alter table website alter defaultallowcomments set default true
+ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=    alter table website alter defaultallowcomments set not null
+
+ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_DEFAULT_7= alter table website alter defaultcommentdays set default 7
+ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=     alter table website alter defaultcommentdays set not null
\ No newline at end of file

Modified: incubator/roller/trunk/metadata/database/db_mysql.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/db_mysql.properties?rev=353964&r1=353963&r2=353964&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/db_mysql.properties (original)
+++ incubator/roller/trunk/metadata/database/db_mysql.properties Sun Dec  4 19:11:54 2005
@@ -1 +1 @@
-TEXT_SQL_TYPE=text
BOOLEAN_SQL_TYPE_FALSE=bit default 0
BOOLEAN_SQL_TYPE_TRUE=bit default 1
BOOLEAN_SQL_TYPE=bit
BOOLEAN_FALSE=0
BOOLEAN_TRUE=1
INDEXSIZE=(40)
INDEXSIZE_LARGE=(100)
ALTER_TABLE_NOT_NULL= not null
ADDL_FK_PARAMS=
TIMESTAMP_SQL_TYPE_NULL=datetime NULL
ALTER_PUBTIME_ALLOW_NULL=alter table weblogentry modify pubtime DATETIME NULL
ALTER_DEFAULTPAGEID_ALLOW_NULL=alter table website modify defaultpageid varchar(48) DEFAULT ''
ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=alter table roller_comment modify approved bit NOT NULL
ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=alter table roller_comment modify pending bit NOT NULL
ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=alter table website modify commentmod bit NOT NULL
ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=alter table website modify defaultallowcomments bit NOT NULL
ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=alter table website modify defaultcommentdays bit NOT NULL
\ No newline at end of file
+TEXT_SQL_TYPE=text
BOOLEAN_SQL_TYPE_FALSE=bit default 0
BOOLEAN_SQL_TYPE_TRUE=bit default 1
BOOLEAN_SQL_TYPE=bit
BOOLEAN_FALSE=0
BOOLEAN_TRUE=1
INDEXSIZE=(40)
INDEXSIZE_LARGE=(100)
ALTER_TABLE_NOT_NULL= not null
ADDL_FK_PARAMS=
TIMESTAMP_SQL_TYPE_NULL=datetime NULL
ALTER_PUBTIME_ALLOW_NULL=     alter table weblogentry modify pubtime DATETIME NULL
ALTER_DEFAULTPAGEID_ALLOW_NULL=alter table website modify defaultpageid varchar(48) DEFAULT ''

ALTER_TABLE_PINGTARGET_CONDITIONCODE_NOT_NULL=alter table pingtarget modify conditioncode integer default 0 not null
ALTER_TABLE_PINGTARGET_CONDITIONCODE_DEFAULT_0=alter table pingtarget modify conditioncode default 0

ALTER_TABLE_WEBSITE_HANDLE_DEFAULT=alter table website modify handle varchar(255) default ''
ALTER_TABLE_WEBSITE_HANDLE_NOT_NULL=alter table website modify handle varchar(255) not null 

ALTER_TABLE_WEBSITE_DATECREATED_DEFAULT=alter table website modify datecreated timestamp default '20050101'
ALTER_TABLE_WEBSITE_DATECREATE
 D_NOT_NULL=alter table website modify datecreated timestamp not null

ALTER_TABLE_WEBSITE_EMAILADDRESS_DEFAULT=alter table website modify emailaddress varchar(255) default ''
ALTER_TABLE_WEBSITE_EMAILADDRESS_NOT_NULL=alter table website modify handle varchar(255) not null

ALTER_TABLE_WEBLOGENTY_USERID_DEFAULT=alter table weblogentry modify userid varchar(48) default ''
ALTER_TABLE_WEBLOGENTY_USERID_NOT_NULL=alter table weblogentry modify userid varchar(48) not null

ALTER_TABLE_WEBLOGENTRY_STATUS_DEFAULT=alter table weblogentry modify status varchar(20) default ''
ALTER_TABLE_WEBLOGENTRY_STATUS_NOT_NULL=alter table weblogentry modify status varchar(20) not null

ALTER_TABLE_ROLLERUSER_ISENABLED_DEFAULT=alter table rolleruser modify isenabled bit default 1
ALTER_TABLE_ROLLERUSER_ISENABLED_NOT_NULL=alter table rolleruser modify isenabled bit not null

ALTER_TABLE_ROLLERUSER_LOCALE_DEFAULT=alter table rolleruser modify locale varchar(50) default ''
ALTER_TABLE_ROLLERUSER_LOCAL
 E_NOT_NULL=alter table rolleruser modify locale varchar(50) not null

ALTER_TABLE_ROLLERUSER_TIMEZONE_DEFAULT=alter table rolleruser modify timezone varchar(50) default ''
ALTER_TABLE_ROLLERUSER_TIMEZONE_NOT_NULL=alter table rolleruser modify timezone varchar(50) not null

ALTER_TABLE_ROLLER_COMMENT_APPROVED_DEFAULT_FALSE=alter table roller_comment modify approved default 0
ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=    alter table roller_comment modify approved not null

ALTER_TABLE_ROLLER_COMMENT_PENDING_DEFAULT_FALSE=alter table roller_comment modify pending default 0
ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=    alter table roller_comment modify pending not null

ALTER_TABLE_WEBSITE_COMMENTMOD_DEFAULT_FALSE=alter table website modify commendmod default 0
ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=    alter table website modify commendmod not null

ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_DEFAULT_FALSE=alter table website modify defaultallowcomments default true
ALTER_TA
 BLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=    alter table website modify defaultallowcomments not null

ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_DEFAULT_7=alter table website modify defaultcommentdays default 7
ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=    alter table website modify defaultcommentdays not null
\ No newline at end of file

Modified: incubator/roller/trunk/metadata/database/db_oracle.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/db_oracle.properties?rev=353964&r1=353963&r2=353964&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/db_oracle.properties (original)
+++ incubator/roller/trunk/metadata/database/db_oracle.properties Sun Dec  4 19:11:54 2005
@@ -1 +1 @@
-TEXT_SQL_TYPE=clob
BOOLEAN_SQL_TYPE_FALSE=number(1) default 0
BOOLEAN_SQL_TYPE_TRUE=number(1) default 1
BOOLEAN_SQL_TYPE=number(1)
BOOLEAN_FALSE=0
BOOLEAN_TRUE=1
INDEXSIZE=
INDEXSIZE_LARGE=
ALTER_TABLE_NOT_NULL= not null
ADDL_FK_PARAMS=
TIMESTAMP_SQL_TYPE_NULL=timestamp null
ALTER_PUBTIME_ALLOW_NULL=
ALTER_DEFAULTPAGEID_ALLOW_NULL=alter table website modify defaultpageid varchar(48) DEFAULT ''
ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=alter table roller_comment modify approved number(1) NOT NULL
ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=alter table roller_comment modify pending number(1) NOT NULL
ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=alter table website modify commentmod number(1) NOT NULL
ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=alter table website modify defaultallowcomments number(1) NOT NULL
ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=alter table website modify defaultcommentdays  number(1) NOT NULL
\ No newline at end of file
+TEXT_SQL_TYPE=clob
BOOLEAN_SQL_TYPE_FALSE=number(1) default 0
BOOLEAN_SQL_TYPE_TRUE=number(1) default 1
BOOLEAN_SQL_TYPE=number(1)
BOOLEAN_FALSE=0
BOOLEAN_TRUE=1
INDEXSIZE=
INDEXSIZE_LARGE=
ALTER_TABLE_NOT_NULL= not null
ADDL_FK_PARAMS=
TIMESTAMP_SQL_TYPE_NULL=timestamp null
ALTER_PUBTIME_ALLOW_NULL=
ALTER_DEFAULTPAGEID_ALLOW_NULL=                alter table website modify defaultpageid varchar(48) DEFAULT ''

ALTER_TABLE_PINGTARGET_CONDITIONCODE_NOT_NULL=     alter table pingtarget modify conditioncode not null
ALTER_TABLE_PINGTARGET_CONDITIONCODE_DEFAULT_0=    alter table pingtarget modify conditioncode set default 0

ALTER_TABLE_WEBSITE_HANDLE_DEFAULT=alter table website modify handle varchar(255) default ''
ALTER_TABLE_WEBSITE_HANDLE_NOT_NULL=alter table website modify handle varchar(255) not null 

ALTER_TABLE_WEBSITE_DATECREATED_DEFAULT=alter table website modify datecreated timestamp default '20050101'
ALTER_TABLE_WEBSITE_DATECREATED_NOT_NULL=alter table website modif
 y datecreated timestamp not null

ALTER_TABLE_WEBSITE_EMAILADDRESS_DEFAULT=alter table website modify emailaddress varchar(255) default ''
ALTER_TABLE_WEBSITE_EMAILADDRESS_NOT_NULL=alter table website modify handle varchar(255) not null

ALTER_TABLE_WEBLOGENTY_USERID_DEFAULT=alter table weblogentry modify userid varchar(48) default ''
ALTER_TABLE_WEBLOGENTY_USERID_NOT_NULL=alter table weblogentry modify userid varchar(48) not null

ALTER_TABLE_WEBLOGENTRY_STATUS_DEFAULT=alter table weblogentry modify status varchar(20) default ''
ALTER_TABLE_WEBLOGENTRY_STATUS_NOT_NULL=alter table weblogentry modify status varchar(20) not null

ALTER_TABLE_ROLLERUSER_ISENABLED_DEFAULT=alter table rolleruser modify isenabled boolean default true
ALTER_TABLE_ROLLERUSER_ISENABLED_NOT_NULL=alter table rolleruser modify isenabled boolean not null

ALTER_TABLE_ROLLERUSER_LOCALE_DEFAULT=alter table rolleruser modify locale varchar(50) default ''
ALTER_TABLE_ROLLERUSER_LOCALE_NOT_NULL=alter table ro
 lleruser modify locale varchar(50) not null

ALTER_TABLE_ROLLERUSER_TIMEZONE_DEFAULT=alter table rolleruser modify timezone varchar(50) default ''
ALTER_TABLE_ROLLERUSER_TIMEZONE_NOT_NULL=alter table rolleruser modify timezone varchar(50) not null

ALTER_TABLE_ROLLER_COMMENT_APPROVED_DEFAULT_FALSE=  alter table roller_comment modify approved set default false
ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=      alter table roller_comment modify approved add not null

ALTER_TABLE_ROLLER_COMMENT_PENDING_DEFAULT_FALSE=   alter table roller_comment modify pending set default false
ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=       alter table roller_comment modify pending add not null

ALTER_TABLE_WEBSITE_COMMENTMOD_DEFAULT_FALSE=alter table website modify commendmod set default false
ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=     alter table website modify commendmod add not null;

ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_DEFAULT_TRUE=alter table website modify defaultallowcomments
  set default true
ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=    alter table website modify defaultallowcomments add not null

ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_DEFAULT_7= alter table website modify defaultcommentdays set default 7
ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=     alter table website modify defaultcommentdays add not null
\ No newline at end of file

Modified: incubator/roller/trunk/metadata/database/db_postgresql.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/db_postgresql.properties?rev=353964&r1=353963&r2=353964&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/db_postgresql.properties (original)
+++ incubator/roller/trunk/metadata/database/db_postgresql.properties Sun Dec  4 19:11:54 2005
@@ -9,10 +9,47 @@
 ALTER_TABLE_NOT_NULL=
 ADDL_FK_PARAMS=
 TIMESTAMP_SQL_TYPE_NULL=timestamp null
-ALTER_PUBTIME_ALLOW_NULL=alter table weblogentry alter pubtime drop not null
+ALTER_PUBTIME_ALLOW_NULL=     alter table weblogentry alter pubtime drop not null
 ALTER_DEFAULTPAGEID_ALLOW_NULL=alter table website alter column defaultpageid drop not null
-ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=alter table roller_comment alter approved add NOT NULL
-ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=alter table roller_comment alter pending add NOT NULL
-ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=alter table website alter commentmod add NOT NULL
-ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=alter table website alter defaultallowcomments add NOT NULL
-ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=alter table website alter defaultcommentdays add NOT NULL
\ No newline at end of file
+
+ALTER_TABLE_PINGTARGET_CONDITIONCODE_NOT_NULL= alter table pingtarget alter conditioncode set not null
+ALTER_TABLE_PINGTARGET_CONDITIONCODE_DEFAULT_0=alter table pingtarget alter conditioncode set default 0
+
+ALTER_TABLE_WEBSITE_HANDLE_DEFAULT=alter table website alter handle set default ''
+ALTER_TABLE_WEBSITE_HANDLE_NOT_NULL=alter table website alter handle set not null 
+
+ALTER_TABLE_WEBSITE_DATECREATED_DEFAULT=alter table website alter datecreated set default '20050101'
+ALTER_TABLE_WEBSITE_DATECREATED_NOT_NULL=alter table website alter datecreated set not null
+
+ALTER_TABLE_WEBSITE_EMAILADDRESS_DEFAULT=alter table website alter emailaddress set default ''
+ALTER_TABLE_WEBSITE_EMAILADDRESS_NOT_NULL=alter table website alter handle set not null
+
+ALTER_TABLE_WEBLOGENTY_USERID_DEFAULT=alter table weblogentry alter userid set default ''
+ALTER_TABLE_WEBLOGENTY_USERID_NOT_NULL=alter table weblogentry alter userid set not null
+
+ALTER_TABLE_WEBLOGENTRY_STATUS_DEFAULT=alter table weblogentry alter status set default ''
+ALTER_TABLE_WEBLOGENTRY_STATUS_NOT_NULL=alter table weblogentry alter status set not null
+
+ALTER_TABLE_ROLLERUSER_ISENABLED_DEFAULT=alter table rolleruser alter isenabled set default true
+ALTER_TABLE_ROLLERUSER_ISENABLED_NOT_NULL=alter table rolleruser alter isenabled set not null
+
+ALTER_TABLE_ROLLERUSER_LOCALE_DEFAULT=alter table rolleruser alter locale set default ''
+ALTER_TABLE_ROLLERUSER_LOCALE_NOT_NULL=alter table rolleruser alter locale set not null
+
+ALTER_TABLE_ROLLERUSER_TIMEZONE_DEFAULT=alter table rolleruser alter timezone set default ''
+ALTER_TABLE_ROLLERUSER_TIMEZONE_NOT_NULL=alter table rolleruser alter timezone set not null
+
+ALTER_TABLE_ROLLER_COMMENT_APPROVED_DEFAULT_FALSE=alter table roller_comment alter approved set default false
+ALTER_TABLE_ROLLER_COMMENT_APPROVED_NOT_NULL=    alter table roller_comment alter approved set not null
+
+ALTER_TABLE_ROLLER_COMMENT_PENDING_DEFAULT_FALSE=alter table roller_comment alter pending set default false
+ALTER_TABLE_ROLLER_COMMENT_PENDING_NOT_NULL=    alter table roller_comment alter pending set not null
+
+ALTER_TABLE_WEBSITE_COMMENTMOD_DEFAULT_FALSE=alter table website alter commendmod set default false
+ALTER_TABLE_WEBSITE_COMMENTMOD_NOT_NULL=     alter table website alter commendmod set not null
+
+ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_DEFAULT_TRUE=alter table website alter defaultallowcomments set default true
+ALTER_TABLE_WEBSITE_DEFAULTALLOWCOMMENTS_NOT_NULL=    alter table website alter defaultallowcomments set not null
+
+ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_DEFAULT_7= alter table website alter defaultcommentdays set default 7
+ALTER_TABLE_WEBSITE_DEFAULTCOMMENTDAYS_NOT_NULL=  alter table website alter defaultcommentdays set not null

Modified: incubator/roller/trunk/src/org/roller/business/utils/UpgradeDatabase.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/utils/UpgradeDatabase.java?rev=353964&r1=353963&r2=353964&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/utils/UpgradeDatabase.java (original)
+++ incubator/roller/trunk/src/org/roller/business/utils/UpgradeDatabase.java Sun Dec  4 19:11:54 2005
@@ -172,7 +172,7 @@
             mLogger.info("Populating roller_user_permissions table");
             
             PreparedStatement websitesQuery = con.prepareStatement(
-                "select w.id, u.id, u.username from "
+                "select w.id as wid, u.id as uid, u.username as uname from "
               + "website as w, rolleruser as u where u.id=w.userid");
             PreparedStatement websiteUpdate = con.prepareStatement(
                 "update website set handle=? where id=?");         
@@ -181,16 +181,16 @@
               + "pubtime=pubtime, updatetime=updatetime "
               + "where publishentry=? and websiteid=?");            
             PreparedStatement permsInsert = con.prepareStatement(
-                "insert roller_user_permissions "
+                "insert into roller_user_permissions "
               + "(id, website_id, user_id, permission_mask, pending) "
               + "values (?,?,?,?,?)");
              
             // loop through websites, each has a user
             ResultSet websiteSet = websitesQuery.executeQuery();
             while (websiteSet.next()) {
-                String websiteid = websiteSet.getString("w.id");
-                String userid = websiteSet.getString("u.id");
-                String handle = websiteSet.getString("u.username");
+                String websiteid = websiteSet.getString("wid");
+                String userid = websiteSet.getString("uid");
+                String handle = websiteSet.getString("uname");
                 mLogger.info("Processing website: " + handle);
                        
                 // use website user's username as website handle