File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
engine/schema/src/main/resources/META-INF/db Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,8 @@ ALTER TABLE `cloud`.`backups` ADD COLUMN `vm_name` varchar(255) COMMENT 'name of
4444ALTER TABLE ` cloud` .` backups` ADD COLUMN ` description` varchar (1024 ) COMMENT ' description for the backup' ;
4545UPDATE ` 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
4948ALTER 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
5451CREATE TABLE `cloud `.` backup_details` (
You can’t perform that action at this time.
0 commit comments