Skip to content
Snippets Groups Projects
Commit 8417f568 authored by Jared Hancock's avatar Jared Hancock
Browse files

user: Ophan users who don't know they're orphaned

This stems from a bug not clearing the org_id when removing organizations
parent 5924a67e
No related branches found
No related tags found
No related merge requests found
......@@ -61,3 +61,9 @@ WHERE `key`='transient' AND `namespace` LIKE 'sla.%';
DELETE FROM `%TABLE_PREFIX%config`
WHERE `key`='configuration' AND `namespace` LIKE 'list.%';
-- Orphan users who don't know they're orphans
UPDATE `%TABLE_PREFIX%user` A1
LEFT JOIN `%TABLE_PREFIX%organization` A2 ON (A1.`org_id` = A2.`id`)
SET A1.`org_id` = 0
WHERE A2.`id` IS NULL;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment