Skip to content

Commit e1e5e12

Browse files
committed
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 <rohit.yadav@shapeblue.com>
1 parent 4f748e6 commit e1e5e12

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

setup/db/db/schema-442to450.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ CREATE VIEW `cloud`.`storage_tag_view` AS
3535

3636
ALTER TABLE `cloud`.`volumes` ADD COLUMN `provisioning_type` VARCHAR(32) NOT NULL DEFAULT 'thin' COMMENT 'pre allocation setting of the volume';
3737
ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `provisioning_type` VARCHAR(32) NOT NULL DEFAULT 'thin' COMMENT 'pre allocation setting of the volume';
38+
ALTER TABLE `cloud`.`vm_instance` MODIFY id bigint unsigned AUTO_INCREMENT UNIQUE NOT NULL;
3839

3940
DROP VIEW IF EXISTS `cloud`.`disk_offering_view`;
4041
CREATE VIEW `cloud`.`disk_offering_view` AS

0 commit comments

Comments
 (0)