Question

Modification propriétaire d'une vue

  • 14 June 2022
  • 1 reply
  • 42 views

Badge +8

Hi,

 

I need to update the view owner in Centreon.

 

This is my command: 

UPDATE custom_view_user_relation SET user_id='505' WHERE custom_view_user_relation.custom_view_id='505';

ERROR 1062 (23000): Duplicate entry '505-505' for key 'view_user_unique_index'

 

I hava an error mysql. How can I make to update the view owner?

 

Cordialy,

Francis


1 reply

Userlevel 6
Badge +17

Hello, 

 

This is the correct query to change the owner: 

 

 update custom_view_user_relation set is_owner='1' where user_id='<wanted_owner_id>' and custom_view_id='<custom_view_id>';

 

You may want to double check id before running the query, in your example both contact and view share the same id, it’s strange.

 

Kind regards

Reply