From 88c839252d181514b27c18022ca6cf86263e750c Mon Sep 17 00:00:00 2001 From: quasi Date: Fri, 13 Dec 2013 10:00:46 +0000 Subject: [PATCH] =?UTF-8?q?Update=20Skript=20f=C3=BCr=20die=20Ersetzung=20?= =?UTF-8?q?von=20ArticleImage=20durch=20ImageStepAsset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@2481 8810af33-2d31-482b-a856-94f89814c4df --- .../drop_table_cms_article_image_map.sql | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/drop_table_cms_article_image_map.sql b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/drop_table_cms_article_image_map.sql index 9e3a8c01a..24ae32c4b 100644 --- a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/drop_table_cms_article_image_map.sql +++ b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/drop_table_cms_article_image_map.sql @@ -17,4 +17,24 @@ -- move data from cms_article_image_map to cms_item_image_attachments -drop table cms_article_image_map; \ No newline at end of file +ALTER TABLE cms_article_image_map DROP CONSTRAINT cms_article_image_map_id_fk; + +DELETE FROM cms_items + WHERE item_id IN ( SELECT object_id FROM acs_objects WHERE object_type = 'com.arsdigita.cms.ArticleImageAssociation'); + +UPDATE acs_objects + SET object_type = 'com.arsdigita.cms.contentassets.ItemImageAttachment', + display_name = 'com.arsdigita.cms.contentassets.ItemImageAttachment ' || object_id, + default_domain_class = 'com.arsdigita.cms.contentassets.ItemImageAttachment' + WHERE object_type = 'com.arsdigita.cms.ArticleImageAssociation'; + +INSERT INTO cms_item_image_attachment ( attachment_id, item_id, image_id, caption, title, description ) + SELECT map_id as attachment_id, + article_id as item_id, + image_id, + substring(caption, 0, 100) as caption, + substring(caption, 0, 200) as title, + caption as description + FROM cms_article_image_map; + +DROP TABLE cms_article_image_map;