This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/master by this push:
new 671a70a schema: add empty DB upgrade path from 4.12.0.0 to 4.13.0.0
(#3236)
671a70a is described below
commit 671a70a9a5f2de0cccb81b6af6c7b27fa03dd536
Author: Rohit Yadav <[email protected]>
AuthorDate: Wed Mar 27 00:00:47 2019 +0530
schema: add empty DB upgrade path from 4.12.0.0 to 4.13.0.0 (#3236)
This adds empty empty upgrade path from 4.12.0.0 to 4.13.0.0.
Signed-off-by: Rohit Yadav <[email protected]>
---
.../com/cloud/upgrade/DatabaseUpgradeChecker.java | 2 +
.../com/cloud/upgrade/dao/Upgrade41200to41300.java | 72 ++++++++++++++++++++++
.../META-INF/db/schema-41200to41300-cleanup.sql | 21 +++++++
.../resources/META-INF/db/schema-41200to41300.sql | 21 +++++++
4 files changed, 116 insertions(+)
diff --git
a/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java
b/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java
index 6da40fb..fbb1399 100644
--- a/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -64,6 +64,7 @@ import com.cloud.upgrade.dao.Upgrade410to420;
import com.cloud.upgrade.dao.Upgrade41100to41110;
import com.cloud.upgrade.dao.Upgrade41110to41120;
import com.cloud.upgrade.dao.Upgrade41120to41200;
+import com.cloud.upgrade.dao.Upgrade41200to41300;
import com.cloud.upgrade.dao.Upgrade420to421;
import com.cloud.upgrade.dao.Upgrade421to430;
import com.cloud.upgrade.dao.Upgrade430to440;
@@ -183,6 +184,7 @@ public class DatabaseUpgradeChecker implements
SystemIntegrityChecker {
.next("4.11.0.0", new Upgrade41100to41110())
.next("4.11.1.0", new Upgrade41110to41120())
.next("4.11.2.0", new Upgrade41120to41200())
+ .next("4.12.0.0", new Upgrade41200to41300())
.build();
}
diff --git
a/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41200to41300.java
b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41200to41300.java
new file mode 100644
index 0000000..f7e968c
--- /dev/null
+++ b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41200to41300.java
@@ -0,0 +1,72 @@
+// 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 compliance
+// 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.
+
+package com.cloud.upgrade.dao;
+
+import java.io.InputStream;
+import java.sql.Connection;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.utils.exception.CloudRuntimeException;
+
+public class Upgrade41200to41300 implements DbUpgrade {
+
+ final static Logger LOG = Logger.getLogger(Upgrade41200to41300.class);
+
+ @Override
+ public String[] getUpgradableVersionRange() {
+ return new String[] {"4.12.0.0", "4.13.0.0"};
+ }
+
+ @Override
+ public String getUpgradedVersion() {
+ return "4.13.0.0";
+ }
+
+ @Override
+ public boolean supportsRollingUpgrade() {
+ return false;
+ }
+
+ @Override
+ public InputStream[] getPrepareScripts() {
+ final String scriptFile = "META-INF/db/schema-41200to41300.sql";
+ final InputStream script =
Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find " + scriptFile);
+ }
+
+ return new InputStream[] {script};
+ }
+
+ @Override
+ public void performDataMigration(Connection conn) {
+
+ }
+
+ @Override
+ public InputStream[] getCleanupScripts() {
+ final String scriptFile =
"META-INF/db/schema-41200to41300-cleanup.sql";
+ final InputStream script =
Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find " + scriptFile);
+ }
+
+ return new InputStream[] {script};
+ }
+}
diff --git
a/engine/schema/src/main/resources/META-INF/db/schema-41200to41300-cleanup.sql
b/engine/schema/src/main/resources/META-INF/db/schema-41200to41300-cleanup.sql
new file mode 100644
index 0000000..5702186
--- /dev/null
+++
b/engine/schema/src/main/resources/META-INF/db/schema-41200to41300-cleanup.sql
@@ -0,0 +1,21 @@
+-- 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 compliance
+-- 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.
+
+--;
+-- Schema upgrade cleanup from 4.12.0.0 to 4.13.0.0
+--;
+
diff --git
a/engine/schema/src/main/resources/META-INF/db/schema-41200to41300.sql
b/engine/schema/src/main/resources/META-INF/db/schema-41200to41300.sql
new file mode 100644
index 0000000..d4de8c4
--- /dev/null
+++ b/engine/schema/src/main/resources/META-INF/db/schema-41200to41300.sql
@@ -0,0 +1,21 @@
+-- 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 compliance
+-- 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.
+
+--;
+-- Schema upgrade from 4.12.0.0 to 4.13.0.0
+--;
+