mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Add new column last_id to the table volumes (#9759)
Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>
This commit is contained in:
parent
37eec06166
commit
a8cb7abca3
@ -48,6 +48,9 @@ public class VolumeVO implements Volume {
|
|||||||
@Column(name = "id")
|
@Column(name = "id")
|
||||||
long id;
|
long id;
|
||||||
|
|
||||||
|
@Column(name = "last_id")
|
||||||
|
private long lastId;
|
||||||
|
|
||||||
@Column(name = "name")
|
@Column(name = "name")
|
||||||
String name;
|
String name;
|
||||||
|
|
||||||
@ -677,4 +680,12 @@ public class VolumeVO implements Volume {
|
|||||||
public String getEncryptFormat() { return encryptFormat; }
|
public String getEncryptFormat() { return encryptFormat; }
|
||||||
|
|
||||||
public void setEncryptFormat(String encryptFormat) { this.encryptFormat = encryptFormat; }
|
public void setEncryptFormat(String encryptFormat) { this.encryptFormat = encryptFormat; }
|
||||||
|
|
||||||
|
public long getLastId() {
|
||||||
|
return lastId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastId(long lastId) {
|
||||||
|
this.lastId = lastId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,3 +70,6 @@ CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.user_data', 'removed', 'datetime COM
|
|||||||
UPDATE `cloud`.`configuration` SET
|
UPDATE `cloud`.`configuration` SET
|
||||||
`options` = 'FirstFitRouting,RandomAllocator,TestingAllocator,FirstFitAllocator,RecreateHostAllocator'
|
`options` = 'FirstFitRouting,RandomAllocator,TestingAllocator,FirstFitAllocator,RecreateHostAllocator'
|
||||||
WHERE `name` = 'host.allocators.order';
|
WHERE `name` = 'host.allocators.order';
|
||||||
|
|
||||||
|
-- Add last_id to the volumes table
|
||||||
|
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('volumes','last_id', 'bigint(20) unsigned DEFAULT NULL');
|
||||||
|
|||||||
@ -2292,6 +2292,8 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
|
|||||||
if (success) {
|
if (success) {
|
||||||
VolumeVO volumeVO = _volumeDao.findById(destVolumeInfo.getId());
|
VolumeVO volumeVO = _volumeDao.findById(destVolumeInfo.getId());
|
||||||
volumeVO.setFormat(ImageFormat.QCOW2);
|
volumeVO.setFormat(ImageFormat.QCOW2);
|
||||||
|
volumeVO.setLastId(srcVolumeInfo.getId());
|
||||||
|
|
||||||
_volumeDao.update(volumeVO.getId(), volumeVO);
|
_volumeDao.update(volumeVO.getId(), volumeVO);
|
||||||
|
|
||||||
_volumeService.copyPoliciesBetweenVolumesAndDestroySourceVolumeAfterMigration(Event.OperationSuccessed, null, srcVolumeInfo, destVolumeInfo, false);
|
_volumeService.copyPoliciesBetweenVolumesAndDestroySourceVolumeAfterMigration(Event.OperationSuccessed, null, srcVolumeInfo, destVolumeInfo, false);
|
||||||
|
|||||||
@ -1720,6 +1720,7 @@ public class VolumeServiceImpl implements VolumeService {
|
|||||||
newVol.setPassphraseId(volume.getPassphraseId());
|
newVol.setPassphraseId(volume.getPassphraseId());
|
||||||
newVol.setEncryptFormat(volume.getEncryptFormat());
|
newVol.setEncryptFormat(volume.getEncryptFormat());
|
||||||
}
|
}
|
||||||
|
newVol.setLastId(volume.getId());
|
||||||
return volDao.persist(newVol);
|
return volDao.persist(newVol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user