From c47cd09f1f2fb8a8f988556228f3e61242539279 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 8 Aug 2012 00:02:57 -0500 Subject: [PATCH] Fix wrong entity types --- .../oracle/868_FixWrongEntityTypes.sql | 19 +++++++++++++++++++ .../postgresql/868_FixWrongEntityTypes.sql | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 migration/360lts-release/oracle/868_FixWrongEntityTypes.sql create mode 100644 migration/360lts-release/postgresql/868_FixWrongEntityTypes.sql diff --git a/migration/360lts-release/oracle/868_FixWrongEntityTypes.sql b/migration/360lts-release/oracle/868_FixWrongEntityTypes.sql new file mode 100644 index 0000000000..f0f4d37721 --- /dev/null +++ b/migration/360lts-release/oracle/868_FixWrongEntityTypes.sql @@ -0,0 +1,19 @@ +update ad_element set entitytype = 'D' where entitytype='U' and AD_Element_id < 1000000; + +update ad_field set entitytype = 'D' where entitytype='U' and AD_Field_id < 1000000; + +update AD_Column set entitytype = 'D' where entitytype='U' and AD_Column_id < 1000000; + +update AD_Column set entitytype = 'D' where entitytype='A' and AD_Column_id < 1000000; + +update AD_Process_Para set entitytype = 'D' where entitytype='U' and AD_Process_Para_ID < 1000000; + +update AD_Menu set entitytype = 'D' where entitytype='U' and AD_Menu_ID < 1000000; + +update AD_Tab set entitytype = 'D' where entitytype='U' and AD_Tab_ID < 1000000; + +UPDATE AD_System + SET LastMigrationScriptApplied='868_FixWrongEntityTypes.sql' +WHERE LastMigrationScriptApplied<'868_FixWrongEntityTypes.sql' + OR LastMigrationScriptApplied IS NULL +; diff --git a/migration/360lts-release/postgresql/868_FixWrongEntityTypes.sql b/migration/360lts-release/postgresql/868_FixWrongEntityTypes.sql new file mode 100644 index 0000000000..f0f4d37721 --- /dev/null +++ b/migration/360lts-release/postgresql/868_FixWrongEntityTypes.sql @@ -0,0 +1,19 @@ +update ad_element set entitytype = 'D' where entitytype='U' and AD_Element_id < 1000000; + +update ad_field set entitytype = 'D' where entitytype='U' and AD_Field_id < 1000000; + +update AD_Column set entitytype = 'D' where entitytype='U' and AD_Column_id < 1000000; + +update AD_Column set entitytype = 'D' where entitytype='A' and AD_Column_id < 1000000; + +update AD_Process_Para set entitytype = 'D' where entitytype='U' and AD_Process_Para_ID < 1000000; + +update AD_Menu set entitytype = 'D' where entitytype='U' and AD_Menu_ID < 1000000; + +update AD_Tab set entitytype = 'D' where entitytype='U' and AD_Tab_ID < 1000000; + +UPDATE AD_System + SET LastMigrationScriptApplied='868_FixWrongEntityTypes.sql' +WHERE LastMigrationScriptApplied<'868_FixWrongEntityTypes.sql' + OR LastMigrationScriptApplied IS NULL +;