mirror of
https://git.cloudron.io/cloudron/mastodon-app.git
synced 2024-11-22 15:51: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);
|
console.log('Found usermapping:', users);
|
||||||
|
|
||||||
for (let id in 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)
|
if (!uid)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue