Skip to content

Commit 85f86be

Browse files
committed
revert change to make vm_id nullable in backup table
1 parent 2018822 commit 85f86be

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

engine/schema/src/main/java/org/apache/cloudstack/backup/BackupVO.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,6 @@ public Map<String, String> getDetails() {
273273
return details;
274274
}
275275

276-
public void setDetail(String name, String value) {
277-
assert (details != null) : "Did you forget to load the details?";
278-
this.details.put(name, value);
279-
}
280-
281276
@Override
282277
public String getDetail(String name) {
283278
return this.details.get(name);

engine/schema/src/main/java/org/apache/cloudstack/backup/dao/BackupDaoImpl.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
import com.cloud.utils.db.Transaction;
5555
import com.cloud.utils.db.TransactionCallback;
5656
import com.cloud.vm.VMInstanceVO;
57-
import com.cloud.vm.VirtualMachine;
5857
import com.cloud.vm.dao.VMInstanceDao;
5958
import com.cloud.network.Network;
6059
import com.cloud.network.dao.NetworkDao;
@@ -351,9 +350,7 @@ public BackupResponse newBackupResponse(Backup backup, Boolean listVmDetails) {
351350
response.setName(backup.getName());
352351
response.setDescription(backup.getDescription());
353352
response.setVmName(vm.getHostName());
354-
if (vm.getState() != VirtualMachine.State.Expunging) {
355-
response.setVmId(vm.getUuid());
356-
}
353+
response.setVmId(vm.getUuid());
357354
if (vm.getBackupOfferingId() == null || vm.getBackupOfferingId() != backup.getBackupOfferingId()) {
358355
response.setVmOfferingRemoved(true);
359356
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ ALTER TABLE `cloud`.`backups` MODIFY COLUMN `name` VARCHAR(255) NOT NULL;
244244
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.backups', 'description', 'VARCHAR(1024) COMMENT "description for the backup"');
245245
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.backups', 'backup_interval_type', 'int(5) COMMENT "type of backup, e.g. manual, recurring - hourly, daily, weekly or monthly"');
246246

247-
-- Make the column vm_id in backups table nullable to handle orphan backups
248-
ALTER TABLE `cloud`.`backups` MODIFY COLUMN `vm_id` BIGINT UNSIGNED NULL;
249-
250247
-- Create backup details table
251248
CREATE TABLE IF NOT EXISTS `cloud`.`backup_details` (
252249
`id` bigint unsigned NOT NULL auto_increment,

0 commit comments

Comments
 (0)