engine-schema: add removed columne for cloud.user_data, fix delete op (#9120)

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2024-05-28 13:13:14 +05:30 committed by GitHub
parent c36a3b8cc3
commit c970141e25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -24,8 +24,12 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
import java.util.UUID;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name = "user_data")
public class UserDataVO implements UserData {
@ -58,6 +62,9 @@ public class UserDataVO implements UserData {
@Column(name = "params", length = 4096)
private String params;
@Column(name = GenericDao.REMOVED_COLUMN)
private Date removed;
@Override
public long getDomainId() {
return domainId;
@ -117,4 +124,12 @@ public class UserDataVO implements UserData {
public void setParams(String params) {
this.params = params;
}
public void setRemoved(Date removed) {
this.removed = removed;
}
public Date getRemoved() {
return removed;
}
}

View File

@ -63,3 +63,5 @@ CREATE TABLE IF NOT EXISTS `cloud_usage`.`usage_vpc` (
) ENGINE=InnoDB CHARSET=utf8;
CALL `cloud_usage`.`IDEMPOTENT_ADD_COLUMN`('cloud_usage.cloud_usage', 'state', 'VARCHAR(100) DEFAULT NULL');
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.user_data', 'removed', 'datetime COMMENT "date removed or null, if still present"');