mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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 5a96d8ef5cbc88df366016ae9dd7ee46e4ca417a. Conflicts: setup/db/db/schema-440to450.sql
This commit is contained in:
parent
4e820b37b0
commit
a4b92e908a
@ -97,9 +97,6 @@ public class UserVO implements User, Identity, InternalIdentity {
|
||||
@Column(name = "default")
|
||||
boolean isDefault;
|
||||
|
||||
@Column(name = "domain_id")
|
||||
private long domainId;
|
||||
|
||||
public UserVO() {
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
}
|
||||
@ -273,7 +270,4 @@ public class UserVO implements User, Identity, InternalIdentity {
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public void setDomainId(long domainId) {
|
||||
this.domainId = domainId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,11 +19,9 @@ package com.cloud.user.dao;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserVO;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
@ -42,9 +40,6 @@ public class UserDaoImpl extends GenericDaoBase<UserVO, Long> implements UserDao
|
||||
protected SearchBuilder<UserVO> SecretKeySearch;
|
||||
protected SearchBuilder<UserVO> RegistrationTokenSearch;
|
||||
|
||||
@Inject
|
||||
AccountDao _accountDao;
|
||||
|
||||
protected UserDaoImpl() {
|
||||
UsernameSearch = createSearchBuilder();
|
||||
UsernameSearch.and("username", UsernameSearch.entity().getUsername(), SearchCriteria.Op.EQ);
|
||||
@ -133,12 +128,4 @@ public class UserDaoImpl extends GenericDaoBase<UserVO, Long> implements UserDao
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DB
|
||||
public UserVO persist(UserVO user) {
|
||||
Account account = _accountDao.findById(user.getAccountId());
|
||||
user.setDomainId(account.getDomainId());
|
||||
return super.persist(user);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -278,12 +278,6 @@ CREATE TABLE `cloud`.`brocade_network_vlan_map` (
|
||||
/* As part of the separation of Xen and XenServer, update the column for the network labels */
|
||||
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';
|
||||
|
||||
/*Adding domainId field to the user table in order to restrict duplicated users creation on the db level*/
|
||||
ALTER TABLE `cloud`.`user` ADD COLUMN domain_id bigint(20) unsigned DEFAULT NULL;
|
||||
ALTER TABLE `cloud`.`user` ADD CONSTRAINT `fk_user__domain_id` FOREIGN KEY `fk_user__domain_id`(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE;
|
||||
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;
|
||||
ALTER TABLE `cloud`.`user` ADD UNIQUE KEY `username_domain_id` (`username`,`domain_id`);
|
||||
|
||||
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';
|
||||
|
||||
DROP VIEW IF EXISTS `cloud`.`storage_pool_view`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user