From f444ce7f650da2a0153f65e31a5109370702a3be Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Thu, 1 Aug 2013 09:56:43 -0700 Subject: [PATCH] CLOUDSTACK-4015: don't insert the fake template record when upgrade from 304 to 305 --- .../cloud/upgrade/dao/Upgrade304to305.java | 7 +----- setup/db/db/vmwaretmplinsert-304to305.sql | 22 ------------------- 2 files changed, 1 insertion(+), 28 deletions(-) delete mode 100755 setup/db/db/vmwaretmplinsert-304to305.sql diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade304to305.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade304to305.java index f9b7e5ea94a..dc4668f5870 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade304to305.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade304to305.java @@ -56,13 +56,8 @@ public class Upgrade304to305 extends Upgrade30xBase implements DbUpgrade { if (script == null) { throw new CloudRuntimeException("Unable to find db/schema-304to305.sql"); } - - String vmWareTemplateInsertScript = Script.findScript("", "db/vmwaretmplinsert-304to305.sql"); - if (vmWareTemplateInsertScript == null) { - throw new CloudRuntimeException("Unable to find db/vmwaretmplinsert-304to305.sql"); - } - return new File[] { new File(vmWareTemplateInsertScript), new File(script) }; + return new File[] { new File(script) }; } @Override diff --git a/setup/db/db/vmwaretmplinsert-304to305.sql b/setup/db/db/vmwaretmplinsert-304to305.sql deleted file mode 100755 index 469d937e067..00000000000 --- a/setup/db/db/vmwaretmplinsert-304to305.sql +++ /dev/null @@ -1,22 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliances --- with 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. - -#This file doesn't exist on 3.0.x branch. The fake template record is being inserted just because this template will never be used in 4.2 version of the code -INSERT IGNORE INTO `cloud`.`vm_template` (unique_name, name, public, featured, type, hvm, bits, url, format, created, account_id, checksum, display_text, enable_password, - enable_sshkey, guest_os_id, bootable, prepopulate, cross_zones, extractable, hypervisor_type, source_template_id, template_tag, sort_key) -VALUES ("systemvm-vmware-3.0.5", "systemvm-vmware-3.0.5", 1, 1, "USER", 0, 64, "fake url", "fake format", now(), 1, null, "fake text", 0, - 0, 99, 1, 0, 1, 0, "VMware", NULL, NULL, 0);