diff --git a/server/src/com/cloud/upgrade/dao/Upgrade227to228.java b/server/src/com/cloud/upgrade/dao/Upgrade227to228.java index e95e6aa6e0d..08593d42823 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade227to228.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade227to228.java @@ -67,13 +67,13 @@ public class Upgrade227to228 implements DbUpgrade { while (rs.next()) { long dcId = rs.getLong(1); pstmt = conn.prepareStatement("select id from host where data_center_id=? and type='SecondaryStorage'"); - pstmt.setLong(0, dcId); + pstmt.setLong(1, dcId); ResultSet rs1 = pstmt.executeQuery(); if (rs1.next()) { long secHostId = rs1.getLong(1); - pstmt = conn.prepareStatement("update snapshot set sechost_id=? where data_center_id=?"); - pstmt.setLong(0, secHostId); - pstmt.setLong(0, dcId); + pstmt = conn.prepareStatement("update snapshots set sechost_id=? where data_center_id=?"); + pstmt.setLong(1, secHostId); + pstmt.setLong(2, dcId); pstmt.executeUpdate(); } } @@ -112,12 +112,12 @@ public class Upgrade227to228 implements DbUpgrade { for (Object[] network : networks) { Long networkId = (Long) network[0]; pstmt = conn.prepareStatement("SELECT * from domain_network_ref where network_id=?"); - pstmt.setLong(0, networkId); + pstmt.setLong(1, networkId); rs = pstmt.executeQuery(); if (rs.next()) { s_logger.debug("Setting network id=" + networkId + " as domain specific shared network"); pstmt = conn.prepareStatement("UPDATE networks set is_domain_specific=1 where id=?"); - pstmt.setLong(0, networkId); + pstmt.setLong(1, networkId); pstmt.executeUpdate(); } rs.close(); diff --git a/setup/db/db/schema-227to228.sql b/setup/db/db/schema-227to228.sql index 3ce53a22e0f..60a4f38d94b 100644 --- a/setup/db/db/schema-227to228.sql +++ b/setup/db/db/schema-227to228.sql @@ -86,7 +86,7 @@ INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `shared_source_nat_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if the network offering provides the shared source nat service'; -CREATE TABLE `cloud`.`op_host_transfer` ( +CREATE TABLE IF NOT EXISTS `cloud`.`op_host_transfer` ( `id` bigint unsigned UNIQUE NOT NULL COMMENT 'Id of the host', `initial_mgmt_server_id` bigint unsigned COMMENT 'management server the host is transfered from', `future_mgmt_server_id` bigint unsigned COMMENT 'management server the host is transfered to', @@ -104,7 +104,7 @@ ALTER TABLE `cloud`.`snapshots` ADD COLUMN `swift_name` varchar(255); ALTER TABLE `cloud`.`snapshots` ADD COLUMN `sechost_id` bigint unsigned; -CREATE TABLE `cloud`.`swift` ( +CREATE TABLE IF NOT EXISTS `cloud`.`swift` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `hostname` varchar(255), `account` varchar(255) COMMENT ' account in swift', @@ -131,3 +131,7 @@ UPDATE IGNORE configuration set name='guest.domain.suffix' where name='domain.su INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'guest.domain.suffix', 'cloud.internal', 'Default domain name for vms inside virtualized networks fronted by router'); DELETE FROM configuration WHERE name='domain.suffix'; +ALTER TABLE `cloud`.`user` ADD COLUMN `registration_token` varchar(255) default NULL; +ALTER TABLE `cloud`.`user` ADD COLUMN `is_registered` tinyint NOT NULL DEFAULT 0; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `removed` datetime; +