Skip to content

Commit eb66645

Browse files
committed
CLOUDSTACK-6212: auto_increment for some other resource tables
This fix alters table columns which are primary keys but don't have them auto_increment such as region, domain_router, user_vm etc. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> (cherry picked from commit a11ddf3) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent a60d232 commit eb66645

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@ 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;
38+
39+
-- Have primary keys of following table AUTO_INCREMENT
40+
ALTER TABLE `cloud`.`region` MODIFY `id` int unsigned AUTO_INCREMENT UNIQUE NOT NULL;
41+
ALTER TABLE `cloud`.`vm_instance` MODIFY `id` bigint unsigned AUTO_INCREMENT UNIQUE NOT NULL;
42+
ALTER TABLE `cloud`.`user_vm` MODIFY `id` bigint unsigned AUTO_INCREMENT UNIQUE NOT NULL;
43+
ALTER TABLE `cloud`.`domain_router` MODIFY `id` bigint unsigned AUTO_INCREMENT UNIQUE NOT NULL;
44+
ALTER TABLE `cloud`.`service_offering` MODIFY `id` bigint unsigned AUTO_INCREMENT NOT NULL;
45+
ALTER TABLE `cloud`.`load_balancing_rules` MODIFY `id` bigint unsigned AUTO_INCREMENT NOT NULL;
46+
ALTER TABLE `cloud`.`port_forwarding_rules` MODIFY `id` bigint unsigned AUTO_INCREMENT NOT NULL;
3947

4048
DROP VIEW IF EXISTS `cloud`.`disk_offering_view`;
4149
CREATE VIEW `cloud`.`disk_offering_view` AS

0 commit comments

Comments
 (0)