Upgrade Script for converting all HTMLForm items into Article items and removing the HTMLForm content type (which is complelelty identifical with the article content type.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2400 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2013-10-29 18:37:34 +00:00
parent d091a4e362
commit d8893d77eb
4 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,55 @@
--
-- Copyright (C) 2013 Jens Pelzetter All Rights Reserved.
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public License
-- as published by the Free Software Foundation; either version 2.1 of
-- the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
-- $Id$
-- Converts all HTMLForm content items to Article content items.
-- Remove the inizalizer for HTMLForm for inits and inits_requirements
DELETE FROM init_requirements WHERE required_init = 'com.arsdigita.cms.contenttypes.HTMLFormInitializer'
OR init = 'com.arsdigita.cms.contenttypes.HTMLFormInitializer';
DELETE FROM inits WHERE class_name = 'com.arsdigita.cms.contenttypes.HTMLFormInitializer';
INSERT INTO ct_articles (item_id, lead) VALUES (SELECT item_id, lead FROM ct_htmlform);
UPDATE cms_items
SET type_id = (SELECT type_id FROM content_types WHERE object_type = 'com.arsdigita.cms.contenttypes.Article')
WHERE type_id = (SELECT type_id FROM content_types WHERE object_type = 'com.arsdigita.cms.contenttypes.HTMLForm');
UPDATE acs_objects
SET object_type = 'com.arsdigita.cms.contenttypes.Article',
default_domain_class = 'com.arsdigita.cms.contenttypes.Article'
WHERE object_type = 'com.arsdigita.cms.contenttypes.HTMLForm';
UPDATE lucene_docs
SET type = 'com.arsdigita.cms.contenttypes.Article'
WHERE type = 'com.arsdigita.cms.contenttypes.HTMLForm';
UPDATE vcx_generic_operations
SET value = replace(value, 'com.arsdigita.cms.contenttypes.HTMLForm', 'com.arsdigita.cms.contenttypes.Article')
WHERE value LIKE '%com.arsdigita.cms.contenttypes.HTMLForm%';
UPDATE vcx_obj_changes
SET obj_id = REPLACE(obj_id, 'com.arsdigita.cms.contenttypes.HTMLForm', 'com.arsdigita.cms.contenttypes.Article')
WHERE obj_id LIKE '%com.arsdigita.cms.contenttypes.HTMLForm%';
UPDATE vcx_tags
SET tagged_oid = REPLACE(tagged_oid,'com.arsdigita.cms.contenttypes.HTMLForm', 'com.arsdigita.cms.contenttypes.Article')
WHERE tagged_oid LIKE '%com.arsdigita.cms.contenttypes.HTMLForm%';
DELETE FROM content_types WHERE object_type = 'com.arsdigita.cms.contenttypes.HTMLForm';
DROP TABLE IF EXISTS ct_htmlform;

View File

@ -0,0 +1,22 @@
--
-- Copyright (C) 2013 Jens Pelzetter All Rights Reserved.
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public License
-- as published by the Free Software Foundation; either version 2.1 of
-- the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
-- $Id$
-- Remove the inizalizer for HTMLForm for inits and inits_requirements
@@ ../default/upgrade/0.0.0-6.6.1/remove_htmlform.sql

View File

@ -0,0 +1,26 @@
--
-- Copyright (C) 2013 Jens Pelzetter All Rights Reserved.
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public License
-- as published by the Free Software Foundation; either version 2.1 of
-- the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
-- $Id$
-- Remove the inizalizer for HTMLForm for inits and inits_requirements
begin;
\i ../default/upgrade/0.0.0-6.6.1/remove_htmlform.sql
commit;

View File

@ -0,0 +1,5 @@
<upgrade>
<version from="0.0.0" to="6.6.1">
<script sql="ccm-ldn-aplaws/upgrade/::database::-0.0.0-6.6.1.sql"/>
</version>
</upgrade>