bug 10651: added missing keys to 227 to 228 db upgrade

status 10651: resolved fixed
This commit is contained in:
alena 2011-07-08 09:45:12 -07:00
parent 1bdc0de98c
commit 70b1c69ef3
2 changed files with 2 additions and 19 deletions

View File

@ -23,8 +23,6 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.log4j.Logger;
@ -87,7 +85,6 @@ public class Upgrade227to228 implements DbUpgrade {
}
updateDomainLevelNetworks(conn);
dropKeysIfExist(conn);
}
@Override
@ -131,20 +128,4 @@ public class Upgrade227to228 implements DbUpgrade {
}
}
private void dropKeysIfExist(Connection conn) {
HashMap<String, List<String>> indexes = new HashMap<String, List<String>>();
// domain router table
List<String> keys = new ArrayList<String>();
keys.add("unique_name");
indexes.put("network_offerings", keys);
s_logger.debug("Dropping keys that don't exist in 2.2.8 version of the DB...");
// drop indexes now
for (String tableName : indexes.keySet()) {
DbUpgradeUtils.dropKeysIfExist(conn, tableName, indexes.get(tableName), false);
}
}
}

View File

@ -135,3 +135,5 @@ ALTER TABLE `cloud`.`user` ADD COLUMN `registration_token` varchar(255) default
ALTER TABLE `cloud`.`user` ADD COLUMN `is_registered` tinyint NOT NULL DEFAULT 0;
ALTER TABLE `cloud`.`data_center` ADD COLUMN `removed` datetime;
CREATE INDEX `i_op_lock__mac_ip_thread` on `op_lock` (`mac`, `ip`, `thread`);