Skip to content

Commit 09e26c8

Browse files
db: use explicit USE statements to avoid SQL failures
create-schema-premium.sql may fail with certain MySQL/MariaDB version which require explicit database use. Signed-off-by: Rohit Yadav <[email protected]>
1 parent 245c325 commit 09e26c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

setup/db/create-schema-premium.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
-- under the License.
1717

1818
SET foreign_key_checks = 0;
19+
USE `cloud_usage`;
1920
DROP TABLE IF EXISTS `cloud_usage`.`cloud_usage`;
2021
DROP TABLE IF EXISTS `cloud_usage`.`usage_vm_instance`;
2122
DROP TABLE IF EXISTS `cloud_usage`.`usage_ip_address`;
@@ -282,6 +283,8 @@ ALTER TABLE `cloud_usage`.`usage_security_group` ADD INDEX `i_usage_security_gro
282283
ALTER TABLE `cloud_usage`.`usage_security_group` ADD INDEX `i_usage_security_group__created`(`created`);
283284
ALTER TABLE `cloud_usage`.`usage_security_group` ADD INDEX `i_usage_security_group__deleted`(`deleted`);
284285

286+
USE `cloud`;
287+
285288
CREATE TABLE `cloud`.`netapp_volume` (
286289
`id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
287290
`ip_address` varchar(255) NOT NULL COMMENT 'ip address/fqdn of the volume',

0 commit comments

Comments
 (0)