mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Fixed upgrade for volumes table
This commit is contained in:
parent
2d23ce6dd1
commit
354bc8f684
@ -160,11 +160,11 @@ public class Upgrade222to224 implements DbUpgrade {
|
||||
|
||||
// fixes bug 9597
|
||||
private void fixRecreatableVolumesProblem(Connection conn) throws SQLException {
|
||||
PreparedStatement pstmt = conn.prepareStatement("UPDATE volumes as v SET recreatable=(SELECT recreatable FROM disk_offering d WHERE d.id = v.disk_offering_id)");
|
||||
PreparedStatement pstmt = conn.prepareStatement("UPDATE volumes as v SET recreatable=(SELECT recreatable FROM disk_offering d WHERE d.id = v.disk_offering_id) WHERE disk_offering_id != 0");
|
||||
pstmt.execute();
|
||||
pstmt.close();
|
||||
|
||||
pstmt = conn.prepareStatement("UPDATE volumes SET recreatable=0 WHERE disk_offering_id is NULL");
|
||||
pstmt = conn.prepareStatement("UPDATE volumes SET recreatable=0 WHERE disk_offering_id is NULL or disk_offering_id=0");
|
||||
pstmt.execute();
|
||||
pstmt.close();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user