Derek Hulley df45c7cb23 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
2010-08-25 01:46:20 +00:00

31 lines
1.0 KiB
SQL

--
-- Title: User usage tables
-- Database: MySQL InnoDB
-- Since: V3.4 Schema 4110
-- Author: Derek Hulley
--
-- Please contact support@alfresco.com if you need assistance with the upgrade.
--
CREATE TABLE alf_usage_delta
(
id BIGINT NOT NULL AUTO_INCREMENT,
version BIGINT NOT NULL,
node_id BIGINT NOT NULL,
delta_size BIGINT NOT NULL,
PRIMARY KEY (id),
KEY fk_alf_usaged_n (node_id),
CONSTRAINT fk_alf_usaged_n FOREIGN KEY (node_id) REFERENCES alf_node (id)
) ENGINE=InnoDB; -- (optional)
--
-- Record script finish
--
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.4-UsageTables';
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.4-UsageTables', 'Manually executed script upgrade V3.4: Usage Tables',
0, 113, -1, 114, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
);