This commit is contained in:
2026-08-17 00:40:46 +02:00
parent 93dc70123c
commit 179a47494f
2 changed files with 7 additions and 5 deletions
+4 -3
View File
@@ -26,10 +26,11 @@ WHERE c.id = sub.company_id
UPDATE companies c
SET owner_user_id = u.id
FROM users u
JOIN memberships m ON m.user_id = u.id AND m.company_id = c.id AND m.status = 'active'
WHERE c.legacy_company_id = '97e1a309-3d23-4aa2-b518-8e8d7afdfec7'
INNER JOIN memberships m ON m.user_id = u.id AND m.status = 'active'
WHERE c.id = m.company_id
AND c.legacy_company_id = '97e1a309-3d23-4aa2-b518-8e8d7afdfec7'
AND lower(u.email) = 'a1-primary@descrybe.local';
-- +goose Down
DROP INDEX IF EXISTS companies_owner_user_id_idx;
ALTER TABLE companies DROP COLUMN IF EXISTS owner_user_id;
ALTER TABLE companies DROP COLUMN IF EXISTS owner_user_id;