From e23a1db405b5181f66d2fad6636f89ec2c30948f Mon Sep 17 00:00:00 2001 From: Lukas Oertel Date: Sun, 22 Jan 2023 18:12:17 +0100 Subject: scripts/hedgedoc-ldap_to_oauth2: Init --- scripts/hedgedoc-ldap_to_oauth2/replacements.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 scripts/hedgedoc-ldap_to_oauth2/replacements.txt (limited to 'scripts/hedgedoc-ldap_to_oauth2/replacements.txt') diff --git a/scripts/hedgedoc-ldap_to_oauth2/replacements.txt b/scripts/hedgedoc-ldap_to_oauth2/replacements.txt new file mode 100644 index 0000000..b093101 --- /dev/null +++ b/scripts/hedgedoc-ldap_to_oauth2/replacements.txt @@ -0,0 +1,4 @@ +UPDATE "Users" SET profileid = '$UID', profile = jsonb_set(profile::jsonb, '{id}', '"$UID"') where profileid = '$LDAPID'; +UPDATE "Users" SET profile = profile::jsonb || jsonb_build_object('displayName', profile::json->'username') where profileid = '$UID'; +UPDATE "Users" SET profile = jsonb_set(profile::jsonb, '{username}', '"$UID"') where profileid = '$UID'; +UPDATE "Users" SET profile = jsonb_set(profile::jsonb, '{provider}', '"oauth2"') where profileid = '$UID'; -- cgit v1.2.3