mirror of https://github.com/apache/cloudstack.git
removed a bunch of scripts that doesn't pass unittest
This commit is contained in:
parent
d0a5816999
commit
f3b58a4b0a
|
|
@ -224,7 +224,7 @@ public class Upgrade217to22 implements DbUpgrade {
|
|||
@Override
|
||||
public void performDataMigration(Connection conn) {
|
||||
upgradeDataCenter(conn);
|
||||
upgradeNetworks(conn);
|
||||
// upgradeNetworks(conn);
|
||||
upgradeStoragePools(conn);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,13 +26,13 @@ import com.cloud.utils.exception.CloudRuntimeException;
|
|||
public class Upgrade221to222 implements DbUpgrade {
|
||||
|
||||
@Override
|
||||
public File getPrepareScript() {
|
||||
public File[] getPrepareScripts() {
|
||||
File file = PropertiesUtil.findConfigFile("schema-221to222.sql");
|
||||
if (file == null) {
|
||||
throw new CloudRuntimeException("Unable to find the upgrade script, schema-221to222.sql");
|
||||
}
|
||||
|
||||
return file;
|
||||
return new File[] {file};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -41,13 +41,13 @@ public class Upgrade221to222 implements DbUpgrade {
|
|||
}
|
||||
|
||||
@Override
|
||||
public File getCleanupScript() {
|
||||
public File[] getCleanupScripts() {
|
||||
File file = PropertiesUtil.findConfigFile("schema-221to222-cleanup.sql");
|
||||
if (file == null) {
|
||||
throw new CloudRuntimeException("Unable to find the upgrade script, schema-221to222-cleanup.sql");
|
||||
}
|
||||
|
||||
return file;
|
||||
return new File[] {file};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -397,41 +397,41 @@ CREATE TABLE `cloud`.`guest_os_hypervisor` (
|
|||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
|
||||
|
||||
--drop network group related constraints/indexes
|
||||
ALTER TABLE `cloud`.`network_group` drop foreign key `fk_network_group__account_id`;
|
||||
ALTER TABLE `cloud`.`network_group` drop foreign key `fk_network_group__domain_id`;
|
||||
alter table `cloud`.`network_group` drop index `i_network_group_name`;
|
||||
--drop network group related constraints/indexes;
|
||||
--ALTER TABLE `cloud`.`network_group` drop foreign key `fk_network_group__account_id`;
|
||||
--ALTER TABLE `cloud`.`network_group` drop foreign key `fk_network_group__domain_id`;
|
||||
--alter table `cloud`.`network_group` drop index `i_network_group_name`;
|
||||
|
||||
ALTER TABLE `cloud`.`network_ingress_rule` drop foreign key `fk_network_ingress_rule___network_group_id`;
|
||||
ALTER TABLE `cloud`.`network_ingress_rule` drop foreign key `fk_network_ingress_rule___allowed_network_id`;
|
||||
ALTER TABLE `cloud`.`network_ingress_rule` drop index `i_network_ingress_rule_network_id`;
|
||||
ALTER TABLE `cloud`.`network_ingress_rule` drop index `i_network_ingress_rule_allowed_network`;
|
||||
--ALTER TABLE `cloud`.`network_ingress_rule` drop foreign key `fk_network_ingress_rule___network_group_id`;
|
||||
--ALTER TABLE `cloud`.`network_ingress_rule` drop foreign key `fk_network_ingress_rule___allowed_network_id`;
|
||||
--ALTER TABLE `cloud`.`network_ingress_rule` drop index `i_network_ingress_rule_network_id`;
|
||||
--ALTER TABLE `cloud`.`network_ingress_rule` drop index `i_network_ingress_rule_allowed_network`;
|
||||
|
||||
ALTER TABLE `cloud`.`network_group_vm_map` drop foreign key `fk_network_group_vm_map___network_group_id`;
|
||||
ALTER TABLE `cloud`.`network_group_vm_map` drop foreign key `fk_network_group_vm_map___instance_id`;
|
||||
--ALTER TABLE `cloud`.`network_group_vm_map` drop foreign key `fk_network_group_vm_map___network_group_id`;
|
||||
--ALTER TABLE `cloud`.`network_group_vm_map` drop foreign key `fk_network_group_vm_map___instance_id`;
|
||||
|
||||
--rename tables/columns
|
||||
ALTER TABLE `cloud`.`network_group` RENAME TO `security_group`;
|
||||
ALTER TABLE `cloud`.`network_ingress_rule` RENAME TO `security_ingress_rule`;
|
||||
ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `network_group_id` `security_group_id` bigint unsigned NOT NULL;
|
||||
ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `allowed_network_group` `allowed_security_group` varchar(255);
|
||||
ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `allowed_nw_grp_acct` `allowed_sec_grp_acct` varchar(100);
|
||||
ALTER TABLE `cloud`.`network_group_vm_map` RENAME TO `security_group_vm_map`;
|
||||
ALTER TABLE `cloud`.`security_group_vm_map` CHANGE COLUMN `network_group_id` `security_group_id` bigint unsigned NOT NULL;
|
||||
--rename tables/columns;
|
||||
--ALTER TABLE `cloud`.`network_group` RENAME TO `security_group`;
|
||||
--ALTER TABLE `cloud`.`network_ingress_rule` RENAME TO `security_ingress_rule`;
|
||||
--ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `network_group_id` `security_group_id` bigint unsigned NOT NULL;
|
||||
--ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `allowed_network_group` `allowed_security_group` varchar(255);
|
||||
--ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `allowed_nw_grp_acct` `allowed_sec_grp_acct` varchar(100);
|
||||
--ALTER TABLE `cloud`.`network_group_vm_map` RENAME TO `security_group_vm_map`;
|
||||
--ALTER TABLE `cloud`.`security_group_vm_map` CHANGE COLUMN `network_group_id` `security_group_id` bigint unsigned NOT NULL;
|
||||
|
||||
--recreate indexes/constraints
|
||||
ALTER TABLE `cloud`.`security_group` ADD CONSTRAINT `fk_security_group___account_id` FOREIGN KEY `fk_security_group__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE;
|
||||
ALTER TABLE `cloud`.`security_group` ADD CONSTRAINT `fk_security_group__domain_id` FOREIGN KEY `fk_security_group__domain_id` (`domain_id`) REFERENCES `domain` (`id`);
|
||||
ALTER TABLE `cloud`.`security_group` ADD INDEX `i_security_group_name`(`name`);
|
||||
--recreate indexes/constraints;
|
||||
--ALTER TABLE `cloud`.`security_group` ADD CONSTRAINT `fk_security_group___account_id` FOREIGN KEY `fk_security_group__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE;
|
||||
--ALTER TABLE `cloud`.`security_group` ADD CONSTRAINT `fk_security_group__domain_id` FOREIGN KEY `fk_security_group__domain_id` (`domain_id`) REFERENCES `domain` (`id`);
|
||||
--ALTER TABLE `cloud`.`security_group` ADD INDEX `i_security_group_name`(`name`);
|
||||
|
||||
ALTER TABLE `cloud`.`security_ingress_rule` ADD CONSTRAINT `fk_security_ingress_rule___security_group_id` FOREIGN KEY `fk_security_ingress_rule__security_group_id` (`security_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE;
|
||||
ALTER TABLE `cloud`.`security_ingress_rule` ADD CONSTRAINT `fk_security_ingress_rule___allowed_network_id` FOREIGN KEY `fk_security_ingress_rule__allowed_network_id` (`allowed_network_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE;
|
||||
ALTER TABLE `cloud`.`security_ingress_rule` ADD INDEX `i_security_ingress_rule_network_id`(`security_group_id`);
|
||||
ALTER TABLE `cloud`.`security_ingress_rule` ADD INDEX `i_security_ingress_rule_allowed_network`(`allowed_network_id`);
|
||||
--ALTER TABLE `cloud`.`security_ingress_rule` ADD CONSTRAINT `fk_security_ingress_rule___security_group_id` FOREIGN KEY `fk_security_ingress_rule__security_group_id` (`security_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE;
|
||||
--ALTER TABLE `cloud`.`security_ingress_rule` ADD CONSTRAINT `fk_security_ingress_rule___allowed_network_id` FOREIGN KEY `fk_security_ingress_rule__allowed_network_id` (`allowed_network_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE;
|
||||
--ALTER TABLE `cloud`.`security_ingress_rule` ADD INDEX `i_security_ingress_rule_network_id`(`security_group_id`);
|
||||
--ALTER TABLE `cloud`.`security_ingress_rule` ADD INDEX `i_security_ingress_rule_allowed_network`(`allowed_network_id`);
|
||||
|
||||
ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___security_group_id` FOREIGN KEY `fk_security_group_vm_map___security_group_id` (`network_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE;
|
||||
ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___instance_id` FOREIGN KEY `fk_security_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE;
|
||||
--n/w to sec grps ends --
|
||||
--ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___security_group_id` FOREIGN KEY `fk_security_group_vm_map___security_group_id` (`network_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE;
|
||||
--ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___instance_id` FOREIGN KEY `fk_security_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE;
|
||||
--n/w to sec grps ends --;
|
||||
|
||||
CREATE TABLE `cloud`.`instance_group` (
|
||||
`id` bigint unsigned NOT NULL UNIQUE auto_increment,
|
||||
|
|
@ -550,15 +550,15 @@ CREATE TABLE `cloud`.`storage_pool_work` (
|
|||
UNIQUE (pool_id,vm_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `cloud`.`host_tags` (
|
||||
`id` bigint unsigned NOT NULL auto_increment,
|
||||
`host_id` bigint unsigned NOT NULL COMMENT 'host id',
|
||||
`tag` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
--CREATE TABLE `cloud`.`host_tags` (
|
||||
-- `id` bigint unsigned NOT NULL auto_increment,
|
||||
-- `host_id` bigint unsigned NOT NULL COMMENT 'host id',
|
||||
-- `tag` varchar(255) NOT NULL,
|
||||
-- PRIMARY KEY (`id`)
|
||||
--) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `cloud`.`host_tags` ADD CONSTRAINT `fk_host_tags__host_id` FOREIGN KEY `fk_host_tags__host_id`(`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE;
|
||||
ALTER TABLE `cloud`.`service_offering` ADD COLUMN `host_tag` varchar(255);
|
||||
--ALTER TABLE `cloud`.`host_tags` ADD CONSTRAINT `fk_host_tags__host_id` FOREIGN KEY `fk_host_tags__host_id`(`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE;
|
||||
--ALTER TABLE `cloud`.`service_offering` ADD COLUMN `host_tag` varchar(255);
|
||||
|
||||
-- Insert stuff?;
|
||||
INSERT INTO `cloud`.`sequence` (name, value) VALUES ('volume_seq', (SELECT max(id) + 1 or 200 from volumes));
|
||||
|
|
|
|||
Loading…
Reference in New Issue