You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT data->>'userId' as "userId", MAX("eventStartedAt") as "lastActiveAt"
172
-
FROM "Event"
173
+
FROM ${sqlQuoteIdent(schema)}."Event"
173
174
WHERE data->>'userId' = ANY(${Prisma.sql`ARRAY[${Prisma.join(userIds)}]`}) AND data->>'projectId' = ${projectId} AND COALESCE("data"->>'branchId', 'main') = ${branchId} AND "systemEventTypeIds" @> '{"$user-activity"}'
WHERE data->>'projectId' = ("ProjectUser"."mirroredProjectId") AND COALESCE("data"->>'branchId', 'main') = ("ProjectUser"."mirroredBranchId") AND "data"->>'userId' = ("ProjectUser"."projectUserId")::text AND "systemEventTypeIds" @> '{"$user-activity"}'
198
199
),
199
200
'ContactChannels', (
200
201
SELECT COALESCE(ARRAY_AGG(
201
202
to_jsonb("ContactChannel") ||
202
203
jsonb_build_object()
203
204
), '{}')
204
-
FROM "ContactChannel"
205
+
FROM ${sqlQuoteIdent(schema)}."ContactChannel"
205
206
WHERE "ContactChannel"."tenancyId" = "ProjectUser"."tenancyId" AND "ContactChannel"."projectUserId" = "ProjectUser"."projectUserId" AND "ContactChannel"."isPrimary" = 'TRUE'
206
207
),
207
208
'ProjectUserOAuthAccounts', (
208
209
SELECT COALESCE(ARRAY_AGG(
209
210
to_jsonb("ProjectUserOAuthAccount")
210
211
), '{}')
211
-
FROM "ProjectUserOAuthAccount"
212
+
FROM ${sqlQuoteIdent(schema)}."ProjectUserOAuthAccount"
212
213
WHERE "ProjectUserOAuthAccount"."tenancyId" = "ProjectUser"."tenancyId" AND "ProjectUserOAuthAccount"."projectUserId" = "ProjectUser"."projectUserId"
FROM ${sqlQuoteIdent(schema)}."PasswordAuthMethod"
224
225
WHERE "PasswordAuthMethod"."tenancyId" = "ProjectUser"."tenancyId" AND "PasswordAuthMethod"."projectUserId" = "ProjectUser"."projectUserId" AND "PasswordAuthMethod"."authMethodId" = "AuthMethod"."id"
225
226
),
226
227
'OtpAuthMethod', (
227
228
SELECT (
228
229
to_jsonb("OtpAuthMethod") ||
229
230
jsonb_build_object()
230
231
)
231
-
FROM "OtpAuthMethod"
232
+
FROM ${sqlQuoteIdent(schema)}."OtpAuthMethod"
232
233
WHERE "OtpAuthMethod"."tenancyId" = "ProjectUser"."tenancyId" AND "OtpAuthMethod"."projectUserId" = "ProjectUser"."projectUserId" AND "OtpAuthMethod"."authMethodId" = "AuthMethod"."id"
233
234
),
234
235
'PasskeyAuthMethod', (
235
236
SELECT (
236
237
to_jsonb("PasskeyAuthMethod") ||
237
238
jsonb_build_object()
238
239
)
239
-
FROM "PasskeyAuthMethod"
240
+
FROM ${sqlQuoteIdent(schema)}."PasskeyAuthMethod"
240
241
WHERE "PasskeyAuthMethod"."tenancyId" = "ProjectUser"."tenancyId" AND "PasskeyAuthMethod"."projectUserId" = "ProjectUser"."projectUserId" AND "PasskeyAuthMethod"."authMethodId" = "AuthMethod"."id"
241
242
),
242
243
'OAuthAuthMethod', (
243
244
SELECT (
244
245
to_jsonb("OAuthAuthMethod") ||
245
246
jsonb_build_object()
246
247
)
247
-
FROM "OAuthAuthMethod"
248
+
FROM ${sqlQuoteIdent(schema)}."OAuthAuthMethod"
248
249
WHERE "OAuthAuthMethod"."tenancyId" = "ProjectUser"."tenancyId" AND "OAuthAuthMethod"."projectUserId" = "ProjectUser"."projectUserId" AND "OAuthAuthMethod"."authMethodId" = "AuthMethod"."id"
249
250
)
250
251
)
251
252
), '{}')
252
-
FROM "AuthMethod"
253
+
FROM ${sqlQuoteIdent(schema)}."AuthMethod"
253
254
WHERE "AuthMethod"."tenancyId" = "ProjectUser"."tenancyId" AND "AuthMethod"."projectUserId" = "ProjectUser"."projectUserId"
WHERE "Team"."tenancyId" = "ProjectUser"."tenancyId" AND "Team"."teamId" = "TeamMember"."teamId"
266
267
)
267
268
)
268
269
)
269
-
FROM "TeamMember"
270
+
FROM ${sqlQuoteIdent(schema)}."TeamMember"
270
271
WHERE "TeamMember"."tenancyId" = "ProjectUser"."tenancyId" AND "TeamMember"."projectUserId" = "ProjectUser"."projectUserId" AND "TeamMember"."isSelected" = 'TRUE'
271
272
)
272
273
)
273
274
)
274
-
FROM "ProjectUser"
275
+
FROM ${sqlQuoteIdent(schema)}."ProjectUser"
275
276
WHERE "ProjectUser"."mirroredProjectId" = ${projectId} AND "ProjectUser"."mirroredBranchId" = ${branchId} AND "ProjectUser"."projectUserId" = ${userId}::UUID
0 commit comments