Forums / Install & configuration / Upgrade TO4.3 : script postgresql

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

eZ debug

Timing: Jan 17 2025 23:43:02
Script start
Timing: Jan 17 2025 23:43:02
Module start 'content'
Timing: Jan 17 2025 23:43:03
Module end 'content'
Timing: Jan 17 2025 23:43:03
Script end

Main resources:

Total runtime1.5288 sec
Peak memory usage4,096.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0097 592.5000180.8281
Module start 'content' 0.00971.3772 773.3281598.3828
Module end 'content' 1.38680.1419 1,371.7109336.7500
Script end 1.5288  1,708.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.2935210.0002
Check MTime0.00160.1039210.0001
Mysql Total
Database connection0.00190.125310.0019
Mysqli_queries1.436393.94921960.0073
Looping result0.00230.14971940.0000
Template Total1.491197.520.7456
Template load0.00290.188920.0014
Template processing1.488297.344620.7441
Template load and register function0.00040.023310.0004
states
state_id_array0.00080.055310.0008
state_identifier_array0.00090.056520.0004
Override
Cache load0.00230.1520310.0001
Sytem overhead
Fetch class attribute can translate value0.00150.096940.0004
Fetch class attribute name0.00120.080150.0002
XML
Image XML parsing0.00330.218140.0008
class_abstraction
Instantiating content class attribute0.00000.001150.0000
General
dbfile0.00650.4234340.0002
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 9

Time used to render debug report: 0.0003 secs