aboutsummaryrefslogtreecommitdiff
path: root/scripts/hedgedoc-ldap_to_oauth2/replacements.txt
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/hedgedoc-ldap_to_oauth2/replacements.txt')
-rw-r--r--scripts/hedgedoc-ldap_to_oauth2/replacements.txt4
1 files changed, 4 insertions, 0 deletions
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';