Upgrade TO4.3 : script postgresql

Author Message

Pierre Déchanoz

Monday 12 April 2010 5:38:13 am

in the script of upgrading :

"ALTER TABLE ezcontentclass_attribute ADD COLUMN serialized_data_text character;
ALTER TABLE ezcontentclass_attribute ADD COLUMN serialized_description_list character;"

In a new installation the table description is :

serialized_data_text text,
serialized_description_list text,

there is a big problem when i try to edit a class :

"INSERT INTO ezcontentclass_attribute (id, serialized_name_list, serialized_description_list, version, contentclass_id, identifier, placement, is_searchable, is_required, can_translate, is_information_collector, data_type_string, data_int1, data_int2, data_int3, data_int4, data_float1, data_float2, data_float3, data_float4, data_text1, data_text2, data_text3, data_text4, data_text5, serialized_data_text, category) VALUES(376, 'a:2:{s:16:"always-available";s:6:"fre-FR";s:6:"fre-FR";s:8:"Sommaire";}', 'a:2:{s:6:"fre-FR";s:0:"";s:16:"always-available";s:6:"fre-FR";}', 1, 48, 'intro', 4, 1, 1, 1, 0, 'ezxmltext', 10, 0, 0, 0, 0.000000, 0.000000, 0.000000, 0.000000, '', '', '', '', '', 'a:2:{s:6:"fre-FR";s:0:"";s:16:"always-available";s:6:"fre-FR";}', '') ERREUR: valeur trop longue pour le type character(1)"

André R.

Tuesday 13 April 2010 6:31:46 am

Unfortunately our test envirmont and QA does not cover Postgres yet, hopefully we will be able to add that for Fuji (4.4).

As for the specific issue, I guess you would need to change these to become TEXT fields.

SQL for changing them would be something like:

ALTER TABLE ezcontentclass RENAME COLUMN serialized_description_list TO sdl_tmp;
ALTER TABLE ezcontentclass ADD COLUMN serialized_description_list TEXT;
ALTER TABLE ezcontentclass ALTER serialized_description_list SET DEFAULT NULL;
UPDATE ezcontentclass SET serialized_description_list=sdl_tmp;
ALTER TABLE ezcontentclass DROP COLUMN sdl_tmp;
ALTER TABLE ezcontentclass_attribute RENAME COLUMN serialized_data_text TO sdt_tmp;
ALTER TABLE ezcontentclass_attribute ADD COLUMN serialized_data_text TEXT;
ALTER TABLE ezcontentclass_attribute ALTER serialized_data_text SET DEFAULT NULL;
UPDATE ezcontentclass_attribute SET serialized_data_text=sdt_tmp;
ALTER TABLE ezcontentclass_attribute DROP COLUMN sdt_tmp;
ALTER TABLE ezcontentclass_attribute RENAME COLUMN serialized_description_list TO sdl_tmp;
ALTER TABLE ezcontentclass_attribute ADD COLUMN serialized_description_list TEXT;
ALTER TABLE ezcontentclass_attribute ALTER serialized_description_list SET DEFAULT NULL;
UPDATE ezcontentclass_attribute SET serialized_description_list=sdl_tmp;
ALTER TABLE ezcontentclass_attribute DROP COLUMN sdl_tmp;

And diff for sql update file something like:

 Index: update/database/postgresql/4.3/dbupdate-4.2.0-to-4.3.0.sql
===================================================================
--- update/database/postgresql/4.3/dbupdate-4.2.0-to-4.3.0.sql    (revision 25223)
+++ update/database/postgresql/4.3/dbupdate-4.2.0-to-4.3.0.sql    (working copy)
@@ -4,12 +4,12 @@
 ALTER TABLE ezrss_export_item ADD COLUMN enclosure character varying(255);
 ALTER TABLE ezrss_export_item ALTER enclosure SET DEFAULT NULL;
 
-ALTER TABLE ezcontentclass ADD COLUMN serialized_description_list character;
+ALTER TABLE ezcontentclass ADD COLUMN serialized_description_list TEXT;
 ALTER TABLE ezcontentclass ALTER serialized_description_list SET DEFAULT NULL;
 
-ALTER TABLE ezcontentclass_attribute ADD COLUMN serialized_data_text character;
+ALTER TABLE ezcontentclass_attribute ADD COLUMN serialized_data_text TEXT;
 ALTER TABLE ezcontentclass_attribute ALTER serialized_data_text SET DEFAULT NULL;
-ALTER TABLE ezcontentclass_attribute ADD COLUMN serialized_description_list character;
+ALTER TABLE ezcontentclass_attribute ADD COLUMN serialized_description_list TEXT;
 ALTER TABLE ezcontentclass_attribute ALTER serialized_description_list SET DEFAULT NULL;
 ALTER TABLE ezcontentclass_attribute ADD COLUMN category character varying(25);

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

tofik sahraoui

Friday 29 October 2010 12:25:20 am

Just so you guys know....this is not included in the dbupdate for ez4.4

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:07:19
Script start
Timing: Jan 18 2025 02:07:19
Module start 'layout'
Timing: Jan 18 2025 02:07:19
Module start 'content'
Timing: Jan 18 2025 02:07:20
Module end 'content'
Timing: Jan 18 2025 02:07:20
Script end

Main resources:

Total runtime0.6030 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 589.4609152.6406
Module start 'layout' 0.00490.0023 742.101639.4766
Module start 'content' 0.00720.5942 781.5781593.2891
Module end 'content' 0.60140.0015 1,374.867212.1406
Script end 0.6030  1,387.0078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4901160.0002
Check MTime0.00120.2025160.0001
Mysql Total
Database connection0.00090.153210.0009
Mysqli_queries0.554191.8865590.0094
Looping result0.00040.0743570.0000
Template Total0.577495.720.2887
Template load0.00160.267320.0008
Template processing0.575795.474520.2879
Template load and register function0.00020.025010.0002
states
state_id_array0.00060.103010.0006
state_identifier_array0.00070.114420.0003
Override
Cache load0.00140.2279310.0000
Sytem overhead
Fetch class attribute can translate value0.00100.160530.0003
Fetch class attribute name0.00150.246350.0003
XML
Image XML parsing0.00130.214130.0004
class_abstraction
Instantiating content class attribute0.00000.002150.0000
General
dbfile0.00110.1789230.0000
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
3content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 9

Time used to render debug report: 0.0001 secs