mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Better fix for ALF-4431: Upgrade fails to create UsageDelta tables
- Investigation of previous attempt showed that the use of 'alternatives' was not going to work here - Pulled out all 'alf_usage_delta' creations from other upgrade scripts - Removed alternatives from patch 'patch.db-V3.4-UsageTables' - Added '--(optional)' at various locations to keep things sane - Tested 2.1.7, 2.2.x and clean bootstrap on MySQL git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21979 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -445,39 +445,6 @@ INSERT INTO t_alf_node_assoc
|
||||
DROP TABLE alf_node_assoc;
|
||||
ALTER TABLE t_alf_node_assoc RENAME TO alf_node_assoc;
|
||||
|
||||
-- ----------------------------
|
||||
-- Populate the Usage Deltas --
|
||||
-- ----------------------------
|
||||
|
||||
CREATE TABLE t_alf_usage_delta
|
||||
(
|
||||
id BIGINT NOT NULL AUTO_INCREMENT,
|
||||
version BIGINT NOT NULL,
|
||||
node_id BIGINT NOT NULL,
|
||||
delta_size BIGINT NOT NULL,
|
||||
INDEX fk_alf_usaged_n (node_id),
|
||||
CONSTRAINT fk_alf_usaged_n FOREIGN KEY (node_id) REFERENCES t_alf_node (id),
|
||||
PRIMARY KEY (id)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
INSERT INTO t_alf_usage_delta
|
||||
(
|
||||
id, version,
|
||||
node_id,
|
||||
delta_size
|
||||
)
|
||||
SELECT
|
||||
ud.id, 1,
|
||||
ud.node_id,
|
||||
ud.delta_size
|
||||
FROM
|
||||
alf_usage_delta ud
|
||||
; -- (optional)
|
||||
|
||||
-- Clean up
|
||||
DROP TABLE alf_usage_delta; -- (optional)
|
||||
ALTER TABLE t_alf_usage_delta RENAME TO alf_usage_delta;
|
||||
|
||||
-- -----------------------------
|
||||
-- Populate the Node Aspects --
|
||||
-- -----------------------------
|
||||
|
Reference in New Issue
Block a user