Skip to content

Commit 4978aca

Browse files
authored
Added update scripts for Open Source (#2850)
* Added update scripts for Open Source * Update docs/update_and_migration/from_4.6/update_to_5.0.md
1 parent 8afe3f3 commit 4978aca

File tree

3 files changed

+553
-0
lines changed

3 files changed

+553
-0
lines changed
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
-- Rename core related schema
2+
ALTER TABLE ezbinaryfile RENAME TO ibexa_binary_file;
3+
4+
ALTER TABLE ezcobj_state RENAME TO ibexa_object_state;
5+
ALTER TABLE ibexa_object_state RENAME INDEX ezcobj_state_priority TO ibexa_object_state_priority;
6+
ALTER TABLE ibexa_object_state RENAME INDEX ezcobj_state_lmask TO ibexa_object_state_lmask;
7+
ALTER TABLE ibexa_object_state RENAME INDEX ezcobj_state_identifier TO ibexa_object_state_identifier;
8+
9+
ALTER TABLE ezcobj_state_group RENAME TO ibexa_object_state_group;
10+
ALTER TABLE ibexa_object_state_group RENAME INDEX ezcobj_state_group_lmask TO ibexa_object_state_group_lmask;
11+
ALTER TABLE ibexa_object_state_group RENAME INDEX ezcobj_state_group_identifier TO ibexa_object_state_group_identifier;
12+
13+
ALTER TABLE ezcobj_state_group_language RENAME TO ibexa_object_state_group_language;
14+
15+
ALTER TABLE ezcobj_state_language RENAME TO ibexa_object_state_language;
16+
17+
ALTER TABLE ezcobj_state_link RENAME TO ibexa_object_state_link;
18+
19+
ALTER TABLE ezcontent_language RENAME TO ibexa_content_language;
20+
ALTER TABLE ibexa_content_language RENAME INDEX ezcontent_language_name TO ibexa_content_language_name;
21+
22+
ALTER TABLE ezcontentbrowsebookmark RENAME TO ibexa_content_bookmark;
23+
ALTER TABLE ibexa_content_bookmark RENAME INDEX ezcontentbrowsebookmark_location TO ibexa_content_bookmark_location;
24+
ALTER TABLE ibexa_content_bookmark RENAME INDEX ezcontentbrowsebookmark_user TO ibexa_content_bookmark_user;
25+
ALTER TABLE ibexa_content_bookmark RENAME INDEX ezcontentbrowsebookmark_user_location TO ibexa_content_bookmark_user_location;
26+
27+
ALTER TABLE ezcontentclass RENAME TO ibexa_content_type;
28+
ALTER TABLE ibexa_content_type RENAME INDEX ezcontentclass_version TO ibexa_content_type_version;
29+
ALTER TABLE ibexa_content_type RENAME INDEX ezcontentclass_identifier TO ibexa_content_type_identifier;
30+
31+
ALTER TABLE ezcontentclass_attribute RENAME TO ibexa_content_type_field_definition;
32+
ALTER TABLE ibexa_content_type_field_definition RENAME INDEX ezcontentclass_attr_ccid TO ibexa_content_type_field_definition_ct_id;
33+
ALTER TABLE ibexa_content_type_field_definition RENAME INDEX ezcontentclass_attr_dts TO ibexa_content_type_field_definition_dts;
34+
35+
ALTER TABLE ezcontentclass_attribute_ml RENAME TO ibexa_content_type_field_definition_ml;
36+
ALTER TABLE ibexa_content_type_field_definition_ml DROP FOREIGN KEY ezcontentclass_attribute_ml_lang_fk;
37+
ALTER TABLE ibexa_content_type_field_definition_ml ADD CONSTRAINT ibexa_content_type_field_definition_ml_lang_fk FOREIGN KEY (language_id) REFERENCES ibexa_content_language(id) ON DELETE CASCADE ON UPDATE CASCADE;
38+
39+
ALTER TABLE ezcontentclass_classgroup RENAME TO ibexa_content_type_group_assignment;
40+
41+
ALTER TABLE ezcontentclass_name RENAME TO ibexa_content_type_name;
42+
43+
ALTER TABLE ezcontentclassgroup RENAME TO ibexa_content_type_group;
44+
45+
ALTER TABLE ezcontentobject_tree RENAME TO ibexa_content_tree;
46+
ALTER TABLE ibexa_content_tree RENAME INDEX ezcontentobject_tree_p_node_id TO ibexa_content_tree_p_node_id;
47+
ALTER TABLE ibexa_content_tree RENAME INDEX ezcontentobject_tree_path_ident TO ibexa_content_tree_path_ident;
48+
ALTER TABLE ibexa_content_tree RENAME INDEX ezcontentobject_tree_contentobject_id_path_string TO ibexa_content_tree_contentobject_id_path_string;
49+
ALTER TABLE ibexa_content_tree RENAME INDEX ezcontentobject_tree_co_id TO ibexa_content_tree_co_id;
50+
ALTER TABLE ibexa_content_tree RENAME INDEX ezcontentobject_tree_depth TO ibexa_content_tree_depth;
51+
ALTER TABLE ibexa_content_tree RENAME INDEX ezcontentobject_tree_path TO ibexa_content_tree_path;
52+
ALTER TABLE ibexa_content_tree RENAME INDEX modified_subnode TO ibexa_content_modified_subnode;
53+
ALTER TABLE ibexa_content_tree RENAME INDEX ezcontentobject_tree_remote_id TO ibexa_content_tree_remote_id;
54+
55+
ALTER TABLE ibexa_content_bookmark DROP FOREIGN KEY ezcontentbrowsebookmark_location_fk;
56+
ALTER TABLE ibexa_content_bookmark ADD CONSTRAINT ibexa_content_bookmark_location_fk FOREIGN KEY (node_id) REFERENCES ibexa_content_tree(node_id) ON DELETE CASCADE;
57+
58+
ALTER TABLE ezcontentobject RENAME TO ibexa_content;
59+
ALTER TABLE ibexa_content RENAME INDEX ezcontentobject_classid TO ibexa_content_type_id;
60+
ALTER TABLE ibexa_content RENAME INDEX ezcontentobject_lmask TO ibexa_content_lmask;
61+
ALTER TABLE ibexa_content RENAME INDEX ezcontentobject_pub TO ibexa_content_pub;
62+
ALTER TABLE ibexa_content RENAME INDEX ezcontentobject_section TO ibexa_content_section;
63+
ALTER TABLE ibexa_content RENAME INDEX ezcontentobject_currentversion TO ibexa_content_currentversion;
64+
ALTER TABLE ibexa_content RENAME INDEX ezcontentobject_owner TO ibexa_content_owner;
65+
ALTER TABLE ibexa_content RENAME INDEX ezcontentobject_status TO ibexa_content_status;
66+
ALTER TABLE ibexa_content RENAME INDEX ezcontentobject_remote_id TO ibexa_content_remote_id;
67+
68+
ALTER TABLE ezcontentobject_attribute RENAME TO ibexa_content_field;
69+
ALTER TABLE ibexa_content_field RENAME INDEX ezcontentobject_attribute_co_id_ver_lang_code TO ibexa_content_field_co_id_ver_lang_code;
70+
ALTER TABLE ibexa_content_field RENAME INDEX ezcontentobject_classattr_id TO ibexa_content_field_classattr_id;
71+
ALTER TABLE ibexa_content_field RENAME INDEX ezcontentobject_attribute_language_code TO ibexa_content_field_language_code;
72+
ALTER TABLE ibexa_content_field RENAME INDEX ezcontentobject_attribute_co_id_ver TO ibexa_content_field_co_id_ver;
73+
74+
ALTER TABLE ezcontentobject_link RENAME TO ibexa_content_relation;
75+
ALTER TABLE ibexa_content_relation RENAME INDEX ezco_link_to_co_id TO ibexa_content_relation_to_co_id;
76+
ALTER TABLE ibexa_content_relation RENAME INDEX ezco_link_from TO ibexa_content_relation_from;
77+
ALTER TABLE ibexa_content_relation RENAME INDEX ezco_link_cca_id TO ibexa_content_relation_cca_id;
78+
79+
ALTER TABLE ezcontentobject_name RENAME TO ibexa_content_name;
80+
ALTER TABLE ibexa_content_name RENAME INDEX ezcontentobject_name_lang_id TO ibexa_content_name_lang_id;
81+
ALTER TABLE ibexa_content_name RENAME INDEX ezcontentobject_name_cov_id TO ibexa_content_name_cov_id;
82+
ALTER TABLE ibexa_content_name RENAME INDEX ezcontentobject_name_name TO ibexa_content_name_name;
83+
84+
ALTER TABLE ezcontentobject_trash RENAME TO ibexa_content_trash;
85+
ALTER TABLE ibexa_content_trash RENAME INDEX ezcobj_trash_depth TO ibexa_content_trash_depth;
86+
ALTER TABLE ibexa_content_trash RENAME INDEX ezcobj_trash_p_node_id TO ibexa_content_trash_p_node_id;
87+
ALTER TABLE ibexa_content_trash RENAME INDEX ezcobj_trash_path_ident TO ibexa_content_trash_path_ident;
88+
ALTER TABLE ibexa_content_trash RENAME INDEX ezcobj_trash_co_id TO ibexa_content_trash_co_id;
89+
ALTER TABLE ibexa_content_trash RENAME INDEX ezcobj_trash_modified_subnode TO ibexa_content_trash_modified_subnode;
90+
ALTER TABLE ibexa_content_trash RENAME INDEX ezcobj_trash_path TO ibexa_content_trash_path;
91+
92+
ALTER TABLE ezcontentobject_version RENAME TO ibexa_content_version;
93+
ALTER TABLE ibexa_content_version RENAME INDEX ezcobj_version_status TO ibexa_content_version_status;
94+
ALTER TABLE ibexa_content_version RENAME INDEX idx_object_version_objver TO ibexa_content_version_idx_ver;
95+
ALTER TABLE ibexa_content_version RENAME INDEX ezcontobj_version_obj_status TO ibexa_content_version_idx_status;
96+
ALTER TABLE ibexa_content_version RENAME INDEX ezcobj_version_creator_id TO ibexa_content_version_creator_id;
97+
98+
ALTER TABLE ezdfsfile RENAME TO ibexa_dfs_file;
99+
ALTER TABLE ibexa_dfs_file RENAME INDEX ezdfsfile_name_trunk TO ibexa_dfs_file_name_trunk;
100+
ALTER TABLE ibexa_dfs_file RENAME INDEX ezdfsfile_expired_name TO ibexa_dfs_file_expired_name;
101+
ALTER TABLE ibexa_dfs_file RENAME INDEX ezdfsfile_name TO ibexa_dfs_file_name;
102+
ALTER TABLE ibexa_dfs_file RENAME INDEX ezdfsfile_mtime TO ibexa_dfs_file_mtime;
103+
104+
ALTER TABLE ezgmaplocation RENAME TO ibexa_map_location;
105+
ALTER TABLE ibexa_map_location RENAME INDEX latitude_longitude_key TO ibexa_map_location_latitude_longitude_key;
106+
107+
ALTER TABLE ezimagefile RENAME TO ibexa_image_file;
108+
ALTER TABLE ibexa_image_file RENAME INDEX ezimagefile_file TO ibexa_image_file_file;
109+
ALTER TABLE ibexa_image_file RENAME INDEX ezimagefile_coid TO ibexa_image_file_coid;
110+
111+
ALTER TABLE ezkeyword RENAME TO ibexa_keyword;
112+
ALTER TABLE ibexa_keyword RENAME INDEX ezkeyword_keyword TO ibexa_keyword_keyword;
113+
114+
ALTER TABLE ezkeyword_attribute_link RENAME TO ibexa_keyword_field_link;
115+
ALTER TABLE ibexa_keyword_field_link RENAME INDEX ezkeyword_attr_link_oaid TO ibexa_keyword_field_link_oaid;
116+
ALTER TABLE ibexa_keyword_field_link RENAME INDEX ezkeyword_attr_link_kid_oaid TO ibexa_keyword_field_link_kid_oaid;
117+
ALTER TABLE ibexa_keyword_field_link RENAME INDEX ezkeyword_attr_link_oaid_ver TO ibexa_keyword_field_link_oaid_ver;
118+
119+
ALTER TABLE ezmedia RENAME TO ibexa_media;
120+
121+
ALTER TABLE eznode_assignment RENAME TO ibexa_node_assignment;
122+
ALTER TABLE ibexa_node_assignment RENAME INDEX eznode_assignment_is_main TO ibexa_node_assignment_is_main;
123+
ALTER TABLE ibexa_node_assignment RENAME INDEX eznode_assignment_coid_cov TO ibexa_node_assignment_coid_cov;
124+
ALTER TABLE ibexa_node_assignment RENAME INDEX eznode_assignment_parent_node TO ibexa_node_assignment_parent_node;
125+
ALTER TABLE ibexa_node_assignment RENAME INDEX eznode_assignment_co_version TO ibexa_node_assignment_co_version;
126+
127+
ALTER TABLE eznotification RENAME TO ibexa_notification;
128+
ALTER TABLE ibexa_notification RENAME INDEX eznotification_owner_is_pending TO ibexa_notification_owner_is_pending;
129+
ALTER TABLE ibexa_notification RENAME INDEX eznotification_owner TO ibexa_notification_owner;
130+
131+
ALTER TABLE ezpackage RENAME TO ibexa_package;
132+
133+
ALTER TABLE ezpolicy RENAME TO ibexa_policy;
134+
ALTER TABLE ibexa_policy RENAME INDEX ezpolicy_role_id TO ibexa_policy_role_id;
135+
ALTER TABLE ibexa_policy RENAME INDEX ezpolicy_original_id TO ibexa_policy_original_id;
136+
137+
ALTER TABLE ezpolicy_limitation RENAME TO ibexa_policy_limitation;
138+
ALTER TABLE ibexa_policy_limitation RENAME INDEX policy_id TO ibexa_policy_id;
139+
140+
ALTER TABLE ezpolicy_limitation_value RENAME TO ibexa_policy_limitation_value;
141+
ALTER TABLE ibexa_policy_limitation_value RENAME INDEX ezpolicy_limit_value_limit_id TO ibexa_policy_limit_value_limit_id;
142+
ALTER TABLE ibexa_policy_limitation_value RENAME INDEX ezpolicy_limitation_value_val TO ibexa_policy_limitation_value_val;
143+
144+
ALTER TABLE ezpreferences RENAME TO ibexa_user_preference;
145+
ALTER TABLE ibexa_user_preference RENAME INDEX ezpreferences_user_id_idx TO ibexa_user_preference_user_id_idx;
146+
ALTER TABLE ibexa_user_preference RENAME INDEX ezpreferences_name TO ibexa_user_preference_name;
147+
148+
ALTER TABLE ezrole RENAME TO ibexa_role;
149+
150+
ALTER TABLE ezsearch_object_word_link RENAME TO ibexa_search_object_word_link;
151+
ALTER TABLE ibexa_search_object_word_link RENAME INDEX ezsearch_object_word_link_object TO ibexa_search_object_word_link_object;
152+
ALTER TABLE ibexa_search_object_word_link RENAME INDEX ezsearch_object_word_link_identifier TO ibexa_search_object_word_link_identifier;
153+
ALTER TABLE ibexa_search_object_word_link RENAME INDEX ezsearch_object_word_link_integer_value TO ibexa_search_object_word_link_integer_value;
154+
ALTER TABLE ibexa_search_object_word_link RENAME INDEX ezsearch_object_word_link_word TO ibexa_search_object_word_link_word;
155+
ALTER TABLE ibexa_search_object_word_link RENAME INDEX ezsearch_object_word_link_frequency TO ibexa_search_object_word_link_frequency;
156+
157+
ALTER TABLE ezsearch_word RENAME TO ibexa_search_word;
158+
ALTER TABLE ibexa_search_word RENAME INDEX ezsearch_word_word_i TO ibexa_search_word_word_i;
159+
ALTER TABLE ibexa_search_word RENAME INDEX ezsearch_word_obj_count TO ibexa_search_word_obj_count;
160+
161+
ALTER TABLE ezsection RENAME TO ibexa_section;
162+
163+
ALTER TABLE ezsite_data RENAME TO ibexa_site_data;
164+
165+
ALTER TABLE ezurl RENAME TO ibexa_url;
166+
ALTER TABLE ibexa_url RENAME INDEX ezurl_url TO ibexa_url_url;
167+
168+
ALTER TABLE ezurl_object_link RENAME TO ibexa_url_content_link;
169+
ALTER TABLE ibexa_url_content_link RENAME INDEX ezurl_ol_coa_id TO ibexa_url_ol_coa_id;
170+
ALTER TABLE ibexa_url_content_link RENAME INDEX ezurl_ol_url_id TO ibexa_url_ol_url_id;
171+
ALTER TABLE ibexa_url_content_link RENAME INDEX ezurl_ol_coa_version TO ibexa_url_ol_coa_version;
172+
ALTER TABLE ibexa_url_content_link RENAME INDEX ezurl_ol_coa_id_cav TO ibexa_url_ol_coa_id_cav;
173+
174+
ALTER TABLE ezurlalias RENAME TO ibexa_url_alias;
175+
ALTER TABLE ibexa_url_alias RENAME INDEX ezurlalias_source_md5 TO ibexa_url_alias_source_md5;
176+
ALTER TABLE ibexa_url_alias RENAME INDEX ezurlalias_wcard_fwd TO ibexa_url_alias_wcard_fwd;
177+
ALTER TABLE ibexa_url_alias RENAME INDEX ezurlalias_forward_to_id TO ibexa_url_alias_forward_to_id;
178+
ALTER TABLE ibexa_url_alias RENAME INDEX ezurlalias_imp_wcard_fwd TO ibexa_url_alias_imp_wcard_fwd;
179+
ALTER TABLE ibexa_url_alias RENAME INDEX ezurlalias_source_url TO ibexa_url_alias_source_url;
180+
ALTER TABLE ibexa_url_alias RENAME INDEX ezurlalias_desturl TO ibexa_url_alias_desturl;
181+
182+
ALTER TABLE ezurlalias_ml RENAME TO ibexa_url_alias_ml;
183+
ALTER TABLE ibexa_url_alias_ml RENAME INDEX ezurlalias_ml_actt_org_al TO ibexa_url_alias_ml_actt_org_al;
184+
ALTER TABLE ibexa_url_alias_ml RENAME INDEX ezurlalias_ml_text_lang TO ibexa_url_alias_ml_text_lang;
185+
ALTER TABLE ibexa_url_alias_ml RENAME INDEX ezurlalias_ml_par_act_id_lnk TO ibexa_url_alias_ml_par_act_id_lnk;
186+
ALTER TABLE ibexa_url_alias_ml RENAME INDEX ezurlalias_ml_par_lnk_txt TO ibexa_url_alias_ml_par_lnk_txt;
187+
ALTER TABLE ibexa_url_alias_ml RENAME INDEX ezurlalias_ml_act_org TO ibexa_url_alias_ml_act_org;
188+
ALTER TABLE ibexa_url_alias_ml RENAME INDEX ezurlalias_ml_text TO ibexa_url_alias_ml_text;
189+
ALTER TABLE ibexa_url_alias_ml RENAME INDEX ezurlalias_ml_link TO ibexa_url_alias_ml_link;
190+
ALTER TABLE ibexa_url_alias_ml RENAME INDEX ezurlalias_ml_id TO ibexa_url_alias_ml_id;
191+
192+
ALTER TABLE ezurlalias_ml_incr RENAME TO ibexa_url_alias_ml_incr;
193+
194+
ALTER TABLE ezurlwildcard RENAME TO ibexa_url_wildcard;
195+
196+
ALTER TABLE ezuser RENAME TO ibexa_user;
197+
ALTER TABLE ibexa_user RENAME INDEX ezuser_login TO ibexa_user_login;
198+
199+
ALTER TABLE ezuser_accountkey RENAME TO ibexa_user_accountkey;
200+
201+
ALTER TABLE ezuser_role RENAME TO ibexa_user_role;
202+
ALTER TABLE ibexa_user_role RENAME INDEX ezuser_role_role_id TO ibexa_user_role_role_id;
203+
ALTER TABLE ibexa_user_role RENAME INDEX ezuser_role_contentobject_id TO ibexa_user_role_contentobject_id;
204+
205+
ALTER TABLE ezuser_setting RENAME TO ibexa_user_setting;
206+
207+
ALTER TABLE ibexa_content_bookmark DROP FOREIGN KEY ezcontentbrowsebookmark_user_fk;
208+
ALTER TABLE ibexa_content_bookmark ADD CONSTRAINT ibexa_content_bookmark_user_fk FOREIGN KEY (user_id) REFERENCES ibexa_user(contentobject_id) ON DELETE CASCADE;
209+
210+
-- Rename contentclass_id column
211+
ALTER TABLE ibexa_content_type_field_definition RENAME COLUMN contentclass_id TO content_type_id;
212+
ALTER TABLE ibexa_content_type_group_assignment RENAME COLUMN contentclass_id TO content_type_id;
213+
ALTER TABLE ibexa_content_type_name RENAME COLUMN contentclass_id TO content_type_id;
214+
ALTER TABLE ibexa_content RENAME COLUMN contentclass_id TO content_type_id;
215+
ALTER TABLE ibexa_search_object_word_link RENAME COLUMN contentclass_id TO content_type_id;
216+
217+
-- Update content type version to status
218+
ALTER TABLE ibexa_content_type RENAME INDEX ibexa_content_type_version TO ibexa_content_type_status;
219+
ALTER TABLE ibexa_content_type RENAME COLUMN version TO status;
220+
221+
ALTER TABLE ibexa_content_type_field_definition RENAME COLUMN version TO status;
222+
223+
ALTER TABLE ibexa_content_type_field_definition_ml RENAME COLUMN version TO status;
224+
225+
ALTER TABLE ibexa_content_type_group_assignment RENAME COLUMN contentclass_version TO content_type_status;
226+
ALTER TABLE ibexa_content_type_name RENAME COLUMN contentclass_version TO content_type_status;
227+
228+
-- Rename user invitations tables
229+
ALTER TABLE ibexa_user_invitations RENAME TO ibexa_user_invitation;
230+
ALTER TABLE ibexa_user_invitation RENAME INDEX ibexa_user_invitations_email_idx TO ibexa_user_invitation_email_idx;
231+
ALTER TABLE ibexa_user_invitation RENAME INDEX ibexa_user_invitations_hash_idx TO ibexa_user_invitation_hash_idx;
232+
ALTER TABLE ibexa_user_invitation RENAME INDEX ibexa_user_invitations_email_uindex TO ibexa_user_invitation_email_uindex;
233+
ALTER TABLE ibexa_user_invitation RENAME INDEX ibexa_user_invitations_hash_uindex TO ibexa_user_invitation_hash_uindex;
234+
235+
ALTER TABLE ibexa_user_invitations_assignments RENAME TO ibexa_user_invitation_assignment;
236+
ALTER TABLE ibexa_user_invitation_assignment DROP FOREIGN KEY ibexa_user_invitations_assignments_ibexa_user_invitations_id_fk;
237+
ALTER TABLE ibexa_user_invitation_assignment ADD CONSTRAINT ibexa_user_invitation_assignment_ibexa_user_invitation_id_fk
238+
FOREIGN KEY (invitation_id) REFERENCES ibexa_user_invitation(id) ON DELETE CASCADE ON UPDATE CASCADE;
239+
240+
-- Rename content type field definition ML columns
241+
ALTER TABLE ibexa_content_type_field_definition_ml RENAME COLUMN contentclass_attribute_id TO content_type_field_definition_id;
242+
243+
-- Rename content field columns and indexes
244+
ALTER TABLE ibexa_content_field RENAME COLUMN contentclassattribute_id TO content_type_field_definition_id;
245+
ALTER TABLE ibexa_content_field RENAME INDEX ibexa_content_field_classattr_id TO ibexa_content_field_field_definition_id;
246+
247+
-- Update content relation columns and indexes
248+
ALTER TABLE ibexa_content_relation RENAME COLUMN contentclassattribute_id TO content_type_field_definition_id;
249+
ALTER TABLE ibexa_content_relation RENAME INDEX ibexa_content_relation_cca_id TO ibexa_content_relation_ccfd_id;
250+
251+
-- Update search object word link columns
252+
ALTER TABLE ibexa_search_object_word_link RENAME COLUMN contentclass_attribute_id TO content_type_field_definition_id;

0 commit comments

Comments
 (0)