Fighting with Composer. NLS data

Case: I played with locale data in composer, installed project a couple of times and now I want to perform “clean” installation without reinstalling the whole repository. The problem is: in composer locale data is hierarchical but in repository it is flat, for example, if I overwrote attribute’s label for subtype and now I want to inherit it from supertype again, I need to keep overwritten label in sync with supertype – seems not to be convenient.

Solution:

-- deleting NLS data for particular types
DELETE dmi_object_type
 WHERE r_object_id IN (SELECT r_object_id
                         FROM dm_nls_dd_info_s
                        WHERE parent_id IN (SELECT r_object_id
                                              FROM dm_aggr_domain_s
                                             WHERE type_name ...));

DELETE dm_nls_dd_info_r
 WHERE r_object_id IN (SELECT r_object_id
                         FROM dm_nls_dd_info_s
                        WHERE parent_id IN (SELECT r_object_id
                                              FROM dm_aggr_domain_s
                                             WHERE type_name ...));

DELETE dm_nls_dd_info_s
 WHERE parent_id IN (SELECT r_object_id
                       FROM dm_aggr_domain_s
                      WHERE type_name ...);

UPDATE dm_domain_r
   SET nls_dd_info = NULL, nls_key = NULL
 WHERE     r_object_id IN (SELECT r_object_id
                             FROM dm_aggr_domain_s
                            WHERE type_name ...)
       AND nls_dd_info IS NOT NULL;

UPDATE dm_domain_r
   SET nls_dd_info = NULL, nls_key = NULL
 WHERE     r_object_id IN (SELECT r_object_id
                             FROM dm_domain_s
                            WHERE parent_id IN (SELECT r_object_id
                                                  FROM dm_aggr_domain_s
                                                 WHERE type_name ...))
       AND nls_dd_info IS NOT NULL;

-- generating API commands to remove dd objects
SELECT 'apply,c,,REMOVE_DD_OBJECT,ID,S,' || r_object_id
  FROM dmi_dd_type_info_sp
 WHERE type_name ...;

SELECT 'apply,c,,REMOVE_DD_OBJECT,ID,S,' || r_object_id
  FROM dmi_dd_attr_info_sp
 WHERE type_name ...;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s