From 60a9007e8e707bc3c3787e5112bb86c08308ac75 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Tue, 19 Jan 2010 12:51:53 +0000 Subject: [PATCH] Merged V3.2 to HEAD 17403: ETHREEOH-3288: Corrected SQL statement used to obtain the local name from the qname (two locations) in MySQL upgrade. 17405: ETHREEOH-3255: build 205: unable to upgrade on Oracle. ___________________________________________________________________ Modified: svn:mergeinfo Merged /alfresco/BRANCHES/V3.2:r17403,17405 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18134 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../AlfrescoPostCreate-3.2-AuditTables.sql | 16 +- ...escoPostCreate-3.2-PropertyValueTables.sql | 12 +- .../AlfrescoPostCreate-3.2-AuditTables.sql | 16 +- .../AlfrescoPostCreate-3.2-AvmTables.sql | 12 +- ...escoPostCreate-3.2-PropertyValueTables.sql | 12 +- .../upgrade-from-2.1.sql | 4 +- .../child-assoc-qname-crc.sql | 42 + .../avm-common-SqlMap.xml | 2113 +++++++++-------- .../avm-insert-SqlMap.xml | 33 +- 9 files changed, 1155 insertions(+), 1105 deletions(-) create mode 100755 config/alfresco/dbscripts/upgrade/3.2/org.hibernate.dialect.PostgreSQLDialect/child-assoc-qname-crc.sql diff --git a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql index d3cd626977..df68a02832 100644 --- a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql +++ b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql @@ -13,7 +13,7 @@ CREATE TABLE alf_audit_model content_data_id BIGINT NOT NULL, content_crc BIGINT NOT NULL, UNIQUE INDEX idx_alf_audit_cfg_crc (content_crc), - CONSTRAINT fk_alf_audit_model_cd FOREIGN KEY (content_data_id) REFERENCES alf_content_data (id), + CONSTRAINT fk_alf_aud_mod_cd FOREIGN KEY (content_data_id) REFERENCES alf_content_data (id), PRIMARY KEY (id) ) ENGINE=InnoDB; @@ -24,10 +24,10 @@ CREATE TABLE alf_audit_app app_name_id BIGINT NOT NULL, audit_model_id BIGINT NOT NULL, disabled_paths_id BIGINT NOT NULL, - CONSTRAINT fk_alf_audit_app_app FOREIGN KEY (app_name_id) REFERENCES alf_prop_value (id), - CONSTRAINT UNIQUE idx_alf_audit_app_app (app_name_id), - CONSTRAINT fk_alf_audit_app_model FOREIGN KEY (audit_model_id) REFERENCES alf_audit_model (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_audit_app_dis FOREIGN KEY (disabled_paths_id) REFERENCES alf_prop_root (id), + CONSTRAINT fk_alf_aud_app_app FOREIGN KEY (app_name_id) REFERENCES alf_prop_value (id), + CONSTRAINT UNIQUE id_alf_aud_app_app (app_name_id), + CONSTRAINT fk_alf_aud_app_mod FOREIGN KEY (audit_model_id) REFERENCES alf_audit_model (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_aud_app_dis FOREIGN KEY (disabled_paths_id) REFERENCES alf_prop_root (id), PRIMARY KEY (id) ) ENGINE=InnoDB; @@ -38,10 +38,10 @@ CREATE TABLE alf_audit_entry audit_time BIGINT NOT NULL, audit_user_id BIGINT NULL, audit_values_id BIGINT NULL, - CONSTRAINT fk_alf_audit_ent_app FOREIGN KEY (audit_app_id) REFERENCES alf_audit_app (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_aud_ent_app FOREIGN KEY (audit_app_id) REFERENCES alf_audit_app (id) ON DELETE CASCADE, INDEX idx_alf_audit_ent_time (audit_time), - CONSTRAINT fk_alf_audit_ent_user FOREIGN KEY (audit_user_id) REFERENCES alf_prop_value (id), - CONSTRAINT fk_alf_audit_ent_prop FOREIGN KEY (audit_values_id) REFERENCES alf_prop_root (id), + CONSTRAINT fk_alf_aud_ent_use FOREIGN KEY (audit_user_id) REFERENCES alf_prop_value (id), + CONSTRAINT fk_alf_aud_ent_pro FOREIGN KEY (audit_values_id) REFERENCES alf_prop_root (id), PRIMARY KEY (id) ) ENGINE=InnoDB; diff --git a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql index 45a69b16d7..a6696b2a0a 100644 --- a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql +++ b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql @@ -86,9 +86,9 @@ CREATE TABLE alf_prop_link contained_in BIGINT NOT NULL, key_prop_id BIGINT NOT NULL, value_prop_id BIGINT NOT NULL, - CONSTRAINT fk_alf_prop_link_root FOREIGN KEY (root_prop_id) REFERENCES alf_prop_root (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_prop_link_key FOREIGN KEY (key_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_prop_link_val FOREIGN KEY (value_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_li_root FOREIGN KEY (root_prop_id) REFERENCES alf_prop_root (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_li_key FOREIGN KEY (key_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_li_val FOREIGN KEY (value_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, INDEX idx_alf_prop_link_for (root_prop_id, key_prop_id, value_prop_id), PRIMARY KEY (root_prop_id, contained_in, prop_index) ) ENGINE=InnoDB; @@ -101,9 +101,9 @@ CREATE TABLE alf_prop_unique_ctx value2_prop_id BIGINT NOT NULL, value3_prop_id BIGINT NOT NULL, UNIQUE INDEX idx_alf_prop_unique_ctx (value1_prop_id, value2_prop_id, value3_prop_id), - CONSTRAINT fk_alf_prop_unique_ctx_1 FOREIGN KEY (value1_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_prop_unique_ctx_2 FOREIGN KEY (value2_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_prop_unique_ctx_3 FOREIGN KEY (value3_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_un_ctx_1 FOREIGN KEY (value1_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_un_ctx_2 FOREIGN KEY (value2_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_un_ctx_3 FOREIGN KEY (value3_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, PRIMARY KEY (id) ) ENGINE=InnoDB; diff --git a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-AuditTables.sql b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-AuditTables.sql index e4c5e1dfec..9f8fe75845 100755 --- a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-AuditTables.sql +++ b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-AuditTables.sql @@ -12,7 +12,7 @@ CREATE TABLE alf_audit_model id INT8 NOT NULL, content_data_id INT8 NOT NULL, content_crc INT8 NOT NULL, - CONSTRAINT fk_alf_audit_model_cd FOREIGN KEY (content_data_id) REFERENCES alf_content_data (id), + CONSTRAINT fk_alf_aud_mod_cd FOREIGN KEY (content_data_id) REFERENCES alf_content_data (id), PRIMARY KEY (id) ); CREATE UNIQUE INDEX idx_alf_audit_cfg_crc ON alf_audit_model(content_crc); @@ -23,12 +23,12 @@ CREATE TABLE alf_audit_app ( id INT8 NOT NULL, version INT4 NOT NULL, - app_name_id INT8 NOT NULL CONSTRAINT idx_alf_audit_app_app UNIQUE, + app_name_id INT8 NOT NULL CONSTRAINT id_alf_aud_app_app UNIQUE, audit_model_id INT8 NOT NULL, disabled_paths_id INT8 NOT NULL, - CONSTRAINT fk_alf_audit_app_app FOREIGN KEY (app_name_id) REFERENCES alf_prop_value (id), - CONSTRAINT fk_alf_audit_app_model FOREIGN KEY (audit_model_id) REFERENCES alf_audit_model (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_audit_app_dis FOREIGN KEY (disabled_paths_id) REFERENCES alf_prop_root (id), + CONSTRAINT fk_alf_aud_app_app FOREIGN KEY (app_name_id) REFERENCES alf_prop_value (id), + CONSTRAINT fk_alf_aud_app_mod FOREIGN KEY (audit_model_id) REFERENCES alf_audit_model (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_aud_app_dis FOREIGN KEY (disabled_paths_id) REFERENCES alf_prop_root (id), PRIMARY KEY (id) ); CREATE SEQUENCE alf_audit_app_seq START WITH 1 INCREMENT BY 1; @@ -40,9 +40,9 @@ CREATE TABLE alf_audit_entry audit_time INT8 NOT NULL, audit_user_id INT8 NULL, audit_values_id INT8 NULL, - CONSTRAINT fk_alf_audit_ent_app FOREIGN KEY (audit_app_id) REFERENCES alf_audit_app (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_audit_ent_user FOREIGN KEY (audit_user_id) REFERENCES alf_prop_value (id), - CONSTRAINT fk_alf_audit_ent_prop FOREIGN KEY (audit_values_id) REFERENCES alf_prop_root (id), + CONSTRAINT fk_alf_aud_ent_app FOREIGN KEY (audit_app_id) REFERENCES alf_audit_app (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_aud_ent_use FOREIGN KEY (audit_user_id) REFERENCES alf_prop_value (id), + CONSTRAINT fk_alf_aud_ent_pro FOREIGN KEY (audit_values_id) REFERENCES alf_prop_root (id), PRIMARY KEY (id) ); CREATE INDEX idx_alf_audit_ent_time ON alf_audit_entry(audit_time); diff --git a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-AvmTables.sql b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-AvmTables.sql index 9d13d2343e..cbb02f0ff2 100755 --- a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-AvmTables.sql +++ b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-AvmTables.sql @@ -74,8 +74,7 @@ length INT8, primary key (id) ); - CREATE SEQUENCE avm_nodes_seq START WITH 1 INCREMENT BY 1; - + create table avm_store_properties ( id INT8 not null, avm_store_id INT8, @@ -91,8 +90,7 @@ serializable_value BYTEA, primary key (id) ); - CREATE SEQUENCE avm_store_properties_seq START WITH 1 INCREMENT BY 1; - + create table avm_stores ( id INT8 not null, vers INT8 not null, @@ -102,8 +100,7 @@ acl_id INT8, primary key (id) ); - CREATE SEQUENCE avm_stores_seq START WITH 1 INCREMENT BY 1; - + create table avm_version_layered_node_entry ( version_root_id INT8 not null, md5sum varchar(32) not null, @@ -123,8 +120,7 @@ primary key (id), unique (version_id, avm_store_id) ); - CREATE SEQUENCE avm_version_roots_seq START WITH 1 INCREMENT BY 1; - + alter table avm_aspects add constraint fk_avm_nasp_n foreign key (node_id) diff --git a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql index 0c9f83076d..f52d3ec1e3 100755 --- a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql +++ b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql @@ -96,9 +96,9 @@ CREATE TABLE alf_prop_link contained_in INT8 NOT NULL, key_prop_id INT8 NOT NULL, value_prop_id INT8 NOT NULL, - CONSTRAINT fk_alf_prop_link_root FOREIGN KEY (root_prop_id) REFERENCES alf_prop_root (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_prop_link_key FOREIGN KEY (key_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_prop_link_val FOREIGN KEY (value_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_li_root FOREIGN KEY (root_prop_id) REFERENCES alf_prop_root (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_li_key FOREIGN KEY (key_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_li_val FOREIGN KEY (value_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, PRIMARY KEY (root_prop_id, contained_in, prop_index) ); CREATE INDEX idx_alf_prop_link_for ON alf_prop_link(root_prop_id, key_prop_id, value_prop_id); @@ -110,9 +110,9 @@ CREATE TABLE alf_prop_unique_ctx value1_prop_id INT8 NOT NULL, value2_prop_id INT8 NOT NULL, value3_prop_id INT8 NOT NULL, - CONSTRAINT fk_alf_prop_unique_ctx_1 FOREIGN KEY (value1_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_prop_unique_ctx_2 FOREIGN KEY (value2_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, - CONSTRAINT fk_alf_prop_unique_ctx_3 FOREIGN KEY (value3_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_un_ctx_1 FOREIGN KEY (value1_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_un_ctx_2 FOREIGN KEY (value2_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, + CONSTRAINT fk_alf_pr_un_ctx_3 FOREIGN KEY (value3_prop_id) REFERENCES alf_prop_value (id) ON DELETE CASCADE, PRIMARY KEY (id) ); CREATE UNIQUE INDEX idx_alf_prop_unique_ctx ON alf_prop_unique_ctx(value1_prop_id, value2_prop_id, value3_prop_id); diff --git a/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.1.sql b/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.1.sql index c98065ae26..8f2b9e0f9f 100644 --- a/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.1.sql +++ b/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.1.sql @@ -100,7 +100,7 @@ INSERT INTO t_qnames (qname) -- Extract the namespace and localnames from the QNames UPDATE t_qnames SET namespace = CONCAT('FILLER-', SUBSTR(SUBSTRING_INDEX(qname, '}', 1), 2)); -UPDATE t_qnames SET localname = SUBSTRING_INDEX(qname, '}', -1); +UPDATE t_qnames SET localname = SUBSTRING(qname, INSTR(qname, '}')+1); -- Move the Namespaces to their new home INSERT INTO alf_namespace (uri, version) @@ -172,7 +172,7 @@ UPDATE t_qnames_dyn SET namespace = CONCAT('FILLER-', SUBSTR(SUBSTRING_INDEX(qna -- Extract the Localname -- Query OK, 415312 rows affected (16.22 sec) -UPDATE t_qnames_dyn SET local_name = SUBSTRING_INDEX(qname, '}', -1); +UPDATE t_qnames_dyn SET local_name = SUBSTRING(qname, INSTR(qname, '}')+1); -- Move the namespaces to the their new home -- Query OK, 4 rows affected (34.59 sec) diff --git a/config/alfresco/dbscripts/upgrade/3.2/org.hibernate.dialect.PostgreSQLDialect/child-assoc-qname-crc.sql b/config/alfresco/dbscripts/upgrade/3.2/org.hibernate.dialect.PostgreSQLDialect/child-assoc-qname-crc.sql new file mode 100755 index 0000000000..ab6dd133b5 --- /dev/null +++ b/config/alfresco/dbscripts/upgrade/3.2/org.hibernate.dialect.PostgreSQLDialect/child-assoc-qname-crc.sql @@ -0,0 +1,42 @@ +-- +-- Title: Upgrade to V3.2 - Add qname_crc column to alf_child_assoc +-- Database: PostgreSQL +-- Since: V3.2 schema 2023 +-- Author: Pavel Yurkevich +-- +-- Add qname_crc column to alf_child_assoc and change indexes +-- +-- Please contact support@alfresco.com if you need assistance with the upgrade. +-- + +ALTER TABLE alf_child_assoc + ADD COLUMN qname_crc INT8 NOT NULL DEFAULT 0; + +-- Enable additional patches to run by CRC-ing the descriptor nodes +UPDATE alf_child_assoc + SET qname_crc = 147310537 + WHERE qname_ns_id = (SELECT id FROM alf_namespace WHERE uri = 'http://www.alfresco.org/model/system/1.0') + AND qname_localname = 'descriptor'; + +UPDATE alf_child_assoc + SET qname_crc = 369154895 + WHERE qname_ns_id = (SELECT id FROM alf_namespace WHERE uri = 'http://www.alfresco.org/model/system/1.0') + AND qname_localname = 'descriptor-current'; + +ALTER TABLE alf_child_assoc ALTER COLUMN qname_crc DROP DEFAULT; + +DROP INDEX idx_alf_cass_qnln; + +CREATE INDEX idx_alf_cass_qncrc ON alf_child_assoc (qname_crc, type_qname_id, parent_node_id); + +-- +-- Record script finish +-- +DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.2-Child-Assoc-QName-CRC'; +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-V3.2-Child-Assoc-QName-CRC', 'Manually executed script upgrade V3.2 to Add qname_crc column to alf_child_assoc and change indexes', + 0, 3005, -1, 3006, null, 'UNKOWN', ${TRUE}, ${TRUE}, 'Script completed' + ); diff --git a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml index 93f450d9b2..d62d7d8963 100644 --- a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml +++ b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml @@ -1,1044 +1,1071 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - insert into avm_stores (next_version_id, name, vers, current_root_id, acl_id) - values (#version#, #name#, 0, null, null) - - - - insert into avm_nodes (class_type, deletedType, version_id, vers, store_new_id, acl_id, guid, owner, creator, createDate, lastModifier, modDate, accessDate, is_root, layer_id, indirection, indirection_version, primary_indirection, opacity, content_url, mime_type, encoding, length) - values (#classType#, #deletedType#, #version#, 0, #storeNewId#, #aclId#, #guid#, #owner#, #creator#, #createdDate#, #modifier#, #modifiedDate#, #accessDate#, #isRoot#, #layerId#, #indirection#, #indirectionVersion#, #primaryIndirection#, #opacity#, #contentUrl#, #mimetype#, #encoding#, #length#) - - - - insert into avm_version_roots (avm_store_id, root_id, version_id, creator, create_date, tag, description) - values (#storeId#, #rootNodeId#, #version#, #creator#, #createdDate#, #tag#, #description#) - - - - insert into avm_store_properties (actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value, avm_store_id, qname_id) - values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - - - - - - - - - insert into avm_aspects (node_id, qname_id) - values (#nodeId#, #qnameId#) - - - - insert into avm_child_entries (parent_id, name, child_id) - values (#parentNodeId#, #name#, #childNodeId#) - - - - insert into avm_history_links (ancestor, descendent) - values (#ancestorNodeId#, #descendentNodeId#) - - - - insert into avm_merge_links (mfrom, mto) - values (#mergeFromNodeId#, #mergeToNodeId#) - - - - insert into avm_version_layered_node_entry (version_root_id, md5sum, path) - values (#versionRootId#, #md5sum#, #path#) - - - - insert into avm_node_properties (actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value, node_id, qname_id) - values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - - - - - - - - - - - - - - - - - - - - - update - avm_stores - set - next_version_id = #nextVersion#, - name = #name#, - current_root_id = #rootNodeId#, - acl_id = #aclId#, - vers = #vers# - where - id = #id# - - and vers = (#vers#-1) - - - - - - delete - from - avm_stores - where - id = ? - - - - - - - - - - - - - - - - - update - avm_store_properties - set - actual_type_n = ?, - persisted_type_n = ?, - multi_valued = ?, - boolean_value = ?, - long_value = ?, - float_value = ?, - double_value = ?, - string_value = ?, - serializable_value = ? - where - avm_store_id = ? and - qname_id = ? - - - - delete - from - avm_store_properties - where - avm_store_id = #avmStoreId# and - qname_id = #qnameId# - - - - delete - from - avm_store_properties - where - avm_store_id = ? - - - - - - - - - - - - - - - - - - - - - - - - update - avm_nodes - set - store_new_id = null - where - store_new_id = ? - - - - - update - avm_nodes - set - store_new_id = #storeNewId#, - acl_id = #aclId#, - layer_id = #layerId#, - version_id = #version#, - class_type = #classType#, - deletedType = #deletedType#, - owner = #owner#, - modDate = #modifiedDate#, - accessDate = #accessDate#, - is_root = #isRoot#, - lastModifier = #modifier#, - indirection = #indirection#, - indirection_version = #indirectionVersion#, - primary_indirection = #primaryIndirection#, - opacity = #opacity#, - content_url = #contentUrl#, - mime_type = #mimetype#, - encoding = #encoding#, - length = #length#, - guid = #guid#, - vers = #vers# - where - id = #id# - - and vers = (#vers#-1) - - - - - update - avm_nodes - set - modDate = #modifiedDate#, - guid = #guid#, - vers = #vers# - where - id = #id# - - and vers = (#vers#-1) - - - - - update - avm_nodes - set - modDate = #modifiedDate#, - content_url = #contentUrl#, - mime_type = #mimetype#, - encoding = #encoding#, - length = #length#, - vers = #vers# - where - id = #id# - - and vers = (#vers#-1) - - - - - delete - from - avm_nodes - where - id = ? - - - - - - - - - - - - - update - avm_node_properties - set - actual_type_n = ?, - persisted_type_n = ?, - multi_valued = ?, - boolean_value = ?, - long_value = ?, - float_value = ?, - double_value = ?, - string_value = ?, - serializable_value = ? - where - node_id = ? and - qname_id = ? - - - - delete - from - avm_node_properties - where - node_id = #nodeId# and - qname_id = #qnameId# - - - - delete - from - avm_node_properties - where - node_id = ? - - - - - - - - - - - - - - - - - - - - - - - - - - - update - avm_version_roots - set - tag = #tag#, - description = #description# - where - id = #id# - - - - delete - from - avm_version_roots - where - id = ? - - - - - - - - - - delete - from - avm_version_layered_node_entry - where - version_root_id = ? - - - - - - - - - - - - delete - from - avm_aspects - where - node_id = #nodeId# and - qname_id = #qnameId# - - - - delete - from - avm_aspects - where - node_id = ? - - - - - - - - - - - - - - - - - - - - - - - - - - - delete - from - avm_child_entries - where - parent_id = #parentNodeId# and - name = #name# and - child_id = #childNodeId# - - - - - delete - from - avm_child_entries - where - parent_id = #parentNodeId# and - name = #name# - - - - - delete - from - avm_child_entries - where - parent_id = #parentNodeId# and - child_id = #childNodeId# - - - - - delete - from - avm_child_entries - where - parent_id = ? - - - - - - - - - - - - - - delete - from - avm_merge_links - where - mfrom = #mergeFromNodeId# and - mto = #mergeToNodeId# - - - - - - - - - - - - - - delete - from - avm_history_links - where - ancestor = #ancestorNodeId# and - descendent = #descendentNodeId# - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into avm_stores (next_version_id, name, vers, current_root_id, acl_id) + values (#version#, #name#, 0, null, null) + + + + insert into avm_nodes (class_type, deletedType, version_id, vers, store_new_id, acl_id, guid, owner, creator, createDate, lastModifier, modDate, accessDate, is_root, layer_id, indirection, indirection_version, primary_indirection, opacity, content_url, mime_type, encoding, length) + values (#classType#, #deletedType#, #version#, 0, #storeNewId#, #aclId#, #guid#, #owner#, #creator#, #createdDate#, #modifier#, #modifiedDate#, #accessDate#, #isRoot#, #layerId#, #indirection#, #indirectionVersion#, #primaryIndirection#, #opacity#, #contentUrl#, #mimetype#, #encoding#, #length#) + + + + insert into avm_version_roots (avm_store_id, root_id, version_id, creator, create_date, tag, description) + values (#storeId#, #rootNodeId#, #version#, #creator#, #createdDate#, #tag#, #description#) + + + + insert into avm_store_properties (actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value, avm_store_id, qname_id) + values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + + + + + + + + + insert into avm_aspects (node_id, qname_id) + values (#nodeId#, #qnameId#) + + + + insert into avm_child_entries (parent_id, name, child_id) + values (#parentNodeId#, #name#, #childNodeId#) + + + + insert into avm_history_links (ancestor, descendent) + values (#ancestorNodeId#, #descendentNodeId#) + + + + insert into avm_merge_links (mfrom, mto) + values (#mergeFromNodeId#, #mergeToNodeId#) + + + + insert into avm_version_layered_node_entry (version_root_id, md5sum, path) + values (#versionRootId#, #md5sum#, #path#) + + + + insert into avm_node_properties (actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value, node_id, qname_id) + values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + + + + + + + + + + + + + + + + + + + + + update + avm_stores + set + next_version_id = ?, + name = ?, + current_root_id = ?, + acl_id = ?, + vers = ? + where + id = ? + + + + + delete + from + avm_stores + where + id = ? + + + + + + + + + + + + + + + + + update + avm_store_properties + set + actual_type_n = ?, + persisted_type_n = ?, + multi_valued = ?, + boolean_value = ?, + long_value = ?, + float_value = ?, + double_value = ?, + string_value = ?, + serializable_value = ? + where + avm_store_id = ? and + qname_id = ? + + + + delete + from + avm_store_properties + where + avm_store_id = #avmStoreId# and + qname_id = #qnameId# + + + + delete + from + avm_store_properties + where + avm_store_id = ? + + + + + + + + + + + + + + + + + + + + + + + + update + avm_nodes + set + store_new_id = null + where + store_new_id = ? + + + + + update + avm_nodes + set + store_new_id = ?, + acl_id = ?, + layer_id = ?, + version_id = ?, + class_type = ?, + deletedType = ?, + owner = ?, + modDate = ?, + accessDate = ?, + is_root = ?, + lastModifier = ?, + indirection = ?, + indirection_version = ?, + primary_indirection = ?, + opacity = ?, + content_url = ?, + mime_type = ?, + encoding = ?, + length = ?, + guid = ?, + vers = ? + where + id = ? + + + + update + avm_nodes + set + modDate = #modifiedDate#, + guid = #guid#, + vers = #vers# + where + id = #id# + + and vers = (#vers#-1) + + + + + update + avm_nodes + set + modDate = #modifiedDate#, + content_url = #contentUrl#, + mime_type = #mimetype#, + encoding = #encoding#, + length = #length#, + vers = #vers# + where + id = #id# + + and vers = (#vers#-1) + + + + + delete + from + avm_nodes + where + id = ? + + + + + + + + + + + + + update + avm_node_properties + set + actual_type_n = ?, + persisted_type_n = ?, + multi_valued = ?, + boolean_value = ?, + long_value = ?, + float_value = ?, + double_value = ?, + string_value = ?, + serializable_value = ? + where + node_id = ? and + qname_id = ? + + + + delete + from + avm_node_properties + where + node_id = #nodeId# and + qname_id = #qnameId# + + + + delete + from + avm_node_properties + where + node_id = ? + + + + + + + + + + + + + + + + + + + + + + + + + + + update + avm_version_roots + set + tag = #tag#, + description = #description# + where + id = #id# + + + + delete + from + avm_version_roots + where + id = ? + + + + + + + + + + delete + from + avm_version_layered_node_entry + where + version_root_id = ? + + + + + + + + + + + + delete + from + avm_aspects + where + node_id = #nodeId# and + qname_id = #qnameId# + + + + delete + from + avm_aspects + where + node_id = ? + + + + + + + + + + + + + + + + + + + + + + + + + + + delete + from + avm_child_entries + where + parent_id = #parentNodeId# and + name = #name# and + child_id = #childNodeId# + + + + + delete + from + avm_child_entries + where + parent_id = #parentNodeId# and + name = #name# + + + + + delete + from + avm_child_entries + where + parent_id = #parentNodeId# and + child_id = #childNodeId# + + + + + delete + from + avm_child_entries + where + parent_id = ? + + + + + + + + + + + + + + delete + from + avm_merge_links + where + mfrom = #mergeFromNodeId# and + mto = #mergeToNodeId# + + + + + + + + + + + + + + delete + from + avm_history_links + where + ancestor = #ancestorNodeId# and + descendent = #descendentNodeId# + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/alfresco/ibatis/org.hibernate.dialect.PostgreSQLDialect/avm-insert-SqlMap.xml b/config/alfresco/ibatis/org.hibernate.dialect.PostgreSQLDialect/avm-insert-SqlMap.xml index 756666a00b..8684060d5c 100755 --- a/config/alfresco/ibatis/org.hibernate.dialect.PostgreSQLDialect/avm-insert-SqlMap.xml +++ b/config/alfresco/ibatis/org.hibernate.dialect.PostgreSQLDialect/avm-insert-SqlMap.xml @@ -4,27 +4,12 @@ PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> - - - - - - - - - - - - - - - - - + + - select nextVal('avm_stores_seq') + select nextVal('hibernate_sequence') insert into avm_stores (id, next_version_id, name, vers, current_root_id, acl_id) @@ -32,21 +17,21 @@ - + - - select avm_store_properties_seq.nextval as value from dual + + select nextVal('hibernate_sequence') insert into avm_store_properties (id, actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value, avm_store_id, qname_id) - values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + values (#id#, #actualType#, #persistedType#, #isMultiValued#, #booleanValue#, #longValue#, #floatValue#, #doubleValue#, #stringValue#, #serializableValue#, #avmStoreId#, #qnameId#) - select nextVal('avm_nodes_seq') + select nextVal('hibernate_sequence') insert into avm_nodes (id, class_type, deletedType, version_id, vers, store_new_id, acl_id, guid, owner, creator, createDate, lastModifier, modDate, accessDate, is_root, layer_id, indirection, indirection_version, primary_indirection, opacity, content_url, mime_type, encoding, length) @@ -57,7 +42,7 @@ - select nextVal('avm_version_roots_seq') + select nextVal('hibernate_sequence') insert into avm_version_roots (id, avm_store_id, root_id, version_id, creator, create_date, tag, description)