Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-31735: As a Developer I'd like direct upgrade path from 1.13LTS to 2.5LTS #3048

Merged
merged 5 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/update/mysql/dbupdate-5.4.0-to-6.13.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ SET default_storage_engine=InnoDB;
-- Set storage engine schema version number
UPDATE ezsite_data SET value='6.13.0' WHERE name='ezpublish-version';

-- IMPORTANT:
-- * Only covers database schema changes in eZ Platform, for other bundles you use (enterprise or otherwise), see doc!
andrerom marked this conversation as resolved.
Show resolved Hide resolved

--
-- EZP-25880: Make ezuser.login case in-sensitive across databases, using case in-sensitive index
--
Expand Down
251 changes: 251 additions & 0 deletions data/update/mysql/dbupdate-6.13.0-to-7.5.7.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
UPDATE ezsite_data SET value='7.5.7' WHERE name='ezpublish-version';

-- IMPORTANT:
-- * If you use DFS (cluster), also make sure to apply "dbupdate-7.1.0-to-7.2.0-dfs.sql"
-- * Only covers database schema changes in eZ Platform, for other bundles you use (enterprise or otherwise), see doc!


-- 7.1.0/6.13.0 - 7.2.0

--
-- EZP-28950: MySQL UTF8 doesn't support 4-byte chars
-- This shortens indexes so that 4-byte content can fit.
-- After running these, convert the table character set, see doc/upgrade/7.2.md
--

BEGIN;
ALTER TABLE `ezbasket` DROP KEY `ezbasket_session_id`;
ALTER TABLE `ezbasket` ADD KEY `ezbasket_session_id` (`session_id` (191));

ALTER TABLE `ezcollab_group` DROP KEY `ezcollab_group_path`;
ALTER TABLE `ezcollab_group` ADD KEY `ezcollab_group_path` (`path_string` (191));

ALTER TABLE `ezcontent_language` DROP KEY `ezcontent_language_name`;
ALTER TABLE `ezcontent_language` ADD KEY `ezcontent_language_name` (`name` (191));

ALTER TABLE `ezcontentobject_attribute` DROP KEY `sort_key_string`;
ALTER TABLE `ezcontentobject_attribute` ADD KEY `sort_key_string` (`sort_key_string` (191));

ALTER TABLE `ezcontentobject_name` DROP KEY `ezcontentobject_name_name`;
ALTER TABLE `ezcontentobject_name` ADD KEY `ezcontentobject_name_name` (`name` (191));

ALTER TABLE `ezcontentobject_trash` DROP KEY `ezcobj_trash_path`;
ALTER TABLE `ezcontentobject_trash` ADD KEY `ezcobj_trash_path` (`path_string` (191));

ALTER TABLE `ezcontentobject_tree` DROP KEY `ezcontentobject_tree_path`;
ALTER TABLE `ezcontentobject_tree` ADD KEY `ezcontentobject_tree_path` (`path_string` (191));

ALTER TABLE `ezimagefile` DROP KEY `ezimagefile_file`;
ALTER TABLE `ezimagefile` ADD KEY `ezimagefile_file` (`filepath` (191));

ALTER TABLE `ezkeyword` DROP KEY `ezkeyword_keyword`;
ALTER TABLE `ezkeyword` ADD KEY `ezkeyword_keyword` (`keyword` (191));

ALTER TABLE `ezorder_status` DROP KEY `ezorder_status_name`;
ALTER TABLE `ezorder_status` ADD KEY `ezorder_status_name` (`name` (191));

ALTER TABLE `ezpolicy_limitation_value` DROP KEY `ezpolicy_limitation_value_val`;
ALTER TABLE `ezpolicy_limitation_value` ADD KEY `ezpolicy_limitation_value_val` (`value` (191));

ALTER TABLE `ezprest_authcode` DROP PRIMARY KEY;
ALTER TABLE `ezprest_authcode` ADD PRIMARY KEY (`id` (191));

ALTER TABLE `ezprest_authcode` DROP KEY `authcode_client_id`;
ALTER TABLE `ezprest_authcode` ADD KEY `authcode_client_id` (`client_id` (191));

ALTER TABLE `ezprest_clients` DROP KEY `client_id_unique`;
ALTER TABLE `ezprest_clients` ADD UNIQUE KEY `client_id_unique` (`client_id` (191),`version`);

ALTER TABLE `ezprest_token` DROP PRIMARY KEY;
ALTER TABLE `ezprest_token` ADD PRIMARY KEY (`id` (191));

ALTER TABLE `ezprest_token` DROP KEY `token_client_id`;
ALTER TABLE `ezprest_token` ADD KEY `token_client_id` (`client_id` (191));

ALTER TABLE `ezsearch_object_word_link` DROP KEY `ezsearch_object_word_link_identifier`;
ALTER TABLE `ezsearch_object_word_link` ADD KEY `ezsearch_object_word_link_identifier` (`identifier` (191));

ALTER TABLE `ezsearch_search_phrase` DROP KEY `ezsearch_search_phrase_phrase`;
ALTER TABLE `ezsearch_search_phrase` ADD UNIQUE KEY `ezsearch_search_phrase_phrase` (`phrase` (191));

ALTER TABLE `ezurl` DROP KEY `ezurl_url`;
ALTER TABLE `ezurl` ADD KEY `ezurl_url` (`url` (191));

ALTER TABLE `ezurlalias` DROP KEY `ezurlalias_desturl`;
ALTER TABLE `ezurlalias` ADD KEY `ezurlalias_desturl` (`destination_url` (191));

ALTER TABLE `ezurlalias` DROP KEY `ezurlalias_source_url`;
ALTER TABLE `ezurlalias` ADD KEY `ezurlalias_source_url` (`source_url` (191));

--
-- EZP-29146: As a developer, I want a API to manage bookmarks
--

ALTER TABLE `ezcontentbrowsebookmark`
ADD INDEX `ezcontentbrowsebookmark_user_location` (`node_id`, `user_id`);

ALTER TABLE `ezcontentbrowsebookmark`
ADD INDEX `ezcontentbrowsebookmark_location` (`node_id`);

ALTER TABLE `ezcontentbrowsebookmark`
ADD CONSTRAINT `ezcontentbrowsebookmark_location_fk`
FOREIGN KEY (`node_id`)
REFERENCES `ezcontentobject_tree` (`node_id`)
ON DELETE CASCADE
ON UPDATE NO ACTION;

ALTER TABLE `ezcontentbrowsebookmark`
ADD CONSTRAINT `ezcontentbrowsebookmark_user_fk`
FOREIGN KEY (`user_id`)
REFERENCES `ezuser` (`contentobject_id`)
ON DELETE CASCADE
ON UPDATE NO ACTION;

--
-- EZEE-2081: Move NotificationBundle into AdminUI
--

CREATE TABLE IF NOT EXISTS `eznotification` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`owner_id` int(11) NOT NULL DEFAULT 0,
`is_pending` tinyint(1) NOT NULL DEFAULT '1',
`type` varchar(128) NOT NULL DEFAULT '',
`created` int(11) NOT NULL DEFAULT 0,
`data` blob,
PRIMARY KEY (`id`),
KEY `eznotification_owner` (`owner_id`),
KEY `eznotification_owner_is_pending` (`owner_id`, `is_pending`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
andrerom marked this conversation as resolved.
Show resolved Hide resolved

COMMIT;

-- If the queries below fail, it means database is already updated

CREATE INDEX `ezcontentobject_tree_contentobject_id_path_string` ON `ezcontentobject_tree` (`path_string`, `contentobject_id`);
CREATE INDEX `ezcontentobject_section` ON `ezcontentobject` (`section_id`);


-- 7.2.0 - 7.3.0

--
-- EZP-28881: Add a field to support "date object was trashed"
--

ALTER TABLE ezcontentobject_trash add trashed int(11) NOT NULL DEFAULT '0';


-- 7.4.0 - 7.5.0

--
-- EZP-29990 - Add table for multilingual FieldDefinitions
--

DROP TABLE IF EXISTS `ezcontentclass_attribute_ml`;
CREATE TABLE `ezcontentclass_attribute_ml` (
`contentclass_attribute_id` INT NOT NULL,
`version` INT NOT NULL,
`language_id` BIGINT NOT NULL,
`name` VARCHAR(255) NOT NULL,
`description` TEXT NULL,
`data_text` TEXT NULL,
`data_json` TEXT NULL,
PRIMARY KEY (`contentclass_attribute_id`, `version`, `language_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `ezcontentclass_attribute_ml`
ADD CONSTRAINT `ezcontentclass_attribute_ml_lang_fk`
FOREIGN KEY (`language_id`)
REFERENCES `ezcontent_language` (`id`)
ON DELETE CASCADE
ON UPDATE CASCADE;

--
-- EZP-30149: As a Developer I want uniform eznotification DB table definition across all DBMS-es
--

ALTER TABLE `eznotification` MODIFY COLUMN `data` TEXT;

--
-- EZP-30139: As an editor I want to hide and reveal a content item
--

ALTER TABLE `ezcontentobject` ADD COLUMN `is_hidden` tinyint(1) NOT NULL DEFAULT '0';

--
-- EZP-29324: ezcontentobject_tree_contentobject_id_path_string index column size is too large
-- This shortens indexes so that 4-byte content can fit.
--

ALTER TABLE `ezcontentobject_tree` DROP KEY `ezcontentobject_tree_contentobject_id_path_string`;
ALTER TABLE `ezcontentobject_tree` ADD UNIQUE KEY `ezcontentobject_tree_contentobject_id_path_string` (`path_string` (191), `contentobject_id`);


-- 7.5.2 - 7.5.3

--
-- EZP-30571: Legacy storage column size for default TextField value is too short
--

ALTER TABLE ezcontentclass_attribute MODIFY data_text1 VARCHAR(255);

--
-- EZP-30725: Removes content type drafts of non existing users
--

DELETE FROM ezcontentclass
WHERE NOT EXISTS (
SELECT 1 FROM ezuser
WHERE ezuser.contentobject_id = ezcontentclass.modifier_id
) AND ezcontentclass.version = 1;

DELETE FROM ezcontentclass_attribute
WHERE NOT EXISTS (
SELECT 1 FROM ezcontentclass
WHERE ezcontentclass.id = ezcontentclass_attribute.contentclass_id
AND ezcontentclass.version = ezcontentclass_attribute.version
);

DELETE FROM ezcontentclass_attribute_ml
WHERE NOT EXISTS (
SELECT 1 FROM ezcontentclass_attribute
WHERE ezcontentclass_attribute.id = ezcontentclass_attribute_ml.contentclass_attribute_id
AND ezcontentclass_attribute.version = ezcontentclass_attribute_ml.version
);

DELETE FROM ezcontentclass_classgroup
WHERE NOT EXISTS (
SELECT 1 FROM ezcontentclass
WHERE ezcontentclass.id = ezcontentclass_classgroup.contentclass_id
AND ezcontentclass.version = ezcontentclass_classgroup.contentclass_version
);

DELETE FROM ezcontentclass_name
WHERE NOT EXISTS (
SELECT 1 FROM ezcontentclass
WHERE ezcontentclass.id = ezcontentclass_name.contentclass_id
AND ezcontentclass.version = ezcontentclass_name.contentclass_version
);


-- 7.5.4 - 7.5.5

--
-- EZP-30797: As an administrator, I want to configure a password expiration for users
--

ALTER TABLE ezuser ADD COLUMN password_updated_at INT(11) NULL;

UPDATE ezuser SET password_updated_at = UNIX_TIMESTAMP();


-- 7.5.6 - 7.5.7

--
-- EZP-31299: Searching in languages
--

ALTER TABLE `ezsearch_object_word_link`
ADD COLUMN `language_mask` BIGINT NOT NULL DEFAULT 0;

-- SET DEFAULT MASK VALUE SINCE REINDEX
UPDATE `ezsearch_object_word_link` SET `language_mask` = 9223372036854775807;
4 changes: 4 additions & 0 deletions data/update/mysql/dbupdate-7.5.2-to-7.5.3.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
UPDATE ezsite_data SET value='7.5.3' WHERE name='ezpublish-version';

--
-- EZP-30571: Legacy storage column size for default TextField value is too short
--

ALTER TABLE ezcontentclass_attribute MODIFY data_text1 VARCHAR(255);

--
Expand Down
3 changes: 3 additions & 0 deletions data/update/postgres/dbupdate-5.4.0-to-6.13.0.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
-- Set storage engine schema version number
UPDATE ezsite_data SET value='6.13.0' WHERE name='ezpublish-version';

-- IMPORTANT:
-- * Only covers database schema changes in eZ Platform, for other bundles you use (enterprise or otherwise), see doc!
andrerom marked this conversation as resolved.
Show resolved Hide resolved

--
-- EZP-25880: Make ezuser.login case in-sensitive across databases, using case in-sensitive index
--
Expand Down
Loading