From a60d232d07fb1f3743bdb928db37367d1e5b3f2e Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Sat, 6 Dec 2014 05:54:39 +0530 Subject: [PATCH] CLOUDSTACK-6212: Let vm_instance table's ID field be unique and auto_increment `vm_instance` table's id column is unique but does not auto_increment like other resource tables. The fix simply alter the table's id column to have it auto_increment which may avoid id conflicts in a multi-master mysql setup. Signed-off-by: Rohit Yadav (cherry picked from commit e1e5e12aaa649c05f2d5bebe1bdaec00e284dcf0) Signed-off-by: Rohit Yadav --- setup/db/db/schema-442to450.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/db/db/schema-442to450.sql b/setup/db/db/schema-442to450.sql index 6c456c5da88..72979c843f3 100644 --- a/setup/db/db/schema-442to450.sql +++ b/setup/db/db/schema-442to450.sql @@ -35,6 +35,7 @@ CREATE VIEW `cloud`.`storage_tag_view` AS ALTER TABLE `cloud`.`volumes` ADD COLUMN `provisioning_type` VARCHAR(32) NOT NULL DEFAULT 'thin' COMMENT 'pre allocation setting of the volume'; ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `provisioning_type` VARCHAR(32) NOT NULL DEFAULT 'thin' COMMENT 'pre allocation setting of the volume'; +ALTER TABLE `cloud`.`vm_instance` MODIFY id bigint unsigned AUTO_INCREMENT UNIQUE NOT NULL; DROP VIEW IF EXISTS `cloud`.`disk_offering_view`; CREATE VIEW `cloud`.`disk_offering_view` AS