fix: pq: update or delete on table account violates foreign key constraint privileges_account_id_fkey on table privileges

This commit is contained in:
pasha1coil 2025-07-28 11:21:38 +03:00
parent 1383dbaa3a
commit 66af1731d3

@ -137,13 +137,13 @@ func (r *AccountRepository) DeleteAccount(ctx context.Context, accountID string)
return err
}
err = r.queries.DeleteAccountById(ctx, uuidAccount)
err = r.queries.DeletePrivilegeByAccID(ctx, uuidAccount)
if err != nil {
tx.Rollback()
return err
}
err = r.queries.DeletePrivilegeByAccID(ctx, uuidAccount)
err = r.queries.DeleteAccountById(ctx, uuidAccount)
if err != nil {
tx.Rollback()
return err