Skip to content

Commit a4b92e9

Browse files
author
Prachi Damle
committed
CLOUDSTACK-7590 Deletion of Account is not deleting the account from the database
Revert "CLOUDSTACK-7073: Added domainId field to the user table in order to restrict duplicated users creation on the db level" This reverts commit 5a96d8e. Conflicts: setup/db/db/schema-440to450.sql
1 parent 4e820b3 commit a4b92e9

3 files changed

Lines changed: 0 additions & 25 deletions

File tree

engine/schema/src/com/cloud/user/UserVO.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ public class UserVO implements User, Identity, InternalIdentity {
9797
@Column(name = "default")
9898
boolean isDefault;
9999

100-
@Column(name = "domain_id")
101-
private long domainId;
102-
103100
public UserVO() {
104101
this.uuid = UUID.randomUUID().toString();
105102
}
@@ -273,7 +270,4 @@ public boolean isDefault() {
273270
return isDefault;
274271
}
275272

276-
public void setDomainId(long domainId) {
277-
this.domainId = domainId;
278-
}
279273
}

engine/schema/src/com/cloud/user/dao/UserDaoImpl.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919
import java.util.List;
2020

2121
import javax.ejb.Local;
22-
import javax.inject.Inject;
2322

2423
import org.springframework.stereotype.Component;
2524

26-
import com.cloud.user.Account;
2725
import com.cloud.user.UserVO;
2826
import com.cloud.utils.db.DB;
2927
import com.cloud.utils.db.GenericDaoBase;
@@ -42,9 +40,6 @@ public class UserDaoImpl extends GenericDaoBase<UserVO, Long> implements UserDao
4240
protected SearchBuilder<UserVO> SecretKeySearch;
4341
protected SearchBuilder<UserVO> RegistrationTokenSearch;
4442

45-
@Inject
46-
AccountDao _accountDao;
47-
4843
protected UserDaoImpl() {
4944
UsernameSearch = createSearchBuilder();
5045
UsernameSearch.and("username", UsernameSearch.entity().getUsername(), SearchCriteria.Op.EQ);
@@ -133,12 +128,4 @@ public List<UserVO> findUsersByName(String username) {
133128
return listBy(sc);
134129
}
135130

136-
@Override
137-
@DB
138-
public UserVO persist(UserVO user) {
139-
Account account = _accountDao.findById(user.getAccountId());
140-
user.setDomainId(account.getDomainId());
141-
return super.persist(user);
142-
}
143-
144131
}

setup/db/db/schema-441to450.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,6 @@ CREATE TABLE `cloud`.`brocade_network_vlan_map` (
278278
/* As part of the separation of Xen and XenServer, update the column for the network labels */
279279
ALTER TABLE `cloud`.`physical_network_traffic_types` CHANGE `xen_network_label` `xenserver_network_label` varchar(255) COMMENT 'The network name label of the physical device dedicated to this traffic on a XenServer host';
280280

281-
/*Adding domainId field to the user table in order to restrict duplicated users creation on the db level*/
282-
ALTER TABLE `cloud`.`user` ADD COLUMN domain_id bigint(20) unsigned DEFAULT NULL;
283-
ALTER TABLE `cloud`.`user` ADD CONSTRAINT `fk_user__domain_id` FOREIGN KEY `fk_user__domain_id`(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE;
284-
UPDATE `cloud`.`user` SET `cloud`.`user`.domain_id=(SELECT `cloud`.`account`.domain_id FROM `cloud`.`account` WHERE `cloud`.`account`.id=`cloud`.`user`.account_id) where id > 0;
285-
ALTER TABLE `cloud`.`user` ADD UNIQUE KEY `username_domain_id` (`username`,`domain_id`);
286-
287281
ALTER TABLE `cloud`.`volumes` CHANGE COLUMN `iso_id` `iso_id` bigint(20) unsigned COMMENT 'The id of the iso from which the volume was created';
288282

289283
DROP VIEW IF EXISTS `cloud`.`storage_pool_view`;

0 commit comments

Comments
 (0)