From be04f2bd631d3e95fc4d389999f4e373688e0518 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 11 Apr 2012 16:14:47 -0700 Subject: [PATCH] Remove obsolete network_tags table as a part of db upgrade cleanup --- .../com/cloud/upgrade/dao/Upgrade301to302.java | 7 ++++++- setup/db/db/schema-301to302-cleanup.sql | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 setup/db/db/schema-301to302-cleanup.sql diff --git a/server/src/com/cloud/upgrade/dao/Upgrade301to302.java b/server/src/com/cloud/upgrade/dao/Upgrade301to302.java index c137cf282e5..e737b3c9bc1 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade301to302.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade301to302.java @@ -57,6 +57,11 @@ public class Upgrade301to302 implements DbUpgrade { @Override public File[] getCleanupScripts() { - return null; + String script = Script.findScript("", "db/schema-301to302-cleanup.sql"); + if (script == null) { + throw new CloudRuntimeException("Unable to find db/schema-301to302-cleanup.sql"); + } + + return new File[] { new File(script) }; } } diff --git a/setup/db/db/schema-301to302-cleanup.sql b/setup/db/db/schema-301to302-cleanup.sql new file mode 100644 index 00000000000..50f22e9eadc --- /dev/null +++ b/setup/db/db/schema-301to302-cleanup.sql @@ -0,0 +1,17 @@ +# Copyright 2012 Citrix Systems, Inc. Licensed under the +# Apache License, Version 2.0 (the "License"); you may not use this +# file except in compliance with the License. Citrix Systems, Inc. +# reserves all rights not expressly granted by the License. +# You may obtain a copy of the License at http:#www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +#Schema cleanup from 3.0.1 to 3.0.2; + + +DROP TABLE IF EXISTS `cloud`.`network_tags`;