Project

General

Profile

Actions

Task #2084

closed

SQL query for moving EAV definitions form one form definition to another

Added by Vladimír Kotýnek almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Peter Štrunc
Category:
Database
Target version:
Start date:
02/25/2020
Due date:
% Done:

100%

Estimated time:
Owner:

Description

On a project with CzechIdM 10 I have a following situation:
  • Identity Contracts has 2 form definitions: "hr_attributes" (main) and "ldap_attributes".
  • There are no duplicates across attribute codes in the definitions.
  • The attributes are already filled with values and used e.g. in mappings.

The task is to move attributes from "ldap_attributes" to the "hr_attributes" definition so we can use them in automatic roles evaluation rules. This should be done via SQL query or SQL script.

Please provide me this SQL query/script.

Actions #1

Updated by Peter Štrunc almost 5 years ago

  • Status changed from New to In Progress
Actions #2

Updated by Peter Štrunc almost 5 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Peter Štrunc to Vladimír Kotýnek
  • % Done changed from 0 to 80

Hi, here is the query that worked for me. Would you pleas review this ticket?

UPDATE idm_form_attribute
SET definition_id = idm_form_definition.id
FROM idm_form_definition
WHERE idm_form_definition.code = 'hr_attributes'
AND idm_form_attribute.id in (select ifa.id from idm_form_attribute ifa join idm_form_definition ifd on ifa.definition_id = ifd.id where ifd.code = 'ldap_attributes');

Note that if you run this query, there will be no info about this action in audit or anywhere else.

Actions #3

Updated by Vladimír Kotýnek almost 5 years ago

  • Status changed from Needs feedback to Resolved
  • % Done changed from 80 to 100

Thank you very much! I did the review and tested the query on a copy of a real test database. It worked as expected.

Actions #4

Updated by Radek Tomiška almost 5 years ago

  • Category set to Database
  • Assignee changed from Vladimír Kotýnek to Peter Štrunc
  • Target version set to 10.2.0
Actions #5

Updated by Radek Tomiška over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF