bug 9473: mark all volumes with Destroyed>=1 with state=Destroy

status 9473: resolved fixed
This commit is contained in:
alena 2011-04-15 14:02:38 -07:00
parent a2dc7ec59e
commit abe460c276
1 changed files with 1 additions and 1 deletions

View File

@ -270,7 +270,7 @@ ALTER TABLE `cloud`.`volumes` ADD COLUMN `chain_info` text;
ALTER TABLE `cloud`.`volumes` MODIFY COLUMN `volume_type` VARCHAR(64) NOT NULL;
ALTER TABLE `cloud`.`volumes` ADD COLUMN `state` VARCHAR(32);
UPDATE `cloud`.`volumes` SET state='Destroy' WHERE removed IS NOT NULL OR destroyed=1 OR status='Creating' OR status='Corrupted' OR status='Failed';
UPDATE `cloud`.`volumes` SET state='Destroy' WHERE removed IS NOT NULL OR destroyed>=1 OR status='Creating' OR status='Corrupted' OR status='Failed';
UPDATE `cloud`.`volumes` SET state='Ready' WHERE removed IS NULL AND (destroyed=0 OR destroyed is NULL) AND status='Created';
ALTER TABLE `cloud`.`volumes` MODIFY COLUMN `state` VARCHAR(32) NOT NULL;