Skip to content

Commit 1525ac0

Browse files
committed
Merge pull request #824 from shapeblue/4.5.3-upgradepath
4.5.3 upgradepath for master branchcc @remibergsma @karuturi * pr/824: schema: add 4.5.3 to 4.6.0 upgrade path stubs schema: add 4.5.2 to 4.5.3 upgrade path stubs Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2 parents 1ba362d + 5b5152b commit 1525ac0

File tree

5 files changed

+139
-0
lines changed

5 files changed

+139
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import com.cloud.upgrade.dao.Upgrade450to451;
5858
import com.cloud.upgrade.dao.Upgrade451to452;
5959
import com.cloud.upgrade.dao.Upgrade452to460;
60+
import com.cloud.upgrade.dao.Upgrade453to460;
6061
import com.cloud.upgrade.dao.UpgradeSnapshot217to224;
6162
import com.cloud.upgrade.dao.UpgradeSnapshot223to224;
6263
import com.cloud.upgrade.dao.VersionDao;
@@ -239,6 +240,8 @@ public DatabaseUpgradeChecker() {
239240

240241
_upgradeMap.put("4.5.2", new DbUpgrade[] {new Upgrade452to460()});
241242

243+
_upgradeMap.put("4.5.3", new DbUpgrade[] {new Upgrade453to460()});
244+
242245
//CP Upgrades
243246
_upgradeMap.put("3.0.3", new DbUpgrade[] {new Upgrade303to304(), new Upgrade304to305(), new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(),
244247
new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442(), new Upgrade442to450(), new Upgrade450to451(), new Upgrade451to452(), new Upgrade452to460()});
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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 com.cloud.utils.exception.CloudRuntimeException;
21+
import com.cloud.utils.script.Script;
22+
import org.apache.log4j.Logger;
23+
24+
import java.io.File;
25+
import java.sql.Connection;
26+
27+
public class Upgrade452to453 implements DbUpgrade {
28+
final static Logger s_logger = Logger.getLogger(Upgrade452to453.class);
29+
30+
@Override
31+
public String[] getUpgradableVersionRange() {
32+
return new String[] {"4.5.2", "4.5.3"};
33+
}
34+
35+
@Override
36+
public String getUpgradedVersion() {
37+
return "4.5.3";
38+
}
39+
40+
@Override
41+
public boolean supportsRollingUpgrade() {
42+
return false;
43+
}
44+
45+
@Override
46+
public File[] getPrepareScripts() {
47+
String script = Script.findScript("", "db/schema-452to453.sql");
48+
if (script == null) {
49+
throw new CloudRuntimeException("Unable to find db/schema-452to453.sql");
50+
}
51+
return new File[] {new File(script)};
52+
}
53+
54+
@Override
55+
public void performDataMigration(Connection conn) {
56+
}
57+
58+
@Override
59+
public File[] getCleanupScripts() {
60+
String script = Script.findScript("", "db/schema-452to453-cleanup.sql");
61+
if (script == null) {
62+
throw new CloudRuntimeException("Unable to find db/schema-452to453-cleanup.sql");
63+
}
64+
65+
return new File[] {new File(script)};
66+
}
67+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 org.apache.log4j.Logger;
21+
22+
public class Upgrade453to460 extends Upgrade452to460 implements DbUpgrade {
23+
final static Logger s_logger = Logger.getLogger(Upgrade453to460.class);
24+
25+
@Override
26+
public String[] getUpgradableVersionRange() {
27+
return new String[] { "4.5.3", "4.6.0" };
28+
}
29+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 cleanup from 4.5.2 to 4.5.3;
20+
--;

setup/db/db/schema-452to453.sql

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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.5.2 to 4.5.3;
20+
--;

0 commit comments

Comments
 (0)