You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ga...@apache.org on 2005/08/16 18:05:45 UTC
svn commit: r233011 - in /incubator/roller/branches/roller_2.0:
metadata/database/130-to-200-migration-raw.sql
metadata/database/createdb-raw.sql src/org/roller/pojos/PingTargetData.java
Author: gangolli
Date: Tue Aug 16 09:05:41 2005
New Revision: 233011
URL: http://svn.apache.org/viewcvs?rev=233011&view=rev
Log:
Fixes for ROL-754. Moved from trunk to Roller 2.0 branch. This renames the column condition to conditioncode in the pingtarget table. Added to existing db upgrade script; changed in full db build script; changed in doclet tag of PingTargetData.java.
Modified:
incubator/roller/branches/roller_2.0/metadata/database/130-to-200-migration-raw.sql
incubator/roller/branches/roller_2.0/metadata/database/createdb-raw.sql
incubator/roller/branches/roller_2.0/src/org/roller/pojos/PingTargetData.java
Modified: incubator/roller/branches/roller_2.0/metadata/database/130-to-200-migration-raw.sql
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/metadata/database/130-to-200-migration-raw.sql?rev=233011&r1=233010&r2=233011&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/metadata/database/130-to-200-migration-raw.sql (original)
+++ incubator/roller/branches/roller_2.0/metadata/database/130-to-200-migration-raw.sql Tue Aug 16 09:05:41 2005
@@ -1,35 +1,52 @@
--- User permissions within a website
-create table roller_user_permissions (
- id varchar(48) not null primary key,
- website_id varchar(48) not null,
- user_id varchar(48) not null,
- permission_mask integer not null, -- bitmask 001 limited, 011 author, 100 admin
- pending @BOOLEAN_SQL_TYPE_TRUE@ not null -- pending user acceptance of invitation to join website
-);
-
--- Audit log records time and comment about change
-create table roller_audit_log (
- id varchar(48) not null primary key,
- user_id varchar(48) not null, -- user that made change
- object_id varchar(48), -- id of associated object, if any
- object_class varchar(255), -- name of associated object class (e.g. WeblogEntryData)
- comment varchar(255) not null, -- description of change
- change_time timestamp -- time that change was made
-);
-
--- 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@;
-create index website_handle_index on userrole(handle);
-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@;
-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@;
-create index user_isenabled_index on rolleruser( isenabled );
-
+-- User permissions within a website
+create table roller_user_permissions (
+ id varchar(48) not null primary key,
+ website_id varchar(48) not null,
+ user_id varchar(48) not null,
+ permission_mask integer not null, -- bitmask 001 limited, 011 author, 100 admin
+ pending @BOOLEAN_SQL_TYPE_TRUE@ not null -- pending user acceptance of invitation to join website
+);
+
+-- Audit log records time and comment about change
+create table roller_audit_log (
+ id varchar(48) not null primary key,
+ user_id varchar(48) not null, -- user that made change
+ object_id varchar(48), -- id of associated object, if any
+ object_class varchar(255), -- name of associated object class (e.g. WeblogEntryData)
+ comment varchar(255) not null, -- description of change
+ change_time timestamp -- time that change was made
+);
+
+-- 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@;
+create index website_handle_index on userrole(handle);
+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@;
+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@;
+create index user_isenabled_index on rolleruser( isenabled );
+
+-- -----------------------------------------------------
+-- For ROL-754. MySQL 5.x introduced a new keyword "condition"
+-- which made the use of "condition" as a column name in the "pingtarget" table illegal.
+-- This renames the column to "conditioncode". There is a corresponding change in the
+-- Hibernate mapping metadata.
+
+-- 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;
+
+-- 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.
+update pingtarget pt set pt.conditioncode=pt.condition;
+
+-- Drop the old column.
+alter table pingtarget drop column condition;
+-- -----------------------------------------------------
Modified: incubator/roller/branches/roller_2.0/metadata/database/createdb-raw.sql
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/metadata/database/createdb-raw.sql?rev=233011&r1=233010&r2=233011&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/metadata/database/createdb-raw.sql (original)
+++ incubator/roller/branches/roller_2.0/metadata/database/createdb-raw.sql Tue Aug 16 09:05:41 2005
@@ -218,7 +218,7 @@
name varchar(255) not null, -- short descriptive name of the ping target
pingurl varchar(255) not null, -- URL to receive the ping
websiteid varchar(48) null, -- if not null, this is a custom target defined by the associated website
- condition integer default 0 not null, -- condition code
+ conditioncode integer default 0 not null, -- condition code
lastsuccess timestamp null -- last successful use
);
create index pingtarget_websiteid_index on pingtarget( websiteid );
Modified: incubator/roller/branches/roller_2.0/src/org/roller/pojos/PingTargetData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/PingTargetData.java?rev=233011&r1=233010&r2=233011&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/PingTargetData.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/PingTargetData.java Tue Aug 16 09:05:41 2005
@@ -187,7 +187,7 @@
* @return one of the condition codes {@link #CONDITION_OK}, {@link #CONDITION_FAILING}, {@link
* #CONDITION_DISABLED}.
* @ejb:persistent-field
- * @hibernate.property column="condition" not-null="true"
+ * @hibernate.property column="conditioncode" not-null="true"
*/
public int getConditionCode()
{