From 54cc24ca81d7d41096c5fa7177366414f6f9869e Mon Sep 17 00:00:00 2001 From: pb Date: Sun, 27 Mar 2011 08:58:09 +0000 Subject: [PATCH] =?UTF-8?q?Update=20script=20f.=20ccm-cms-types-simpleaddr?= =?UTF-8?q?ess=20erg=C3=A4nzt.=20Update=20from=20version=206.6.0=20to-vers?= =?UTF-8?q?ion=206.6.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@799 8810af33-2d31-482b-a856-94f89814c4df --- .../drop_constraints_ct_adresses.sql | 20 ++++++ .../upgrade/6.6.0-6.6.1/upd_system_tables.sql | 72 +++++++++++++++++++ .../6.6.0-6.6.1/upd_table_ct_address.sql | 31 ++++++++ .../6.6.0-6.6.1/upd_table_iso_countries.sql | 23 ++++++ .../upgrade/oracle-se-6.6.0-6.6.1.sql | 26 +++++++ .../upgrade/postgres-6.6.0-6.6.1.sql | 30 ++++++++ .../cms/contenttypes/SimpleAddressConfig.java | 4 +- 7 files changed, 204 insertions(+), 2 deletions(-) create mode 100644 ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/drop_constraints_ct_adresses.sql create mode 100644 ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_system_tables.sql create mode 100644 ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_table_ct_address.sql create mode 100644 ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_table_iso_countries.sql create mode 100644 ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/upgrade/oracle-se-6.6.0-6.6.1.sql create mode 100644 ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/upgrade/postgres-6.6.0-6.6.1.sql diff --git a/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/drop_constraints_ct_adresses.sql b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/drop_constraints_ct_adresses.sql new file mode 100644 index 000000000..8912b0111 --- /dev/null +++ b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/drop_constraints_ct_adresses.sql @@ -0,0 +1,20 @@ +-- +-- 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: drop_constraints_ct_addresses.sql pboy $ + +alter table ct_addresses drop constraint ct_addresse_address_id_p_y1u3b; +alter table ct_addresses drop constraint ct_addre_iso_coun_code_f_o8h8a ; +alter table ct_addresses drop constraint ct_addresse_address_id_f__qv8u ; diff --git a/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_system_tables.sql b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_system_tables.sql new file mode 100644 index 000000000..6bea0711d --- /dev/null +++ b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_system_tables.sql @@ -0,0 +1,72 @@ +-- +-- 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: upd_system_tables.sql pboy $ + +-- adjust various system tables to the new name of content type + +alter table init_requirements drop constraint init_requirements_init_f_cmmdn ; + +update inits + set class_name='com.arsdigita.cms.contenttypes.SimpleAddressInitializer' + where class_name='com.arsdigita.cms.contenttypes.AddressInitializer' ; + +update init_requirements + set init='com.arsdigita.cms.contenttypes.SimpleAddressInitializer' + where init='com.arsdigita.cms.contenttypes.AddressInitializer' ; + +ALTER TABLE init_requirements + ADD CONSTRAINT init_requirements_init_f_cmmdn FOREIGN KEY (init) + REFERENCES inits (class_name) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION; + + +update content_types + set object_type='com.arsdigita.cms.contenttypes.SimpleAddress', + label='Simple Address', + classname='com.arsdigita.cms.contenttypes.SimpleAddress' + where classname='com.arsdigita.cms.contenttypes.Address' ; + +update authoring_steps + set label_key='simpleaddress.authoring.basic_properties.title', + label_bundle='com.arsdigita.cms.contenttypes.SimpleAddressResources', + description_key='simpleaddress.authoring.basic_properties.description', + description_bundle='com.arsdigita.cms.contenttypes.SimpleAddressResources', + component='com.arsdigita.cms.contenttypes.ui.SimpleAddressPropertiesStep' + where component='com.arsdigita.cms.contenttypes.ui.AddressPropertiesStep' ; + + +update acs_objects + set (object_type,default_domain_class) = + ('com.arsdigita.cms.contenttypes.SimpleAddress' , + 'com.arsdigita.cms.contenttypes.SimpleAddress' ) + where default_domain_class like 'com.arsdigita.cms.contenttypes.Address' ; + +update lucene_docs + set type='com.arsdigita.cms.contenttypes.SimpleAddress' + where type='com.arsdigita.cms.contenttypes.Address' ; + +update vcx_generic_operations + set value=replace(value,'contenttypes.Address', 'contenttypes.SimpleAddress') + where value like '%contenttypes.Address%'; + +update vcx_obj_changes + set obj_id=replace(obj_id,'contenttypes.Address', 'contenttypes.SimpleAddress') + where obj_id like '%contenttypes.Address%'; + +update vcx_tags + set tagged_oid=replace(tagged_oid,'contenttypes.Address', 'contenttypes.SimpleAddress') + where tagged_oid like '%contenttypes.Address%'; + diff --git a/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_table_ct_address.sql b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_table_ct_address.sql new file mode 100644 index 000000000..cb818d3f5 --- /dev/null +++ b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_table_ct_address.sql @@ -0,0 +1,31 @@ +-- +-- 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: upd_table_ct_addresses.sql pboy $ + +alter table ct_addresses rename to ct_simpleaddr_addresses ; + +ALTER TABLE ct_simpleaddr_addresses + ADD CONSTRAINT ct_simple_addre_add_id_p_gf2ww PRIMARY KEY(address_id); + +ALTER TABLE ct_simpleaddr_addresses + ADD CONSTRAINT ct_sim_add_iso_cou_cod_f_7mojx FOREIGN KEY (iso_country_code) + REFERENCES ct_simpleaddr_iso_countries (iso_code) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION; + +ALTER TABLE ct_simpleaddr_addresses + ADD CONSTRAINT ct_simple_addre_add_id_f_nrh2p FOREIGN KEY (address_id) + REFERENCES cms_pages (item_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION; \ No newline at end of file diff --git a/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_table_iso_countries.sql b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_table_iso_countries.sql new file mode 100644 index 000000000..8be88f384 --- /dev/null +++ b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/default/upgrade/6.6.0-6.6.1/upd_table_iso_countries.sql @@ -0,0 +1,23 @@ +-- +-- 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: upd_table_iso_countries.sql pboy $ + +alter table iso_countries drop constraint iso_countries_iso_code_p_zzr8y ; + +alter table iso_countries rename to ct_simpleaddr_iso_countries ; + +ALTER TABLE ct_simpleaddr_iso_countries + ADD CONSTRAINT ct_sim_iso_cou_iso_cod_p_kvyqe PRIMARY KEY(iso_code); diff --git a/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/upgrade/oracle-se-6.6.0-6.6.1.sql b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/upgrade/oracle-se-6.6.0-6.6.1.sql new file mode 100644 index 000000000..a15cf105f --- /dev/null +++ b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/upgrade/oracle-se-6.6.0-6.6.1.sql @@ -0,0 +1,26 @@ +-- +-- Copyright (C) 2008 Peter Boy 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: oracle-se-6.6.0-6.6.1.sql 293 2011-01-07 15:10:39Z pboy $ + +PROMPT Red Hat Enterprise types-addresses 6.6.0 -> 6.6.1 Upgrade Script (Oracle) + +@@ ../default/upgrade/6.6.0-6.6.1/drop_constraints_ct_addresses.sql +@@ ../default/upgrade/6.6.0-6.6.1/upd_table_iso_countries.sql +@@ ../default/upgrade/6.6.0-6.6.1//upd_table_ct_addresses.sql +@@ ../default/upgrade/6.6.0-6.6.1//upd_system_tables.sql + diff --git a/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/upgrade/postgres-6.6.0-6.6.1.sql b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/upgrade/postgres-6.6.0-6.6.1.sql new file mode 100644 index 000000000..6d80c7b99 --- /dev/null +++ b/ccm-cms-types-simpleaddress/sql/ccm-cms-types-simpleaddress/upgrade/postgres-6.6.0-6.6.1.sql @@ -0,0 +1,30 @@ +-- +-- Copyright (C) 2008 Peter Boy 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 +-- +-- $DateTime: 2010/11/10 23:15:09 $ + +\echo Red Hat Enterprise types-address 6.6.0 -> 6.6.1 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/6.6.0-6.6.1/drop_constraints_ct_addresses.sql +\i ../default/upgrade/6.6.0-6.6.1/upd_table_iso_countries.sql +\i ../default/upgrade/6.6.0-6.6.1/upd_table_ct_addresses.sql +\i ../default/upgrade/6.6.0-6.6.1/upd_system_tables.sql + + +commit; diff --git a/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/SimpleAddressConfig.java b/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/SimpleAddressConfig.java index 57a71953c..73b02610c 100755 --- a/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/SimpleAddressConfig.java +++ b/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/SimpleAddressConfig.java @@ -33,9 +33,9 @@ public class SimpleAddressConfig extends AbstractConfig { private static SimpleAddressConfig s_conf; /** - * Gain a UIConfig object. + * Gain a SimpleAddressConfig object. * - * Singelton pattern, don't instantiate a lifecacle object using the + * Singelton pattern, don't instantiate a config object using the * constructor directly! * @return */