Skip to content

Commit 36a43ab

Browse files
committed
schema: add 4.5.2 to 4.5.3 upgrade path stubs
(cherry picked from commit 17166eb) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 6e426fa commit 36a43ab

3 files changed

Lines changed: 107 additions & 0 deletions

File tree

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: 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)