Update Skript für die Ersetzung von ArticleImage durch ImageStepAsset
git-svn-id: https://svn.libreccm.org/ccm/trunk@2481 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
5708731ebc
commit
88c839252d
|
|
@ -17,4 +17,24 @@
|
|||
|
||||
-- move data from cms_article_image_map to cms_item_image_attachments
|
||||
|
||||
drop table cms_article_image_map;
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue