From 4b1b55a9c74e8cb1ee6b33b27832274f97c5a002 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 15 Oct 2007 15:53:13 +0000 Subject: [PATCH] - Fix broken script - Filter to update just the 35 affected columns and 39 fields (possible customizations must be updated by maintainer) - Update displaylength on field to 20 instead of 40 (avoid possible overlapping of fields) --- migration/330-trunk/019_EntityTypeLength.sql | 215 ++++++++++++++---- .../postgresql/019_EntityTypeLength.sql | 164 +++++++++---- 2 files changed, 290 insertions(+), 89 deletions(-) diff --git a/migration/330-trunk/019_EntityTypeLength.sql b/migration/330-trunk/019_EntityTypeLength.sql index 5de52f928f..640365e7e0 100644 --- a/migration/330-trunk/019_EntityTypeLength.sql +++ b/migration/330-trunk/019_EntityTypeLength.sql @@ -1,53 +1,174 @@ -ALTER TABLE AD_Ref_List MODIFY EntityType Varchar2(40); -ALTER TABLE AD_WF_NextCondition MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Val_Rule MODIFY EntityType Varchar2(40); -ALTER TABLE PA_MeasureCalc MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Menu MODIFY EntityType Varchar2(40); -ALTER TABLE AD_InfoColumn MODIFY EntityType Varchar2(40); -ALTER TABLE AD_WF_NodeNext MODIFY EntityType Varchar2(40); -ALTER TABLE AD_WF_Node_Para MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Element MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Task MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Workbench MODIFY EntityType Varchar2(40); -ALTER TABLE AD_EntityType MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Ref_Table MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Tab MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Field MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Process_Para MODIFY EntityType Varchar2(40); -ALTER TABLE PA_ColorSchema MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Modification MODIFY EntityType Varchar2(40); -ALTER TABLE AD_ReplicationStrategy MODIFY EntityType Varchar2(40); -ALTER TABLE AD_ReplicationTable MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Image MODIFY EntityType Varchar2(40); -ALTER TABLE AD_FieldGroup MODIFY EntityType Varchar2(40); -ALTER TABLE AD_InfoWindow MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Table MODIFY EntityType Varchar2(40); -ALTER TABLE AD_WF_Node MODIFY EntityType Varchar2(40); -ALTER TABLE AD_WF_Responsible MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Form MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Window MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Column MODIFY EntityType Varchar2(40); -ALTER TABLE AD_WorkbenchWindow MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Process MODIFY EntityType Varchar2(40); -ALTER TABLE AD_ReportView MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Reference MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Message MODIFY EntityType Varchar2(40); -ALTER TABLE AD_Workflow MODIFY EntityType Varchar2(40); +ALTER TABLE AD_REF_LIST MODIFY entitytype VARCHAR2(40); -UPDATE AD_Column SET FieldLength = 40 WHERE ColumnName = 'EntityType'; +ALTER TABLE AD_WF_NEXTCONDITION MODIFY entitytype VARCHAR2(40); -UPDATE AD_Field Set DisplayLength = 40 WHERE AD_Column_ID IN -(SELECT AD_Column_ID FROM AD_Column WHERE ColumnName = 'EntityType'); +ALTER TABLE AD_VAL_RULE MODIFY entitytype VARCHAR2(40); + +ALTER TABLE PA_MEASURECALC MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_MENU MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_INFOCOLUMN MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_WF_NODENEXT MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_WF_NODE_PARA MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_ELEMENT MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_TASK MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_WORKBENCH MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_ENTITYTYPE MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_REF_TABLE MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_TAB MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_FIELD MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_PROCESS_PARA MODIFY entitytype VARCHAR2(40); + +ALTER TABLE PA_COLORSCHEMA MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_MODIFICATION MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_REPLICATIONSTRATEGY MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_REPLICATIONTABLE MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_IMAGE MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_FIELDGROUP MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_INFOWINDOW MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_TABLE MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_WF_NODE MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_WF_RESPONSIBLE MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_FORM MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_WINDOW MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_COLUMN MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_WORKBENCHWINDOW MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_PROCESS MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_REPORTVIEW MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_REFERENCE MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_MESSAGE MODIFY entitytype VARCHAR2(40); + +ALTER TABLE AD_WORKFLOW MODIFY entitytype VARCHAR2(40); + +UPDATE AD_COLUMN + SET fieldlength = 40 + WHERE columnname = 'EntityType' + AND ad_table_id IN ( + SELECT ad_table_id + FROM AD_TABLE + WHERE tablename IN + ('AD_Ref_List', + 'AD_WF_NextCondition', + 'AD_Val_Rule', + 'PA_MeasureCalc', + 'AD_Menu', + 'AD_InfoColumn', + 'AD_WF_NodeNext', + 'AD_WF_Node_Para', + 'AD_Element', + 'AD_Task', + 'AD_Workbench', + 'AD_EntityType', + 'AD_Ref_Table', + 'AD_Tab', + 'AD_Field', + 'AD_Process_Para', + 'PA_ColorSchema', + 'AD_Modification', + 'AD_ReplicationStrategy', + 'AD_ReplicationTable', + 'AD_Image', + 'AD_FieldGroup', + 'AD_InfoWindow', + 'AD_Table', + 'AD_WF_Node', + 'AD_WF_Responsible', + 'AD_Form', + 'AD_Window', + 'AD_Column', + 'AD_WorkbenchWindow', + 'AD_Process', + 'AD_ReportView', + 'AD_Reference', + 'AD_Message', + 'AD_Workflow' + )); + +UPDATE AD_FIELD + SET displaylength = 20 + WHERE ad_column_id IN ( + SELECT ad_column_id + FROM AD_COLUMN + WHERE columnname = 'EntityType' + AND ad_table_id IN ( + SELECT ad_table_id + FROM AD_TABLE + WHERE tablename IN + ('AD_Ref_List', + 'AD_WF_NextCondition', + 'AD_Val_Rule', + 'PA_MeasureCalc', + 'AD_Menu', + 'AD_InfoColumn', + 'AD_WF_NodeNext', + 'AD_WF_Node_Para', + 'AD_Element', + 'AD_Task', + 'AD_Workbench', + 'AD_EntityType', + 'AD_Ref_Table', + 'AD_Tab', + 'AD_Field', + 'AD_Process_Para', + 'PA_ColorSchema', + 'AD_Modification', + 'AD_ReplicationStrategy', + 'AD_ReplicationTable', + 'AD_Image', + 'AD_FieldGroup', + 'AD_InfoWindow', + 'AD_Table', + 'AD_WF_Node', + 'AD_WF_Responsible', + 'AD_Form', + 'AD_Window', + 'AD_Column', + 'AD_WorkbenchWindow', + 'AD_Process', + 'AD_ReportView', + 'AD_Reference', + 'AD_Message', + 'AD_Workflow' + ))); -- hide classpath field that is not implemented -UPDATE ad_field -SET isdisplayed = 'N', isactive = 'N' -WHERE ad_field_id = 13498 +UPDATE AD_FIELD + SET isdisplayed = 'N', + isactive = 'N' + WHERE ad_field_id = 13498; --- hide the register extension buttion that is not implemented -UPDATE ad_field -SET isdisplayed = 'N', isactive = 'N' -WHERE ad_field_id = 13507 - -COMMIT; +-- hide the register extension button that is not implemented +UPDATE AD_FIELD + SET isdisplayed = 'N', + isactive = 'N' + WHERE ad_field_id = 13507; +COMMIT ; diff --git a/migration/330-trunk/postgresql/019_EntityTypeLength.sql b/migration/330-trunk/postgresql/019_EntityTypeLength.sql index 62d8b0b87c..33768e7bd7 100644 --- a/migration/330-trunk/postgresql/019_EntityTypeLength.sql +++ b/migration/330-trunk/postgresql/019_EntityTypeLength.sql @@ -1,52 +1,132 @@ -ALTER TABLE PA_ColorSchema ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Table ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_WF_NextCondition ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Val_Rule ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_ReplicationTable ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Workflow ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Image ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_EntityType ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_InfoColumn ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Reference ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Ref_List ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Tab ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_WF_NodeNext ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_WorkbenchWindow ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_WF_Node_Para ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Process ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Menu ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_ReplicationStrategy ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_WF_Responsible ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Workbench ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Column ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_WF_Node ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Task ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_ReportView ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Ref_Table ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Window ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE PA_MeasureCalc ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Form ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Modification ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_InfoWindow ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Field ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Element ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_FieldGroup ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Message ALTER COLUMN EntityType TYPE Varchar(40); -ALTER TABLE AD_Process_Para ALTER COLUMN EntityType TYPE Varchar(40); +ALTER TABLE PA_COLORSCHEMA ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_TABLE ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_WF_NEXTCONDITION ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_VAL_RULE ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_REPLICATIONTABLE ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_WORKFLOW ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_IMAGE ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_ENTITYTYPE ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_INFOCOLUMN ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_REFERENCE ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_REF_LIST ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_TAB ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_WF_NODENEXT ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_WORKBENCHWINDOW ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_WF_NODE_PARA ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_PROCESS ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_MENU ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_REPLICATIONSTRATEGY ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_WF_RESPONSIBLE ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_WORKBENCH ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_COLUMN ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_WF_NODE ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_TASK ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_REPORTVIEW ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_REF_TABLE ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_WINDOW ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE PA_MEASURECALC ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_FORM ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_MODIFICATION ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_INFOWINDOW ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_FIELD ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_ELEMENT ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_FIELDGROUP ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_MESSAGE ALTER COLUMN EntityType TYPE VARCHAR(40); +ALTER TABLE AD_PROCESS_PARA ALTER COLUMN EntityType TYPE VARCHAR(40); -UPDATE AD_Column SET FieldLength = 40 WHERE ColumnName = 'EntityType'; +UPDATE AD_COLUMN SET FieldLength = 40 WHERE ColumnName = 'EntityType' + AND ad_table_id IN ( + SELECT ad_table_id + FROM AD_TABLE + WHERE tablename IN + ('AD_Ref_List', + 'AD_WF_NextCondition', + 'AD_Val_Rule', + 'PA_MeasureCalc', + 'AD_Menu', + 'AD_InfoColumn', + 'AD_WF_NodeNext', + 'AD_WF_Node_Para', + 'AD_Element', + 'AD_Task', + 'AD_Workbench', + 'AD_EntityType', + 'AD_Ref_Table', + 'AD_Tab', + 'AD_Field', + 'AD_Process_Para', + 'PA_ColorSchema', + 'AD_Modification', + 'AD_ReplicationStrategy', + 'AD_ReplicationTable', + 'AD_Image', + 'AD_FieldGroup', + 'AD_InfoWindow', + 'AD_Table', + 'AD_WF_Node', + 'AD_WF_Responsible', + 'AD_Form', + 'AD_Window', + 'AD_Column', + 'AD_WorkbenchWindow', + 'AD_Process', + 'AD_ReportView', + 'AD_Reference', + 'AD_Message', + 'AD_Workflow' + )); -UPDATE AD_Field Set DisplayLength = 40 WHERE AD_Column_ID IN -(SELECT AD_Column_ID FROM AD_Column WHERE ColumnName = 'EntityType'); +UPDATE AD_FIELD SET DisplayLength = 20 WHERE AD_Column_ID IN +(SELECT AD_Column_ID FROM AD_COLUMN WHERE ColumnName = 'EntityType' + AND ad_table_id IN ( + SELECT ad_table_id + FROM AD_TABLE + WHERE tablename IN + ('AD_Ref_List', + 'AD_WF_NextCondition', + 'AD_Val_Rule', + 'PA_MeasureCalc', + 'AD_Menu', + 'AD_InfoColumn', + 'AD_WF_NodeNext', + 'AD_WF_Node_Para', + 'AD_Element', + 'AD_Task', + 'AD_Workbench', + 'AD_EntityType', + 'AD_Ref_Table', + 'AD_Tab', + 'AD_Field', + 'AD_Process_Para', + 'PA_ColorSchema', + 'AD_Modification', + 'AD_ReplicationStrategy', + 'AD_ReplicationTable', + 'AD_Image', + 'AD_FieldGroup', + 'AD_InfoWindow', + 'AD_Table', + 'AD_WF_Node', + 'AD_WF_Responsible', + 'AD_Form', + 'AD_Window', + 'AD_Column', + 'AD_WorkbenchWindow', + 'AD_Process', + 'AD_ReportView', + 'AD_Reference', + 'AD_Message', + 'AD_Workflow' + ))); -- hide classpath field that is not implemented -UPDATE ad_field +UPDATE AD_FIELD SET isdisplayed = 'N', isactive = 'N' -WHERE ad_field_id = 13498 +WHERE ad_field_id = 13498; -- hide the register extension buttion that is not implemented -UPDATE ad_field +UPDATE AD_FIELD SET isdisplayed = 'N', isactive = 'N' -WHERE ad_field_id = 13507 +WHERE ad_field_id = 13507; COMMIT;