Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions engine/schema/src/main/resources/META-INF/db/schema-20to21.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ SET foreign_key_checks = 0;
--
-- Schema upgrade from 2.0 to 2.1
--
CREATE TABLE `cloud`.`cluster` (
CREATE TABLE IF NOT EXISTS `cloud`.`cluster` (
`id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
`name` varchar(255) NOT NULL COMMENT 'name for the cluster',
`pod_id` bigint unsigned NOT NULL COMMENT 'pod id',
`data_center_id` bigint unsigned NOT NULL COMMENT 'data center id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`ext_lun_alloc` (
CREATE TABLE IF NOT EXISTS `cloud`.`ext_lun_alloc` (
`id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
`size` bigint unsigned NOT NULL COMMENT 'virtual size',
`portal` varchar(255) NOT NULL COMMENT 'ip or host name to the storage server',
Expand All @@ -40,22 +40,22 @@ CREATE TABLE `cloud`.`ext_lun_alloc` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`ext_lun_details` (
CREATE TABLE IF NOT EXISTS `cloud`.`ext_lun_details` (
`id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
`ext_lun_id` bigint unsigned NOT NULL COMMENT 'lun id',
`tag` varchar(255) COMMENT 'tags associated with this vm',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`storage_pool_details` (
CREATE TABLE IF NOT EXISTS `cloud`.`storage_pool_details` (
`id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id',
`pool_id` bigint unsigned NOT NULL COMMENT 'pool the detail is related to',
`name` varchar(255) NOT NULL COMMENT 'name of the detail',
`value` varchar(255) NOT NULL COMMENT 'value of the detail',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`network_group` (
CREATE TABLE IF NOT EXISTS `cloud`.`network_group` (
`id` bigint unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`description` varchar(4096) NULL,
Expand All @@ -65,7 +65,7 @@ CREATE TABLE `cloud`.`network_group` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`network_ingress_rule` (
CREATE TABLE IF NOT EXISTS `cloud`.`network_ingress_rule` (
`id` bigint unsigned NOT NULL auto_increment,
`network_group_id` bigint unsigned NOT NULL,
`start_port` varchar(10) default NULL,
Expand All @@ -79,14 +79,14 @@ CREATE TABLE `cloud`.`network_ingress_rule` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`network_group_vm_map` (
CREATE TABLE IF NOT EXISTS `cloud`.`network_group_vm_map` (
`id` bigint unsigned NOT NULL auto_increment,
`network_group_id` bigint unsigned NOT NULL,
`instance_id` bigint unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`op_nwgrp_work` (
CREATE TABLE IF NOT EXISTS `cloud`.`op_nwgrp_work` (
`id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id',
`instance_id` bigint unsigned NOT NULL COMMENT 'vm instance that needs rules to be synced.',
`mgmt_server_id` bigint unsigned COMMENT 'management server that has taken up the work of doing rule sync',
Expand All @@ -97,22 +97,22 @@ CREATE TABLE `cloud`.`op_nwgrp_work` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`op_vm_ruleset_log` (
CREATE TABLE IF NOT EXISTS `cloud`.`op_vm_ruleset_log` (
`id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id',
`instance_id` bigint unsigned NOT NULL COMMENT 'vm instance that needs rules to be synced.',
`created` datetime NOT NULL COMMENT 'time the entry was requested',
`logsequence` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies ruleset update',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`account_vlan_map` (
CREATE TABLE IF NOT EXISTS `cloud`.`account_vlan_map` (
`id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT,
`account_id` bigint unsigned NOT NULL COMMENT 'account id. foreign key to account table',
`vlan_db_id` bigint unsigned NOT NULL COMMENT 'database id of vlan. foreign key to vlan table',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`op_dc_link_local_ip_address_alloc` (
CREATE TABLE IF NOT EXISTS `cloud`.`op_dc_link_local_ip_address_alloc` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'primary key',
`ip_address` varchar(15) NOT NULL COMMENT 'ip address',
`data_center_id` bigint unsigned NOT NULL COMMENT 'data center it belongs to',
Expand Down Expand Up @@ -170,7 +170,7 @@ ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `guest_mac_address` varcha
ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `guest_ip_address` varchar(15) UNIQUE;
ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `guest_netmask` varchar(15);

CREATE TABLE `cloud`.`service_offering_21` (
CREATE TABLE IF NOT EXISTS `cloud`.`service_offering_21` (
`id` bigint unsigned NOT NULL,
`cpu` int(10) unsigned NOT NULL COMMENT '# of cores',
`speed` int(10) unsigned NOT NULL COMMENT 'speed per core in mhz',
Expand All @@ -182,7 +182,7 @@ CREATE TABLE `cloud`.`service_offering_21` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`disk_offering_21` (
CREATE TABLE IF NOT EXISTS `cloud`.`disk_offering_21` (
`id` bigint unsigned NOT NULL auto_increment,
`domain_id` bigint unsigned,
`name` varchar(255) NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ALTER TABLE `cloud`.`account_vlan_map` ADD COLUMN `domain_id` bigint unsigned CO
ALTER TABLE `cloud`.`account_vlan_map` ADD CONSTRAINT `fk_account_vlan_map__domain_id` FOREIGN KEY `fk_account_vlan_map__domain_id` (`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE;
ALTER TABLE `cloud`.`account_vlan_map` ADD INDEX `i_account_vlan_map__domain_id`(`domain_id`);

CREATE TABLE `cloud`.`version` (
CREATE TABLE IF NOT EXISTS `cloud`.`version` (
`id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
`version` char(40) NOT NULL UNIQUE COMMENT 'version',
`updated` datetime NOT NULL COMMENT 'Date this version table was updated',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `public_ip_address` varch
ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `device_id` bigint unsigned NOT NULL default 0;
ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `device_type` varchar(32) NOT NULL default 'DomainRouter';

CREATE TABLE `cloud_usage`.`usage_event` (
CREATE TABLE IF NOT EXISTS `cloud_usage`.`usage_event` (
`id` bigint unsigned NOT NULL auto_increment,
`type` varchar(32) NOT NULL,
`account_id` bigint unsigned NOT NULL,
Expand All @@ -55,7 +55,7 @@ CREATE TABLE `cloud_usage`.`usage_event` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud_usage`.`usage_port_forwarding` (
CREATE TABLE IF NOT EXISTS `cloud_usage`.`usage_port_forwarding` (
`id` bigint unsigned NOT NULL,
`zone_id` bigint unsigned NOT NULL,
`account_id` bigint unsigned NOT NULL,
Expand All @@ -64,7 +64,7 @@ CREATE TABLE `cloud_usage`.`usage_port_forwarding` (
`deleted` DATETIME NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud_usage`.`usage_network_offering` (
CREATE TABLE IF NOT EXISTS `cloud_usage`.`usage_network_offering` (
`zone_id` bigint unsigned NOT NULL,
`account_id` bigint unsigned NOT NULL,
`domain_id` bigint unsigned NOT NULL,
Expand Down
Loading