Skip to content

Commit a52fd08

Browse files
committed
4.4.2 upgrade schema
remove 441to450 ddl (cherry picked from commit 5578616) (cherry picked from commit f18d623) Conflicts: engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java schema: Add upgrade paths from 4.3.2 to 4.4.0 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> (cherry picked from commit 73c6283)
1 parent b85183e commit a52fd08

6 files changed

Lines changed: 154 additions & 65 deletions

File tree

engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java

Lines changed: 60 additions & 56 deletions
Large diffs are not rendered by default.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package com.cloud.upgrade.dao;
19+
20+
import java.io.File;
21+
import java.sql.Connection;
22+
23+
import org.apache.log4j.Logger;
24+
25+
import com.cloud.utils.exception.CloudRuntimeException;
26+
import com.cloud.utils.script.Script;
27+
28+
public class Upgrade441to442 implements DbUpgrade {
29+
final static Logger s_logger = Logger.getLogger(Upgrade441to442.class);
30+
31+
@Override
32+
public String[] getUpgradableVersionRange() {
33+
return new String[] {"4.4.1", "4.4.2"};
34+
}
35+
36+
@Override
37+
public String getUpgradedVersion() {
38+
return "4.4.2";
39+
}
40+
41+
@Override
42+
public boolean supportsRollingUpgrade() {
43+
return false;
44+
}
45+
46+
@Override
47+
public File[] getPrepareScripts() {
48+
String script = Script.findScript("", "db/schema-441to442.sql");
49+
if (script == null) {
50+
throw new CloudRuntimeException("Unable to find db/schema-441to442.sql");
51+
}
52+
53+
return new File[] {new File(script)};
54+
}
55+
56+
@Override
57+
public void performDataMigration(Connection conn) {
58+
}
59+
60+
@Override
61+
public File[] getCleanupScripts() {
62+
return null;
63+
}
64+
}

engine/schema/src/com/cloud/upgrade/dao/Upgrade441to450.java renamed to engine/schema/src/com/cloud/upgrade/dao/Upgrade442to450.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
import com.cloud.utils.exception.CloudRuntimeException;
3636
import com.cloud.utils.script.Script;
3737

38-
public class Upgrade441to450 implements DbUpgrade {
39-
final static Logger s_logger = Logger.getLogger(Upgrade441to450.class);
38+
public class Upgrade442to450 implements DbUpgrade {
39+
final static Logger s_logger = Logger.getLogger(Upgrade442to450.class);
4040

4141
@Override
4242
public String[] getUpgradableVersionRange() {
43-
return new String[] {"4.4.1", "4.5.0"};
43+
return new String[] {"4.4.2", "4.5.0"};
4444
}
4545

4646
@Override
@@ -55,9 +55,9 @@ public boolean supportsRollingUpgrade() {
5555

5656
@Override
5757
public File[] getPrepareScripts() {
58-
String script = Script.findScript("", "db/schema-441to450.sql");
58+
String script = Script.findScript("", "db/schema-442to450.sql");
5959
if (script == null) {
60-
throw new CloudRuntimeException("Unable to find db/schema-441to450.sql");
60+
throw new CloudRuntimeException("Unable to find db/schema-442to450.sql");
6161
}
6262

6363
return new File[] {new File(script)};
@@ -73,9 +73,9 @@ public void performDataMigration(Connection conn) {
7373

7474
@Override
7575
public File[] getCleanupScripts() {
76-
String script = Script.findScript("", "db/schema-441to450-cleanup.sql");
76+
String script = Script.findScript("", "db/schema-442to450-cleanup.sql");
7777
if (script == null) {
78-
throw new CloudRuntimeException("Unable to find db/schema-441to450-cleanup.sql");
78+
throw new CloudRuntimeException("Unable to find db/schema-442to450-cleanup.sql");
7979
}
8080

8181
return new File[] {new File(script)};

setup/db/db/schema-441to442.sql

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- Licensed to the Apache Software Foundation (ASF) under one
2+
-- or more contributor license agreements. See the NOTICE file
3+
-- distributed with this work for additional information
4+
-- regarding copyright ownership. The ASF licenses this file
5+
-- to you under the Apache License, Version 2.0 (the
6+
-- "License"); you may not use this file except in compliance
7+
-- with the License. You may obtain a copy of the License at
8+
--
9+
-- http://www.apache.org/licenses/LICENSE-2.0
10+
--
11+
-- Unless required by applicable law or agreed to in writing,
12+
-- software distributed under the License is distributed on an
13+
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
-- KIND, either express or implied. See the License for the
15+
-- specific language governing permissions and limitations
16+
-- under the License.
17+
18+
--;
19+
-- Schema upgrade from 4.4.1 to 4.4.2;
20+
--;
21+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-- under the License.
1717

1818
--
19-
-- Schema cleanup from 4.4.0 to 4.5.0
19+
-- Schema cleanup from 4.4.2 to 4.5.0
2020
--
2121

2222
UPDATE `cloud`.`configuration`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-- under the License.
1717

1818
--
19-
-- Schema upgrade from 4.4.1 to 4.5.0
19+
-- Schema upgrade from 4.4.2 to 4.5.0
2020
--
2121

2222
-- Disable foreign key checking

0 commit comments

Comments
 (0)