diff --git a/authority-portal-backend/authority-portal-db/src/main/resources/db/migration/V12__Fix_Service_Provider_User_Deletion.sql b/authority-portal-backend/authority-portal-db/src/main/resources/db/migration/V12__Fix_Service_Provider_User_Deletion.sql new file mode 100644 index 000000000..6d690a123 --- /dev/null +++ b/authority-portal-backend/authority-portal-db/src/main/resources/db/migration/V12__Fix_Service_Provider_User_Deletion.sql @@ -0,0 +1 @@ +alter table connector alter column created_by drop not null; diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/usermanagement/UserDeletionApiService.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/usermanagement/UserDeletionApiService.kt index 016e36f21..31f60feef 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/usermanagement/UserDeletionApiService.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/usermanagement/UserDeletionApiService.kt @@ -102,11 +102,12 @@ class UserDeletionApiService( userService.deleteInvitationReferencesToOrgMembers(orgMemberIds) userService.deleteOrganizationIds(orgMemberIds) - keycloakService.deleteOrganization(organizationId) organizationService.deleteOrganization(organizationId) - keycloakService.deleteUsers(orgMemberIds) userService.deleteUsers(orgMemberIds) + keycloakService.deleteUsers(orgMemberIds) + keycloakService.deleteOrganization(organizationId) + Log.info( "Organization and related users, connectors and central components deleted. " + "organization=${organizationId}, adminUserId=$adminUserId." diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/services/ConnectorService.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/services/ConnectorService.kt index 81379d607..5cf9e7653 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/services/ConnectorService.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/services/ConnectorService.kt @@ -106,6 +106,7 @@ class ConnectorService( val c = Tables.CONNECTOR dsl.update(c) .setNull(c.PROVIDER_ORGANIZATION_ID) + .setNull(c.CREATED_BY) .where(c.PROVIDER_ORGANIZATION_ID.eq(organizationId)) .execute() }