Skip to content

Commit e909c18

Browse files
committed
Fix syntax errors in schema-42010to42100.sql
1 parent 47b6cd1 commit e909c18

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,8 @@ ALTER TABLE `cloud`.`backups` ADD COLUMN `vm_name` varchar(255) COMMENT 'name of
4444
ALTER TABLE `cloud`.`backups` ADD COLUMN `description` varchar(1024) COMMENT 'description for the backup';
4545
UPDATE `cloud`.`backups` JOIN `cloud`.`vm_instance` ON `backups`.`vm_id` = `vm_instance`.`id` SET `backups`.`name` = `vm_instance`.`name`;
4646

47-
-- Make the column vm_id in backups table nullable and set it to null if foreign key is deleted
48-
ALTER TABLE `cloud`.`backups` DROP FOREIGN KEY `fk_backup__vm_id``;
47+
-- Make the column vm_id in backups table nullable to handle orphan backups
4948
ALTER TABLE `cloud`.`backups` MODIFY COLUMN `vm_id` BIGINT UNSIGNED NULL;
50-
ALTER TABLE `cloud`.`backups` ADD CONSTRAINT `fk_backup__vm_id`` FOREIGN KEY (`vm_id``) REFERENCES `cloud`.`vm_instance`(`id`) ON DELETE SET NULL;
51-
ALTER TABLE `cloud`.`backups` varchar(255) NOT NULL COMMENT 'name of the backup'
5249

5350
-- Create backup details table
5451
CREATE TABLE `cloud`.`backup_details` (

0 commit comments

Comments
 (0)