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

32 lines
1.1 KiB
SQL

--
-- Title: User usage tables
-- Database: PostgreSQL
-- 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 INT8 NOT NULL,
version INT8 NOT NULL,
node_id INT8 NOT NULL,
delta_size INT8 NOT NULL,
PRIMARY KEY (id),
CONSTRAINT fk_alf_usaged_n FOREIGN KEY (node_id) REFERENCES alf_node (id)
); -- (optional)
CREATE INDEX fk_alf_usaged_n ON alf_usage_delta (node_id); -- (optional)
CREATE SEQUENCE alf_usage_delta_seq START WITH 1 INCREMENT BY 1; -- (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'
);