mirror of
https://git.cloudron.io/cloudron/mastodon-app.git
synced 2024-11-25 09:11:00 +00:00
migrateUsers.js: logic updated to resume if failed
This commit is contained in:
parent
a08af787d7
commit
f8c84b6ef5
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ for (let line of ldapSearchOutput.split('\n')) {
|
|||
console.log('Found usermapping:', users);
|
||||
|
||||
for (let id in users) {
|
||||
let uid = execSync(`${postgresCmd} -AXqtc "SELECT u.id FROM users u JOIN accounts a ON a.id=u.account_id WHERE a.username='${users[id]}'"`).toString().trim();
|
||||
let uid = execSync(`${postgresCmd} -AXqtc "SELECT u.id FROM users u JOIN accounts a ON a.id=u.account_id WHERE NOT EXISTS (SELECT 1 FROM identities WHERE provider='openid_connect' AND uid='${users[id]}') AND a.username='${users[id]}'"`).toString().trim();
|
||||
if (!uid)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in a new issue