mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fix for AR-1432: Patches for FK indexes
Fix for AR-1433: Upgrade failures on PostgreSQL Partial fix for AR-160: Concurrency fix for version counter Partial fix for AR-1483: Synchronization issues This is an overhaul of the current state of the upgrade scripts. All redundant scripts have been ripped out and replaced with fresh 2.1 scripts. Indexes for FK relationships have been put in place where required. Several edge cases have been dealt with including columns being added to two indexes, Sybase not allowing column additions for NOT NULL columns of certain types, etc. These changes have been tested for 1.4.0 -> 2.0 -> 2.1 on MySQL Oracle Sybase PostgreSQL Found a bug in the VersionCounter Hibernate classes where the optimistic version support was not implemented. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6216 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
--
|
||||
-- Title: AVM Foreign Key indexes
|
||||
-- Database: PostgreSQL
|
||||
-- Since: V2.0 Schema 38
|
||||
-- Author: Derek Hulley
|
||||
--
|
||||
-- Please contact support@alfresco.com if you need assistance with the upgrade.
|
||||
--
|
||||
|
||||
CREATE INDEX fk_avm_asp_node ON avm_aspects (node_id);
|
||||
CREATE INDEX fk_avm_ce_child ON avm_child_entries (child_id);
|
||||
CREATE INDEX fk_avm_ce_parent ON avm_child_entries (parent_id);
|
||||
CREATE INDEX fk_avm_hl_desc ON avm_history_links (descendent);
|
||||
CREATE INDEX fk_avm_hl_ancestor ON avm_history_links (ancestor);
|
||||
CREATE INDEX fk_avm_ml_from ON avm_merge_links (mfrom);
|
||||
CREATE INDEX fk_avm_ml_to ON avm_merge_links (mto);
|
||||
CREATE INDEX fk_avm_np_node ON avm_node_properties (node_id);
|
||||
CREATE INDEX fk_avm_n_acl ON avm_nodes (acl_id);
|
||||
CREATE INDEX fk_avm_n_store ON avm_nodes (store_new_id);
|
||||
CREATE INDEX fk_avm_sp_store ON avm_store_properties (avm_store_id);
|
||||
CREATE INDEX fk_avm_s_root ON avm_stores (current_root_id);
|
||||
CREATE INDEX fk_avm_vr_store ON avm_version_roots (avm_store_id);
|
||||
CREATE INDEX fk_avm_vr_root ON avm_version_roots (root_id);
|
||||
|
||||
--
|
||||
-- Record script finish
|
||||
--
|
||||
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V2.0-AVMFKIndexes';
|
||||
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-V2.0-AVMFKIndexes', 'Manually executed script upgrade V2.0: AVM Foreign Key Indexes',
|
||||
0, 37, -1, 38, null, 'UNKOWN', TRUE, TRUE, 'Script completed'
|
||||
);
|
@@ -1,66 +0,0 @@
|
||||
--
|
||||
-- Title: Explicit indexes
|
||||
-- Database: PostgreSQL
|
||||
-- Since: V2.0 Schema 38
|
||||
-- Author: Derek Hulley
|
||||
--
|
||||
-- Please contact support@alfresco.com if you need assistance with the upgrade.
|
||||
--
|
||||
-- PostgreSQL cannot handle optional statements (statements that may fail) in the
|
||||
-- transaction.
|
||||
--
|
||||
|
||||
-- JBPM tables
|
||||
DROP INDEX IF EXISTS IDX_PLDACTR_ACTID;
|
||||
CREATE INDEX IDX_PLDACTR_ACTID ON JBPM_POOLEDACTOR (ACTORID_);
|
||||
DROP INDEX IF EXISTS IDX_TASK_ACTORID;
|
||||
CREATE INDEX IDX_TASK_ACTORID ON JBPM_TASKINSTANCE (ACTORID_);
|
||||
|
||||
-- Audit tables
|
||||
DROP INDEX IF EXISTS adt_q_idx;
|
||||
CREATE INDEX adt_q_idx ON alf_audit_date (quarter);
|
||||
DROP INDEX IF EXISTS adt_dow_idx;
|
||||
CREATE INDEX adt_dow_idx ON alf_audit_date (day_of_week);
|
||||
DROP INDEX IF EXISTS adt_date_idx;
|
||||
CREATE INDEX adt_date_idx ON alf_audit_date (date_only);
|
||||
DROP INDEX IF EXISTS adt_y_idx;
|
||||
CREATE INDEX adt_y_idx ON alf_audit_date (year);
|
||||
DROP INDEX IF EXISTS adt_hy_idx;
|
||||
CREATE INDEX adt_hy_idx ON alf_audit_date (halfYear);
|
||||
DROP INDEX IF EXISTS adt_wom_idx;
|
||||
CREATE INDEX adt_wom_idx ON alf_audit_date (week_of_month);
|
||||
DROP INDEX IF EXISTS adt_dom_idx;
|
||||
CREATE INDEX adt_dom_idx ON alf_audit_date (day_of_month);
|
||||
DROP INDEX IF EXISTS adt_m_idx;
|
||||
CREATE INDEX adt_m_idx ON alf_audit_date (month);
|
||||
DROP INDEX IF EXISTS adt_doy_idx;
|
||||
CREATE INDEX adt_doy_idx ON alf_audit_date (day_of_year);
|
||||
DROP INDEX IF EXISTS adt_woy_idx;
|
||||
CREATE INDEX adt_woy_idx ON alf_audit_date (week_of_year);
|
||||
DROP INDEX IF EXISTS adt_user_idx;
|
||||
CREATE INDEX adt_user_idx ON alf_audit_fact (user_id);
|
||||
DROP INDEX IF EXISTS adt_store_idx;
|
||||
CREATE INDEX adt_store_idx ON alf_audit_fact (store_protocol, store_id, node_uuid);
|
||||
DROP INDEX IF EXISTS app_source_met_idx;
|
||||
CREATE INDEX app_source_met_idx ON alf_audit_source (method);
|
||||
DROP INDEX IF EXISTS app_source_app_idx;
|
||||
CREATE INDEX app_source_app_idx ON alf_audit_source (application);
|
||||
DROP INDEX IF EXISTS app_source_ser_idx;
|
||||
CREATE INDEX app_source_ser_idx ON alf_audit_source (service);
|
||||
|
||||
-- AVM tables: These are new so are not optional
|
||||
CREATE INDEX idx_avm_np_name ON avm_node_properties (qname);
|
||||
CREATE INDEX idx_avm_sp_name ON avm_store_properties (qname);
|
||||
CREATE INDEX idx_avm_vr_version ON avm_version_roots (version_id);
|
||||
|
||||
--
|
||||
-- Record script finish
|
||||
--
|
||||
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V2.0-ExplicitIndexes';
|
||||
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-V2.0-ExplicitIndexes', 'Manually executed script upgrade V2.0: Explicit Indexes',
|
||||
0, 37, -1, 38, null, 'UNKOWN', TRUE, TRUE, 'Script completed'
|
||||
);
|
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* Solution to PostgreSQL issue:
|
||||
* function information_schema._pg_keypositions() does not exist
|
||||
* Taken from: http://archives.postgresql.org/pgsql-general/2005-12/msg00060.php
|
||||
* Author: Jason Long
|
||||
* Tested against PostgreSQL 8.2
|
||||
* First seen during upgrade testing of PostgreSQL from Alfresco 1.4.3 to 2.0
|
||||
*/
|
||||
SET search_path TO information_schema, public;
|
||||
CREATE FUNCTION _pg_keypositions() RETURNS SETOF integer
|
||||
LANGUAGE sql
|
||||
IMMUTABLE
|
||||
AS 'select g.s
|
||||
from generate_series(1,current_setting(''max_index_keys'')::int,1)
|
||||
as g(s)';
|
Reference in New Issue
Block a user