Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Paste code macro
languagesql
-- Table annotations.layers
-- Update the owner and lasteditedby values

UPDATE annotations.layers
  SET owner = split_part(owner,'@',1) || '@new_domain'
  WHERE split_part(owner,'@',2) = 'old_domain';

UPDATE annotations.layers
  SET lasteditedby = split_part(lasteditedby,'@',1) || '@new_domain'
  WHERE split_part(lasteditedby,'@',2) = 'old_domain';

-- Table annotations.layers_access
-- Update the username value

UPDATE annotations.layers_access
  SET username = split_part(username,'@',1) || '@new_domain'
  WHERE split_part(username,'@',2) = 'old_domain';


Anchor
user
user

...

Replace one User

...

with another User

If a User has left the company and you want to update all of their Annotation Layers to be owned by another User then you can use the following script. This will update all records owned by the old_user to be owned by the new_user.

...