55-- to you under the Apache License, Version 2.0 (the
66-- "License"); you may not use this file except in compliance
77-- with the License. You may obtain a copy of the License at
8- --
8+ --
99-- http://www.apache.org/licenses/LICENSE-2.0
10- --
10+ --
1111-- Unless required by applicable law or agreed to in writing,
1212-- software distributed under the License is distributed on an
1313-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -22,7 +22,7 @@ ALTER TABLE `cloud`.`cluster` ADD COLUMN `guid` varchar(255) UNIQUE DEFAULT NULL
2222ALTER TABLE ` cloud` .` cluster` ADD COLUMN ` cluster_type` varchar (64 ) DEFAULT ' CloudManaged' ;
2323ALTER TABLE ` cloud` .` vm_template` ADD COLUMN ` hypervisor_type` varchar (32 ) COMMENT ' hypervisor that the template is belonged to' ;
2424ALTER TABLE ` cloud` .` vm_template` ADD COLUMN ` extractable` int (1 ) unsigned NOT NULL default 0 COMMENT ' Is this template extractable' ;
25- ALTER TABLE ` cloud` .` template_spool_ref` ADD CONSTRAINT ` fk_template_spool_ref__template_id` FOREIGN KEY (` template_id` ) REFERENCES ` vm_template` (` id` );
25+ ALTER TABLE ` cloud` .` template_spool_ref` ADD CONSTRAINT ` fk_template_spool_ref__template_id` FOREIGN KEY (` template_id` ) REFERENCES ` vm_template` (` id` );
2626
2727ALTER TABLE ` cloud` .` guest_os` modify ` name` varchar (255 ) ;
2828
@@ -104,7 +104,7 @@ CREATE TABLE `cloud`.`networks` (
104104 ` broadcast_domain_type` varchar (32 ) NOT NULL COMMENT ' type of broadcast domain used' ,
105105 ` broadcast_uri` varchar (255 ) COMMENT ' broadcast domain specifier' ,
106106 ` gateway` varchar (15 ) COMMENT ' gateway for this network configuration' ,
107- ` cidr` varchar (18 ) COMMENT ' network cidr' ,
107+ ` cidr` varchar (18 ) COMMENT ' network cidr' ,
108108 ` mode` varchar (32 ) COMMENT ' How to retrieve ip address in this network' ,
109109 ` network_offering_id` bigint unsigned NOT NULL COMMENT ' network offering id that this configuration is created from' ,
110110 ` data_center_id` bigint unsigned NOT NULL COMMENT ' data center id that this configuration is used in' ,
@@ -167,7 +167,7 @@ CREATE TABLE `cloud`.`nics` (
167167 ` ip_type` varchar (32 ) COMMENT ' type of ip' ,
168168 ` broadcast_uri` varchar (255 ) COMMENT ' broadcast uri' ,
169169 ` network_id` bigint unsigned NOT NULL COMMENT ' network configuration id' ,
170- ` mode` varchar (32 ) COMMENT ' mode of getting ip address' ,
170+ ` mode` varchar (32 ) COMMENT ' mode of getting ip address' ,
171171 ` state` varchar (32 ) NOT NULL COMMENT ' state of the creation' ,
172172 ` strategy` varchar (32 ) NOT NULL COMMENT ' reservation strategy' ,
173173 ` reserver_name` varchar (255 ) COMMENT ' Name of the component that reserved the ip address' ,
@@ -176,7 +176,7 @@ CREATE TABLE `cloud`.`nics` (
176176 ` update_time` timestamp NOT NULL COMMENT ' time the state was changed' ,
177177 ` isolation_uri` varchar (255 ) COMMENT ' id for isolation' ,
178178 ` ip6_address` char (40 ) COMMENT ' ip6 address' ,
179- ` default_nic` tinyint NOT NULL COMMENT " None" ,
179+ ` default_nic` tinyint NOT NULL COMMENT " None" ,
180180 ` created` datetime NOT NULL COMMENT ' date created' ,
181181 ` removed` datetime COMMENT ' date removed if not null' ,
182182 PRIMARY KEY (` id` ),
@@ -253,23 +253,23 @@ CREATE TABLE `cloud`.`op_host` (
253253 ` id` bigint unsigned NOT NULL UNIQUE COMMENT ' host id' ,
254254 ` sequence` bigint unsigned DEFAULT 1 NOT NULL COMMENT ' sequence for the host communication' ,
255255 PRIMARY KEY (` id` ),
256- CONSTRAINT ` fk_op_host__id` FOREIGN KEY (` id` ) REFERENCES ` host` (` id` ) ON DELETE CASCADE
256+ CONSTRAINT ` fk_op_host__id` FOREIGN KEY (` id` ) REFERENCES ` host` (` id` ) ON DELETE CASCADE
257257) ENGINE = InnoDB DEFAULT CHARSET= utf8;
258258
259259CREATE TABLE `cloud `.` guest_os_hypervisor` (
260260 ` id` bigint unsigned NOT NULL auto_increment,
261261 ` hypervisor_type` varchar (32 ) NOT NULL ,
262262 ` guest_os_name` varchar (255 ) NOT NULL ,
263263 ` guest_os_id` bigint unsigned NOT NULL ,
264- PRIMARY KEY (` id` )
264+ PRIMARY KEY (` id` )
265265) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= utf8;
266266
267267INSERT INTO op_host(id, sequence) select id, sequence from host;
268268
269269-- Alter Tables to add Columns;
270270
271271ALTER TABLE ` cloud` .` cluster` ADD COLUMN ` hypervisor_type` varchar (32 );
272- UPDATE ` cloud` .` cluster` SET hypervisor_type= (SELECT DISTINCT host .hypervisor_type from host where host .cluster_id = cluster .id GROUP BY host .hypervisor_type );
272+ UPDATE ` cloud` .` cluster` SET hypervisor_type= (SELECT DISTINCT host .hypervisor_type from host where host .cluster_id = cluster .id GROUP BY host .hypervisor_type );
273273
274274ALTER TABLE ` cloud` .` volumes` ADD COLUMN ` attached` datetime;
275275UPDATE ` cloud` .` volumes` SET attached= now() WHERE removed IS NULL AND instance_id IS NOT NULL ;
@@ -286,7 +286,7 @@ ALTER TABLE `cloud`.`vlan` ADD COLUMN `network_id` bigint unsigned NOT NULL;
286286
287287ALTER TABLE ` cloud` .` data_center` ADD COLUMN ` domain` varchar (100 );
288288ALTER TABLE ` cloud` .` data_center` ADD COLUMN ` domain_id` bigint unsigned;
289- ALTER TABLE ` cloud` .` data_center` ADD COLUMN ` networktype` varchar (255 ) NOT NULL DEFAULT ' Basic' ;
289+ ALTER TABLE ` cloud` .` data_center` ADD COLUMN ` networktype` varchar (255 ) NOT NULL DEFAULT ' Basic' ;
290290ALTER TABLE ` cloud` .` data_center` ADD COLUMN ` dns_provider` char (64 ) DEFAULT ' VirtualRouter' ;
291291ALTER TABLE ` cloud` .` data_center` ADD COLUMN ` gateway_provider` char (64 ) DEFAULT ' VirtualRouter' ;
292292ALTER TABLE ` cloud` .` data_center` ADD COLUMN ` firewall_provider` char (64 ) DEFAULT ' VirtualRouter' ;
@@ -306,7 +306,7 @@ UPDATE `cloud`.`op_dc_link_local_ip_address_alloc` SET reservation_id=concat(cas
306306ALTER TABLE ` cloud` .` host_pod_ref` ADD COLUMN ` enabled` tinyint NOT NULL DEFAULT 1 ;
307307
308308ALTER TABLE ` cloud` .` op_dc_vnet_alloc` ADD COLUMN ` reservation_id` char (40 ) NULL ;
309- UPDATE op_dc_vnet_alloc set reservation_id= concat(cast(data_center_id as CHAR ), concat(" -" , vnet)) WHERE taken is NOT NULL ;
309+ UPDATE op_dc_vnet_alloc set reservation_id= concat(cast(data_center_id as CHAR ), concat(" -" , vnet)) WHERE taken is NOT NULL ;
310310
311311ALTER TABLE ` cloud` .` vm_instance` ADD COLUMN ` service_offering_id` bigint unsigned NOT NULL ;
312312ALTER TABLE ` cloud` .` vm_instance` ADD COLUMN ` reservation_id` char (40 );
@@ -326,7 +326,7 @@ ALTER TABLE `cloud`.`user_vm` ADD COLUMN `display_name` varchar(255);
326326UPDATE user_vm inner join vm_instance on user_vm .id = vm_instance .id set user_vm .iso_id = vm_instance .iso_id , user_vm .display_name = vm_instance .display_name where vm_instance .type = ' User' ;
327327
328328ALTER TABLE ` cloud` .` template_host_ref` ADD COLUMN ` physical_size` bigint unsigned DEFAULT 0 ;
329- UPDATE template_host_ref INNER JOIN template_spool_ref ON template_host_ref .template_id = template_spool_ref .template_id SET template_host_ref .physical_size = template_spool_ref .template_size ;
329+ UPDATE template_host_ref INNER JOIN template_spool_ref ON template_host_ref .template_id = template_spool_ref .template_id SET template_host_ref .physical_size = template_spool_ref .template_size ;
330330
331331
332332CREATE TABLE `cloud `.` user_vm_details` (
@@ -412,7 +412,7 @@ CREATE TABLE `cloud`.`vpn_users` (
412412 CONSTRAINT ` fk_vpn_users__owner_id` FOREIGN KEY (` owner_id` ) REFERENCES ` account` (` id` ) ON DELETE CASCADE ,
413413 CONSTRAINT ` fk_vpn_users__domain_id` FOREIGN KEY (` domain_id` ) REFERENCES ` domain` (` id` ) ON DELETE CASCADE ,
414414 INDEX ` i_vpn_users_username` (` username` ),
415- UNIQUE ` i_vpn_users__account_id__username` (` owner_id` , ` username` )
415+ UNIQUE ` i_vpn_users__account_id__username` (` owner_id` , ` username` )
416416) ENGINE= InnoDB DEFAULT CHARSET= utf8;
417417
418418ALTER TABLE ` cloud` .` storage_pool` ADD COLUMN ` status` varchar (32 );
@@ -490,7 +490,7 @@ CREATE TABLE `cloud`.`usage_event` (
490490 ` resource_name` varchar (255 ),
491491 ` offering_id` bigint unsigned,
492492 ` template_id` bigint unsigned,
493- ` size` bigint unsigned,
493+ ` size` bigint unsigned,
494494 ` processed` tinyint NOT NULL default ' 0' ,
495495 PRIMARY KEY (` id` )
496496) ENGINE= InnoDB DEFAULT CHARSET= utf8;
0 commit comments