From 378f6f428f3f5eabbcefc731a88508739a71d49a Mon Sep 17 00:00:00 2001 From: Erik Winlof Date: Thu, 4 Sep 2014 07:34:10 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud) 82489: Merged WAT2 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 82466: ACE-2276 : Update Activiti - enterprise upgrade scripts and schema ref files for activiti 5.16.2. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@83288 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../Schema-Reference-ACT.xml | 4 +- .../Schema-Reference-ACT.xml | 4 +- .../alfresco/dbscripts/db-schema-context.xml | 1 + .../activiti-upgrade-5-16-2.sql | 108 ++++++------------ .../activiti-upgrade-5-16-2.sql | 21 ++-- .../alfresco/patch/patch-services-context.xml | 10 +- 6 files changed, 56 insertions(+), 92 deletions(-) diff --git a/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/Schema-Reference-ACT.xml b/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/Schema-Reference-ACT.xml index 2dc1230dce..51b7afdcbb 100644 --- a/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/Schema-Reference-ACT.xml +++ b/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/Schema-Reference-ACT.xml @@ -4,8 +4,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.alfresco.org/repo/db-schema db-schema.xsd" name="" dbprefix="act_" - version="8002" - tablecolumnorder="true"> + version="8004" + tablecolumnorder="false"> diff --git a/config/alfresco/dbscripts/create/org.hibernate.dialect.PostgreSQLDialect/Schema-Reference-ACT.xml b/config/alfresco/dbscripts/create/org.hibernate.dialect.PostgreSQLDialect/Schema-Reference-ACT.xml index 9ae22bc75c..40366f2be7 100644 --- a/config/alfresco/dbscripts/create/org.hibernate.dialect.PostgreSQLDialect/Schema-Reference-ACT.xml +++ b/config/alfresco/dbscripts/create/org.hibernate.dialect.PostgreSQLDialect/Schema-Reference-ACT.xml @@ -4,8 +4,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.alfresco.org/repo/db-schema db-schema.xsd" name="" dbprefix="act_" - version="8002" - tablecolumnorder="true"> + version="8004" + tablecolumnorder="false"> diff --git a/config/alfresco/dbscripts/db-schema-context.xml b/config/alfresco/dbscripts/db-schema-context.xml index 6cb0ef026e..c5680f9aab 100644 --- a/config/alfresco/dbscripts/db-schema-context.xml +++ b/config/alfresco/dbscripts/db-schema-context.xml @@ -107,6 +107,7 @@ + diff --git a/config/alfresco/dbscripts/upgrade/5.0/org.hibernate.dialect.MySQLInnoDBDialect/activiti-upgrade-5-16-2.sql b/config/alfresco/dbscripts/upgrade/5.0/org.hibernate.dialect.MySQLInnoDBDialect/activiti-upgrade-5-16-2.sql index f308102ee9..99a239707b 100644 --- a/config/alfresco/dbscripts/upgrade/5.0/org.hibernate.dialect.MySQLInnoDBDialect/activiti-upgrade-5-16-2.sql +++ b/config/alfresco/dbscripts/upgrade/5.0/org.hibernate.dialect.MySQLInnoDBDialect/activiti-upgrade-5-16-2.sql @@ -1,16 +1,12 @@ -- --- Title: Upgraded Activiti tables to 5.16.2 version +-- Title: Upgraded Activiti tables from 5.14 to 5.16.2 version -- Database: MySQL --- Since: V5.0 Schema 8002 --- Author: Mark Rogers +-- Since: V5.0 Schema 8004 +-- Author: Pavel Yurkevich -- -- Please contact support@alfresco.com if you need assistance with the upgrade. -- --- Upgraded Activiti tables from 5.14 to 5.16.2 version - -# MySQL < 5.6.4 does not support timestamps/dates with millisecond precision. -# This upgrade file lacks the necessary upgrades that are done on a 5.6.4+ installation -# to get millisecond precision. +-- Upgraded Activiti tables from 5.14 to 5.16.2 version, sql statements were copied from original activiti jar file. alter table ACT_RU_TASK add CATEGORY_ varchar(255); @@ -24,11 +20,11 @@ alter table ACT_RU_EXECUTION foreign key (PROC_DEF_ID_) references ACT_RE_PROCDEF (ID_); -#alter table ACT_RE_DEPLOYMENT -# add TENANT_ID_ varchar(255) default ''; +alter table ACT_RE_DEPLOYMENT + add TENANT_ID_ varchar(255) default ''; -#alter table ACT_RE_PROCDEF -# add TENANT_ID_ varchar(255) default ''; +alter table ACT_RE_PROCDEF + add TENANT_ID_ varchar(255) default ''; alter table ACT_RU_EXECUTION add TENANT_ID_ varchar(255) default ''; @@ -57,75 +53,30 @@ alter table ACT_RE_PROCDEF update ACT_GE_PROPERTY set VALUE_ = '5.15' where NAME_ = 'schema.version'; -# -# ACT-1867: MySQL DATETIME and TIMESTAMP precision -# The way this is done, is by creating a new column, pumping over all data -# and then removing the old column. -# +alter table ACT_HI_TASKINST + add CATEGORY_ varchar(255); -# DEPLOY_TIME_ in ACT_RE_DEPLOYMENT +alter table ACT_HI_PROCINST drop index ACT_UNIQ_HI_BUS_KEY; -ALTER TABLE ACT_RE_DEPLOYMENT ADD DEPLOY_TIME_TEMP_ timestamp; -UPDATE ACT_RE_DEPLOYMENT SET DEPLOY_TIME_TEMP_ = DEPLOY_TIME_; -ALTER TABLE ACT_RE_DEPLOYMENT DROP COLUMN DEPLOY_TIME_; -ALTER TABLE ACT_RE_DEPLOYMENT CHANGE DEPLOY_TIME_TEMP_ DEPLOY_TIME_ timestamp; +alter table ACT_HI_VARINST + add CREATE_TIME_ datetime; +alter table ACT_HI_VARINST + add LAST_UPDATED_TIME_ datetime; -# CREATE_TIME_ in ACT_RE_MODEL +alter table ACT_HI_PROCINST + add TENANT_ID_ varchar(255) default ''; -ALTER TABLE ACT_RE_MODEL ADD CREATE_TIME_TEMP_ timestamp null; -UPDATE ACT_RE_MODEL SET CREATE_TIME_TEMP_ = CREATE_TIME_; -ALTER TABLE ACT_RE_MODEL DROP COLUMN CREATE_TIME_; -ALTER TABLE ACT_RE_MODEL CHANGE CREATE_TIME_TEMP_ CREATE_TIME_ timestamp null; +alter table ACT_HI_ACTINST + add TENANT_ID_ varchar(255) default ''; +alter table ACT_HI_TASKINST + add TENANT_ID_ varchar(255) default ''; -# LAST_UPDATE_TIME_ in ACT_RE_MODEL - -ALTER TABLE ACT_RE_MODEL ADD LAST_UPDATE_TIME_TEMP_ timestamp null; -UPDATE ACT_RE_MODEL SET LAST_UPDATE_TIME_TEMP_ = LAST_UPDATE_TIME_; -ALTER TABLE ACT_RE_MODEL DROP COLUMN LAST_UPDATE_TIME_; -ALTER TABLE ACT_RE_MODEL CHANGE LAST_UPDATE_TIME_TEMP_ LAST_UPDATE_TIME_ timestamp null; - - -# LOCK_EXP_TIME_ in ACT_RU_JOB - -ALTER TABLE ACT_RU_JOB ADD LOCK_EXP_TIME_TEMP_ timestamp null; -UPDATE ACT_RU_JOB SET LOCK_EXP_TIME_TEMP_ = LOCK_EXP_TIME_; -ALTER TABLE ACT_RU_JOB DROP COLUMN LOCK_EXP_TIME_; -ALTER TABLE ACT_RU_JOB CHANGE LOCK_EXP_TIME_TEMP_ LOCK_EXP_TIME_ timestamp null; - - -# DUEDATE_ in ACT_RU_JOB - -ALTER TABLE ACT_RU_JOB ADD DUEDATE_TEMP_ timestamp null; -UPDATE ACT_RU_JOB SET DUEDATE_TEMP_ = DUEDATE_; -ALTER TABLE ACT_RU_JOB DROP COLUMN DUEDATE_; -ALTER TABLE ACT_RU_JOB CHANGE DUEDATE_TEMP_ DUEDATE_ timestamp null; - - -# CREATE_TIME_ in ACT_RU_TASK - -ALTER TABLE ACT_RU_TASK ADD CREATE_TIME_TEMP_ timestamp; -UPDATE ACT_RU_TASK SET CREATE_TIME_TEMP_ = CREATE_TIME_; -ALTER TABLE ACT_RU_TASK DROP COLUMN CREATE_TIME_; -ALTER TABLE ACT_RU_TASK CHANGE CREATE_TIME_TEMP_ CREATE_TIME_ timestamp; - - -# DUE_DATE_ in ACT_RU_TASK - -ALTER TABLE ACT_RU_TASK ADD DUE_DATE_TEMP_ datetime; -UPDATE ACT_RU_TASK SET DUE_DATE_TEMP_ = DUE_DATE_; -ALTER TABLE ACT_RU_TASK DROP COLUMN DUE_DATE_; -ALTER TABLE ACT_RU_TASK CHANGE DUE_DATE_TEMP_ DUE_DATE_ datetime; - - -# CREATED_ in ACT_RU_EVENT_SUBSCR - -ALTER TABLE ACT_RU_EVENT_SUBSCR ADD CREATED_TEMP_ timestamp not null; -UPDATE ACT_RU_EVENT_SUBSCR SET CREATED_TEMP_ = CREATED_; -ALTER TABLE ACT_RU_EVENT_SUBSCR DROP COLUMN CREATED_; -ALTER TABLE ACT_RU_EVENT_SUBSCR CHANGE CREATED_TEMP_ CREATED_ timestamp not null DEFAULT CURRENT_TIMESTAMP; +alter table ACT_HI_ACTINST + modify ASSIGNEE_ varchar(255); +update ACT_GE_PROPERTY set VALUE_ = '5.15.1' where NAME_ = 'schema.version'; alter table ACT_RU_TASK add FORM_KEY_ varchar(255); @@ -150,16 +101,21 @@ create table ACT_EVT_LOG ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; update ACT_GE_PROPERTY set VALUE_ = '5.16' where NAME_ = 'schema.version'; + +alter table ACT_HI_PROCINST + add NAME_ varchar(255); + update ACT_GE_PROPERTY set VALUE_ = '5.16.1' where NAME_ = 'schema.version'; +update ACT_GE_PROPERTY set VALUE_ = '5.16.2' where NAME_ = 'schema.version'; -- -- Record script finish -- -DELETE FROM alf_applied_patch WHERE id = 'patch.db-Activiti-5.16.2'; +DELETE FROM alf_applied_patch WHERE id = 'patch.db-V5.0-upgrade-to-activiti-5.16.2'; INSERT INTO alf_applied_patch (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report) VALUES ( - 'patch.db-Activiti-5.16.2', 'Manually executed script upgrade V5.0: Upgraded Activiti tables to 5.16.2 version', - 0, 8001, -1, 8002, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed' + 'patch.db-V5.0-upgrade-to-activiti-5.16.2', 'Manually executed script upgrade V5.0: Upgraded Activiti tables to 5.16.2 version', + 0, 8003, -1, 8004, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed' ); \ No newline at end of file diff --git a/config/alfresco/dbscripts/upgrade/5.0/org.hibernate.dialect.PostgreSQLDialect/activiti-upgrade-5-16-2.sql b/config/alfresco/dbscripts/upgrade/5.0/org.hibernate.dialect.PostgreSQLDialect/activiti-upgrade-5-16-2.sql index 3352894cd1..575d8776d1 100644 --- a/config/alfresco/dbscripts/upgrade/5.0/org.hibernate.dialect.PostgreSQLDialect/activiti-upgrade-5-16-2.sql +++ b/config/alfresco/dbscripts/upgrade/5.0/org.hibernate.dialect.PostgreSQLDialect/activiti-upgrade-5-16-2.sql @@ -1,12 +1,12 @@ -- --- Title: Upgraded Activiti tables to 5.16.2 version +-- Title: Upgraded Activiti tables from 5.14 to 5.16.2 version -- Database: PostgreSQL --- Since: V5.0 Schema 8002 --- Author: Mark Rogers +-- Since: V5.0 Schema 8004 +-- Author: Pavel Yurkevich -- -- Please contact support@alfresco.com if you need assistance with the upgrade. -- --- Upgraded Activiti tables to 5.16.2 version +-- Upgraded Activiti tables from 5.14 to 5.16.2 version, sql statements were copied from original activiti jar file. alter table ACT_RU_TASK add CATEGORY_ varchar(255); @@ -69,6 +69,8 @@ alter table ACT_HI_TASKINST alter table ACT_HI_ACTINST alter column ASSIGNEE_ TYPE varchar(255); +update ACT_GE_PROPERTY set VALUE_ = '5.15.1' where NAME_ = 'schema.version'; + alter table ACT_RU_TASK add FORM_KEY_ varchar(255); @@ -92,15 +94,20 @@ create table ACT_EVT_LOG ( update ACT_GE_PROPERTY set VALUE_ = '5.16' where NAME_ = 'schema.version'; +alter table ACT_HI_PROCINST + add NAME_ varchar(255); + +update ACT_GE_PROPERTY set VALUE_ = '5.16.1' where NAME_ = 'schema.version'; +update ACT_GE_PROPERTY set VALUE_ = '5.16.2' where NAME_ = 'schema.version'; -- -- Record script finish -- -DELETE FROM alf_applied_patch WHERE id = 'patch.db-Activiti-5.16.2'; +DELETE FROM alf_applied_patch WHERE id = 'patch.db-V5.0-upgrade-to-activiti-5.16.2'; INSERT INTO alf_applied_patch (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report) VALUES ( - 'patch.db-Activiti-5.16.2', 'Manually executed script upgrade V5.0: Upgraded Activiti tables to 5.16.2 version', - 0, 8001, -1, 8002, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed' + 'patch.db-V5.0-upgrade-to-activiti-5.16.2', 'Manually executed script upgrade V5.0: Upgraded Activiti tables to 5.16.2 version', + 0, 8003, -1, 8004, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed' ); \ No newline at end of file diff --git a/config/alfresco/patch/patch-services-context.xml b/config/alfresco/patch/patch-services-context.xml index f9453a9f80..3c3f12a793 100644 --- a/config/alfresco/patch/patch-services-context.xml +++ b/config/alfresco/patch/patch-services-context.xml @@ -3380,12 +3380,12 @@ - - - + + + - - + + classpath:alfresco/dbscripts/upgrade/5.0/${db.script.dialect}/activiti-upgrade-5-16-2.sql