fix
This commit is contained in:
@@ -100,8 +100,9 @@ func main() {
|
|||||||
UPDATE companies c
|
UPDATE companies c
|
||||||
SET owner_user_id = u.id, updated_at = now()
|
SET owner_user_id = u.id, updated_at = now()
|
||||||
FROM users u
|
FROM users u
|
||||||
JOIN memberships m ON m.user_id = u.id AND m.company_id = c.id AND m.status = 'active'
|
INNER JOIN memberships m ON m.user_id = u.id AND m.status = 'active'
|
||||||
WHERE c.id = $1
|
WHERE c.id = m.company_id
|
||||||
|
AND c.id = $1
|
||||||
AND lower(u.email) = 'a1-primary@descrybe.local'`, companyID)
|
AND lower(u.email) = 'a1-primary@descrybe.local'`, companyID)
|
||||||
|
|
||||||
if err := tx.Commit(ctx); err != nil {
|
if err := tx.Commit(ctx); err != nil {
|
||||||
|
|||||||
@@ -26,8 +26,9 @@ WHERE c.id = sub.company_id
|
|||||||
UPDATE companies c
|
UPDATE companies c
|
||||||
SET owner_user_id = u.id
|
SET owner_user_id = u.id
|
||||||
FROM users u
|
FROM users u
|
||||||
JOIN memberships m ON m.user_id = u.id AND m.company_id = c.id AND m.status = 'active'
|
INNER JOIN memberships m ON m.user_id = u.id AND m.status = 'active'
|
||||||
WHERE c.legacy_company_id = '97e1a309-3d23-4aa2-b518-8e8d7afdfec7'
|
WHERE c.id = m.company_id
|
||||||
|
AND c.legacy_company_id = '97e1a309-3d23-4aa2-b518-8e8d7afdfec7'
|
||||||
AND lower(u.email) = 'a1-primary@descrybe.local';
|
AND lower(u.email) = 'a1-primary@descrybe.local';
|
||||||
|
|
||||||
-- +goose Down
|
-- +goose Down
|
||||||
|
|||||||
Reference in New Issue
Block a user