@app-vitals/agent-admin 1.126.0 → 1.127.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/prisma/client/internal/class.ts +4 -4
- package/prisma/client/internal/prismaNamespace.ts +2 -0
- package/prisma/client/internal/prismaNamespaceBrowser.ts +2 -0
- package/prisma/client/models/SessionAlertState.ts +37 -2
- package/prisma/client/models/SessionFollow.ts +37 -2
- package/prisma/migrations/20261203000000_add_account_id_to_session_follow_and_alert_state/migration.sql +34 -0
- package/prisma/schema/coding.prisma +6 -0
- package/src/session-follow-account-id-migration.integration.test.ts +126 -0
- package/src/session-follow-account-id-migration.unit.test.ts +49 -0
|
@@ -3030,6 +3030,7 @@ export type AgentPhaseMethodologyScalarFieldEnum = (typeof AgentPhaseMethodology
|
|
|
3030
3030
|
export const SessionFollowScalarFieldEnum = {
|
|
3031
3031
|
id: 'id',
|
|
3032
3032
|
userEmail: 'userEmail',
|
|
3033
|
+
accountId: 'accountId',
|
|
3033
3034
|
sessionSlug: 'sessionSlug',
|
|
3034
3035
|
muted: 'muted',
|
|
3035
3036
|
createdAt: 'createdAt',
|
|
@@ -3042,6 +3043,7 @@ export type SessionFollowScalarFieldEnum = (typeof SessionFollowScalarFieldEnum)
|
|
|
3042
3043
|
export const SessionAlertStateScalarFieldEnum = {
|
|
3043
3044
|
id: 'id',
|
|
3044
3045
|
userEmail: 'userEmail',
|
|
3046
|
+
accountId: 'accountId',
|
|
3045
3047
|
sessionSlug: 'sessionSlug',
|
|
3046
3048
|
lastAlertedAt: 'lastAlertedAt',
|
|
3047
3049
|
createdAt: 'createdAt',
|
|
@@ -128,6 +128,7 @@ export type AgentPhaseMethodologyScalarFieldEnum = (typeof AgentPhaseMethodology
|
|
|
128
128
|
export const SessionFollowScalarFieldEnum = {
|
|
129
129
|
id: 'id',
|
|
130
130
|
userEmail: 'userEmail',
|
|
131
|
+
accountId: 'accountId',
|
|
131
132
|
sessionSlug: 'sessionSlug',
|
|
132
133
|
muted: 'muted',
|
|
133
134
|
createdAt: 'createdAt',
|
|
@@ -140,6 +141,7 @@ export type SessionFollowScalarFieldEnum = (typeof SessionFollowScalarFieldEnum)
|
|
|
140
141
|
export const SessionAlertStateScalarFieldEnum = {
|
|
141
142
|
id: 'id',
|
|
142
143
|
userEmail: 'userEmail',
|
|
144
|
+
accountId: 'accountId',
|
|
143
145
|
sessionSlug: 'sessionSlug',
|
|
144
146
|
lastAlertedAt: 'lastAlertedAt',
|
|
145
147
|
createdAt: 'createdAt',
|
|
@@ -27,6 +27,7 @@ export type AggregateSessionAlertState = {
|
|
|
27
27
|
export type SessionAlertStateMinAggregateOutputType = {
|
|
28
28
|
id: string | null
|
|
29
29
|
userEmail: string | null
|
|
30
|
+
accountId: string | null
|
|
30
31
|
sessionSlug: string | null
|
|
31
32
|
lastAlertedAt: Date | null
|
|
32
33
|
createdAt: Date | null
|
|
@@ -36,6 +37,7 @@ export type SessionAlertStateMinAggregateOutputType = {
|
|
|
36
37
|
export type SessionAlertStateMaxAggregateOutputType = {
|
|
37
38
|
id: string | null
|
|
38
39
|
userEmail: string | null
|
|
40
|
+
accountId: string | null
|
|
39
41
|
sessionSlug: string | null
|
|
40
42
|
lastAlertedAt: Date | null
|
|
41
43
|
createdAt: Date | null
|
|
@@ -45,6 +47,7 @@ export type SessionAlertStateMaxAggregateOutputType = {
|
|
|
45
47
|
export type SessionAlertStateCountAggregateOutputType = {
|
|
46
48
|
id: number
|
|
47
49
|
userEmail: number
|
|
50
|
+
accountId: number
|
|
48
51
|
sessionSlug: number
|
|
49
52
|
lastAlertedAt: number
|
|
50
53
|
createdAt: number
|
|
@@ -56,6 +59,7 @@ export type SessionAlertStateCountAggregateOutputType = {
|
|
|
56
59
|
export type SessionAlertStateMinAggregateInputType = {
|
|
57
60
|
id?: true
|
|
58
61
|
userEmail?: true
|
|
62
|
+
accountId?: true
|
|
59
63
|
sessionSlug?: true
|
|
60
64
|
lastAlertedAt?: true
|
|
61
65
|
createdAt?: true
|
|
@@ -65,6 +69,7 @@ export type SessionAlertStateMinAggregateInputType = {
|
|
|
65
69
|
export type SessionAlertStateMaxAggregateInputType = {
|
|
66
70
|
id?: true
|
|
67
71
|
userEmail?: true
|
|
72
|
+
accountId?: true
|
|
68
73
|
sessionSlug?: true
|
|
69
74
|
lastAlertedAt?: true
|
|
70
75
|
createdAt?: true
|
|
@@ -74,6 +79,7 @@ export type SessionAlertStateMaxAggregateInputType = {
|
|
|
74
79
|
export type SessionAlertStateCountAggregateInputType = {
|
|
75
80
|
id?: true
|
|
76
81
|
userEmail?: true
|
|
82
|
+
accountId?: true
|
|
77
83
|
sessionSlug?: true
|
|
78
84
|
lastAlertedAt?: true
|
|
79
85
|
createdAt?: true
|
|
@@ -156,6 +162,7 @@ export type SessionAlertStateGroupByArgs<ExtArgs extends runtime.Types.Extension
|
|
|
156
162
|
export type SessionAlertStateGroupByOutputType = {
|
|
157
163
|
id: string
|
|
158
164
|
userEmail: string
|
|
165
|
+
accountId: string | null
|
|
159
166
|
sessionSlug: string
|
|
160
167
|
lastAlertedAt: Date | null
|
|
161
168
|
createdAt: Date
|
|
@@ -186,6 +193,7 @@ export type SessionAlertStateWhereInput = {
|
|
|
186
193
|
NOT?: Prisma.SessionAlertStateWhereInput | Prisma.SessionAlertStateWhereInput[]
|
|
187
194
|
id?: Prisma.StringFilter<"SessionAlertState"> | string
|
|
188
195
|
userEmail?: Prisma.StringFilter<"SessionAlertState"> | string
|
|
196
|
+
accountId?: Prisma.StringNullableFilter<"SessionAlertState"> | string | null
|
|
189
197
|
sessionSlug?: Prisma.StringFilter<"SessionAlertState"> | string
|
|
190
198
|
lastAlertedAt?: Prisma.DateTimeNullableFilter<"SessionAlertState"> | Date | string | null
|
|
191
199
|
createdAt?: Prisma.DateTimeFilter<"SessionAlertState"> | Date | string
|
|
@@ -195,6 +203,7 @@ export type SessionAlertStateWhereInput = {
|
|
|
195
203
|
export type SessionAlertStateOrderByWithRelationInput = {
|
|
196
204
|
id?: Prisma.SortOrder
|
|
197
205
|
userEmail?: Prisma.SortOrder
|
|
206
|
+
accountId?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
198
207
|
sessionSlug?: Prisma.SortOrder
|
|
199
208
|
lastAlertedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
200
209
|
createdAt?: Prisma.SortOrder
|
|
@@ -204,19 +213,22 @@ export type SessionAlertStateOrderByWithRelationInput = {
|
|
|
204
213
|
export type SessionAlertStateWhereUniqueInput = Prisma.AtLeast<{
|
|
205
214
|
id?: string
|
|
206
215
|
userEmail_sessionSlug?: Prisma.SessionAlertStateUserEmailSessionSlugCompoundUniqueInput
|
|
216
|
+
userEmail_accountId_sessionSlug?: Prisma.SessionAlertStateUserEmailAccountIdSessionSlugCompoundUniqueInput
|
|
207
217
|
AND?: Prisma.SessionAlertStateWhereInput | Prisma.SessionAlertStateWhereInput[]
|
|
208
218
|
OR?: Prisma.SessionAlertStateWhereInput[]
|
|
209
219
|
NOT?: Prisma.SessionAlertStateWhereInput | Prisma.SessionAlertStateWhereInput[]
|
|
210
220
|
userEmail?: Prisma.StringFilter<"SessionAlertState"> | string
|
|
221
|
+
accountId?: Prisma.StringNullableFilter<"SessionAlertState"> | string | null
|
|
211
222
|
sessionSlug?: Prisma.StringFilter<"SessionAlertState"> | string
|
|
212
223
|
lastAlertedAt?: Prisma.DateTimeNullableFilter<"SessionAlertState"> | Date | string | null
|
|
213
224
|
createdAt?: Prisma.DateTimeFilter<"SessionAlertState"> | Date | string
|
|
214
225
|
updatedAt?: Prisma.DateTimeFilter<"SessionAlertState"> | Date | string
|
|
215
|
-
}, "id" | "userEmail_sessionSlug">
|
|
226
|
+
}, "id" | "userEmail_sessionSlug" | "userEmail_accountId_sessionSlug">
|
|
216
227
|
|
|
217
228
|
export type SessionAlertStateOrderByWithAggregationInput = {
|
|
218
229
|
id?: Prisma.SortOrder
|
|
219
230
|
userEmail?: Prisma.SortOrder
|
|
231
|
+
accountId?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
220
232
|
sessionSlug?: Prisma.SortOrder
|
|
221
233
|
lastAlertedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
222
234
|
createdAt?: Prisma.SortOrder
|
|
@@ -232,6 +244,7 @@ export type SessionAlertStateScalarWhereWithAggregatesInput = {
|
|
|
232
244
|
NOT?: Prisma.SessionAlertStateScalarWhereWithAggregatesInput | Prisma.SessionAlertStateScalarWhereWithAggregatesInput[]
|
|
233
245
|
id?: Prisma.StringWithAggregatesFilter<"SessionAlertState"> | string
|
|
234
246
|
userEmail?: Prisma.StringWithAggregatesFilter<"SessionAlertState"> | string
|
|
247
|
+
accountId?: Prisma.StringNullableWithAggregatesFilter<"SessionAlertState"> | string | null
|
|
235
248
|
sessionSlug?: Prisma.StringWithAggregatesFilter<"SessionAlertState"> | string
|
|
236
249
|
lastAlertedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"SessionAlertState"> | Date | string | null
|
|
237
250
|
createdAt?: Prisma.DateTimeWithAggregatesFilter<"SessionAlertState"> | Date | string
|
|
@@ -241,6 +254,7 @@ export type SessionAlertStateScalarWhereWithAggregatesInput = {
|
|
|
241
254
|
export type SessionAlertStateCreateInput = {
|
|
242
255
|
id?: string
|
|
243
256
|
userEmail: string
|
|
257
|
+
accountId?: string | null
|
|
244
258
|
sessionSlug: string
|
|
245
259
|
lastAlertedAt?: Date | string | null
|
|
246
260
|
createdAt?: Date | string
|
|
@@ -250,6 +264,7 @@ export type SessionAlertStateCreateInput = {
|
|
|
250
264
|
export type SessionAlertStateUncheckedCreateInput = {
|
|
251
265
|
id?: string
|
|
252
266
|
userEmail: string
|
|
267
|
+
accountId?: string | null
|
|
253
268
|
sessionSlug: string
|
|
254
269
|
lastAlertedAt?: Date | string | null
|
|
255
270
|
createdAt?: Date | string
|
|
@@ -259,6 +274,7 @@ export type SessionAlertStateUncheckedCreateInput = {
|
|
|
259
274
|
export type SessionAlertStateUpdateInput = {
|
|
260
275
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
261
276
|
userEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
|
277
|
+
accountId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
262
278
|
sessionSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
|
263
279
|
lastAlertedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
264
280
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
@@ -268,6 +284,7 @@ export type SessionAlertStateUpdateInput = {
|
|
|
268
284
|
export type SessionAlertStateUncheckedUpdateInput = {
|
|
269
285
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
270
286
|
userEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
|
287
|
+
accountId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
271
288
|
sessionSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
|
272
289
|
lastAlertedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
273
290
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
@@ -277,6 +294,7 @@ export type SessionAlertStateUncheckedUpdateInput = {
|
|
|
277
294
|
export type SessionAlertStateCreateManyInput = {
|
|
278
295
|
id?: string
|
|
279
296
|
userEmail: string
|
|
297
|
+
accountId?: string | null
|
|
280
298
|
sessionSlug: string
|
|
281
299
|
lastAlertedAt?: Date | string | null
|
|
282
300
|
createdAt?: Date | string
|
|
@@ -286,6 +304,7 @@ export type SessionAlertStateCreateManyInput = {
|
|
|
286
304
|
export type SessionAlertStateUpdateManyMutationInput = {
|
|
287
305
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
288
306
|
userEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
|
307
|
+
accountId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
289
308
|
sessionSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
|
290
309
|
lastAlertedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
291
310
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
@@ -295,6 +314,7 @@ export type SessionAlertStateUpdateManyMutationInput = {
|
|
|
295
314
|
export type SessionAlertStateUncheckedUpdateManyInput = {
|
|
296
315
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
297
316
|
userEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
|
317
|
+
accountId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
298
318
|
sessionSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
|
299
319
|
lastAlertedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
300
320
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
@@ -306,9 +326,16 @@ export type SessionAlertStateUserEmailSessionSlugCompoundUniqueInput = {
|
|
|
306
326
|
sessionSlug: string
|
|
307
327
|
}
|
|
308
328
|
|
|
329
|
+
export type SessionAlertStateUserEmailAccountIdSessionSlugCompoundUniqueInput = {
|
|
330
|
+
userEmail: string
|
|
331
|
+
accountId: string
|
|
332
|
+
sessionSlug: string
|
|
333
|
+
}
|
|
334
|
+
|
|
309
335
|
export type SessionAlertStateCountOrderByAggregateInput = {
|
|
310
336
|
id?: Prisma.SortOrder
|
|
311
337
|
userEmail?: Prisma.SortOrder
|
|
338
|
+
accountId?: Prisma.SortOrder
|
|
312
339
|
sessionSlug?: Prisma.SortOrder
|
|
313
340
|
lastAlertedAt?: Prisma.SortOrder
|
|
314
341
|
createdAt?: Prisma.SortOrder
|
|
@@ -318,6 +345,7 @@ export type SessionAlertStateCountOrderByAggregateInput = {
|
|
|
318
345
|
export type SessionAlertStateMaxOrderByAggregateInput = {
|
|
319
346
|
id?: Prisma.SortOrder
|
|
320
347
|
userEmail?: Prisma.SortOrder
|
|
348
|
+
accountId?: Prisma.SortOrder
|
|
321
349
|
sessionSlug?: Prisma.SortOrder
|
|
322
350
|
lastAlertedAt?: Prisma.SortOrder
|
|
323
351
|
createdAt?: Prisma.SortOrder
|
|
@@ -327,6 +355,7 @@ export type SessionAlertStateMaxOrderByAggregateInput = {
|
|
|
327
355
|
export type SessionAlertStateMinOrderByAggregateInput = {
|
|
328
356
|
id?: Prisma.SortOrder
|
|
329
357
|
userEmail?: Prisma.SortOrder
|
|
358
|
+
accountId?: Prisma.SortOrder
|
|
330
359
|
sessionSlug?: Prisma.SortOrder
|
|
331
360
|
lastAlertedAt?: Prisma.SortOrder
|
|
332
361
|
createdAt?: Prisma.SortOrder
|
|
@@ -342,6 +371,7 @@ export type NullableDateTimeFieldUpdateOperationsInput = {
|
|
|
342
371
|
export type SessionAlertStateSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
343
372
|
id?: boolean
|
|
344
373
|
userEmail?: boolean
|
|
374
|
+
accountId?: boolean
|
|
345
375
|
sessionSlug?: boolean
|
|
346
376
|
lastAlertedAt?: boolean
|
|
347
377
|
createdAt?: boolean
|
|
@@ -351,6 +381,7 @@ export type SessionAlertStateSelect<ExtArgs extends runtime.Types.Extensions.Int
|
|
|
351
381
|
export type SessionAlertStateSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
352
382
|
id?: boolean
|
|
353
383
|
userEmail?: boolean
|
|
384
|
+
accountId?: boolean
|
|
354
385
|
sessionSlug?: boolean
|
|
355
386
|
lastAlertedAt?: boolean
|
|
356
387
|
createdAt?: boolean
|
|
@@ -360,6 +391,7 @@ export type SessionAlertStateSelectCreateManyAndReturn<ExtArgs extends runtime.T
|
|
|
360
391
|
export type SessionAlertStateSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
361
392
|
id?: boolean
|
|
362
393
|
userEmail?: boolean
|
|
394
|
+
accountId?: boolean
|
|
363
395
|
sessionSlug?: boolean
|
|
364
396
|
lastAlertedAt?: boolean
|
|
365
397
|
createdAt?: boolean
|
|
@@ -369,13 +401,14 @@ export type SessionAlertStateSelectUpdateManyAndReturn<ExtArgs extends runtime.T
|
|
|
369
401
|
export type SessionAlertStateSelectScalar = {
|
|
370
402
|
id?: boolean
|
|
371
403
|
userEmail?: boolean
|
|
404
|
+
accountId?: boolean
|
|
372
405
|
sessionSlug?: boolean
|
|
373
406
|
lastAlertedAt?: boolean
|
|
374
407
|
createdAt?: boolean
|
|
375
408
|
updatedAt?: boolean
|
|
376
409
|
}
|
|
377
410
|
|
|
378
|
-
export type SessionAlertStateOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "userEmail" | "sessionSlug" | "lastAlertedAt" | "createdAt" | "updatedAt", ExtArgs["result"]["sessionAlertState"]>
|
|
411
|
+
export type SessionAlertStateOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "userEmail" | "accountId" | "sessionSlug" | "lastAlertedAt" | "createdAt" | "updatedAt", ExtArgs["result"]["sessionAlertState"]>
|
|
379
412
|
|
|
380
413
|
export type $SessionAlertStatePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
|
381
414
|
name: "SessionAlertState"
|
|
@@ -383,6 +416,7 @@ export type $SessionAlertStatePayload<ExtArgs extends runtime.Types.Extensions.I
|
|
|
383
416
|
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
|
384
417
|
id: string
|
|
385
418
|
userEmail: string
|
|
419
|
+
accountId: string | null
|
|
386
420
|
sessionSlug: string
|
|
387
421
|
lastAlertedAt: Date | null
|
|
388
422
|
createdAt: Date
|
|
@@ -812,6 +846,7 @@ export interface Prisma__SessionAlertStateClient<T, Null = never, ExtArgs extend
|
|
|
812
846
|
export interface SessionAlertStateFieldRefs {
|
|
813
847
|
readonly id: Prisma.FieldRef<"SessionAlertState", 'String'>
|
|
814
848
|
readonly userEmail: Prisma.FieldRef<"SessionAlertState", 'String'>
|
|
849
|
+
readonly accountId: Prisma.FieldRef<"SessionAlertState", 'String'>
|
|
815
850
|
readonly sessionSlug: Prisma.FieldRef<"SessionAlertState", 'String'>
|
|
816
851
|
readonly lastAlertedAt: Prisma.FieldRef<"SessionAlertState", 'DateTime'>
|
|
817
852
|
readonly createdAt: Prisma.FieldRef<"SessionAlertState", 'DateTime'>
|
|
@@ -27,6 +27,7 @@ export type AggregateSessionFollow = {
|
|
|
27
27
|
export type SessionFollowMinAggregateOutputType = {
|
|
28
28
|
id: string | null
|
|
29
29
|
userEmail: string | null
|
|
30
|
+
accountId: string | null
|
|
30
31
|
sessionSlug: string | null
|
|
31
32
|
muted: boolean | null
|
|
32
33
|
createdAt: Date | null
|
|
@@ -36,6 +37,7 @@ export type SessionFollowMinAggregateOutputType = {
|
|
|
36
37
|
export type SessionFollowMaxAggregateOutputType = {
|
|
37
38
|
id: string | null
|
|
38
39
|
userEmail: string | null
|
|
40
|
+
accountId: string | null
|
|
39
41
|
sessionSlug: string | null
|
|
40
42
|
muted: boolean | null
|
|
41
43
|
createdAt: Date | null
|
|
@@ -45,6 +47,7 @@ export type SessionFollowMaxAggregateOutputType = {
|
|
|
45
47
|
export type SessionFollowCountAggregateOutputType = {
|
|
46
48
|
id: number
|
|
47
49
|
userEmail: number
|
|
50
|
+
accountId: number
|
|
48
51
|
sessionSlug: number
|
|
49
52
|
muted: number
|
|
50
53
|
createdAt: number
|
|
@@ -56,6 +59,7 @@ export type SessionFollowCountAggregateOutputType = {
|
|
|
56
59
|
export type SessionFollowMinAggregateInputType = {
|
|
57
60
|
id?: true
|
|
58
61
|
userEmail?: true
|
|
62
|
+
accountId?: true
|
|
59
63
|
sessionSlug?: true
|
|
60
64
|
muted?: true
|
|
61
65
|
createdAt?: true
|
|
@@ -65,6 +69,7 @@ export type SessionFollowMinAggregateInputType = {
|
|
|
65
69
|
export type SessionFollowMaxAggregateInputType = {
|
|
66
70
|
id?: true
|
|
67
71
|
userEmail?: true
|
|
72
|
+
accountId?: true
|
|
68
73
|
sessionSlug?: true
|
|
69
74
|
muted?: true
|
|
70
75
|
createdAt?: true
|
|
@@ -74,6 +79,7 @@ export type SessionFollowMaxAggregateInputType = {
|
|
|
74
79
|
export type SessionFollowCountAggregateInputType = {
|
|
75
80
|
id?: true
|
|
76
81
|
userEmail?: true
|
|
82
|
+
accountId?: true
|
|
77
83
|
sessionSlug?: true
|
|
78
84
|
muted?: true
|
|
79
85
|
createdAt?: true
|
|
@@ -156,6 +162,7 @@ export type SessionFollowGroupByArgs<ExtArgs extends runtime.Types.Extensions.In
|
|
|
156
162
|
export type SessionFollowGroupByOutputType = {
|
|
157
163
|
id: string
|
|
158
164
|
userEmail: string
|
|
165
|
+
accountId: string | null
|
|
159
166
|
sessionSlug: string
|
|
160
167
|
muted: boolean
|
|
161
168
|
createdAt: Date
|
|
@@ -186,6 +193,7 @@ export type SessionFollowWhereInput = {
|
|
|
186
193
|
NOT?: Prisma.SessionFollowWhereInput | Prisma.SessionFollowWhereInput[]
|
|
187
194
|
id?: Prisma.StringFilter<"SessionFollow"> | string
|
|
188
195
|
userEmail?: Prisma.StringFilter<"SessionFollow"> | string
|
|
196
|
+
accountId?: Prisma.StringNullableFilter<"SessionFollow"> | string | null
|
|
189
197
|
sessionSlug?: Prisma.StringFilter<"SessionFollow"> | string
|
|
190
198
|
muted?: Prisma.BoolFilter<"SessionFollow"> | boolean
|
|
191
199
|
createdAt?: Prisma.DateTimeFilter<"SessionFollow"> | Date | string
|
|
@@ -195,6 +203,7 @@ export type SessionFollowWhereInput = {
|
|
|
195
203
|
export type SessionFollowOrderByWithRelationInput = {
|
|
196
204
|
id?: Prisma.SortOrder
|
|
197
205
|
userEmail?: Prisma.SortOrder
|
|
206
|
+
accountId?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
198
207
|
sessionSlug?: Prisma.SortOrder
|
|
199
208
|
muted?: Prisma.SortOrder
|
|
200
209
|
createdAt?: Prisma.SortOrder
|
|
@@ -204,19 +213,22 @@ export type SessionFollowOrderByWithRelationInput = {
|
|
|
204
213
|
export type SessionFollowWhereUniqueInput = Prisma.AtLeast<{
|
|
205
214
|
id?: string
|
|
206
215
|
userEmail_sessionSlug?: Prisma.SessionFollowUserEmailSessionSlugCompoundUniqueInput
|
|
216
|
+
userEmail_accountId_sessionSlug?: Prisma.SessionFollowUserEmailAccountIdSessionSlugCompoundUniqueInput
|
|
207
217
|
AND?: Prisma.SessionFollowWhereInput | Prisma.SessionFollowWhereInput[]
|
|
208
218
|
OR?: Prisma.SessionFollowWhereInput[]
|
|
209
219
|
NOT?: Prisma.SessionFollowWhereInput | Prisma.SessionFollowWhereInput[]
|
|
210
220
|
userEmail?: Prisma.StringFilter<"SessionFollow"> | string
|
|
221
|
+
accountId?: Prisma.StringNullableFilter<"SessionFollow"> | string | null
|
|
211
222
|
sessionSlug?: Prisma.StringFilter<"SessionFollow"> | string
|
|
212
223
|
muted?: Prisma.BoolFilter<"SessionFollow"> | boolean
|
|
213
224
|
createdAt?: Prisma.DateTimeFilter<"SessionFollow"> | Date | string
|
|
214
225
|
updatedAt?: Prisma.DateTimeFilter<"SessionFollow"> | Date | string
|
|
215
|
-
}, "id" | "userEmail_sessionSlug">
|
|
226
|
+
}, "id" | "userEmail_sessionSlug" | "userEmail_accountId_sessionSlug">
|
|
216
227
|
|
|
217
228
|
export type SessionFollowOrderByWithAggregationInput = {
|
|
218
229
|
id?: Prisma.SortOrder
|
|
219
230
|
userEmail?: Prisma.SortOrder
|
|
231
|
+
accountId?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
220
232
|
sessionSlug?: Prisma.SortOrder
|
|
221
233
|
muted?: Prisma.SortOrder
|
|
222
234
|
createdAt?: Prisma.SortOrder
|
|
@@ -232,6 +244,7 @@ export type SessionFollowScalarWhereWithAggregatesInput = {
|
|
|
232
244
|
NOT?: Prisma.SessionFollowScalarWhereWithAggregatesInput | Prisma.SessionFollowScalarWhereWithAggregatesInput[]
|
|
233
245
|
id?: Prisma.StringWithAggregatesFilter<"SessionFollow"> | string
|
|
234
246
|
userEmail?: Prisma.StringWithAggregatesFilter<"SessionFollow"> | string
|
|
247
|
+
accountId?: Prisma.StringNullableWithAggregatesFilter<"SessionFollow"> | string | null
|
|
235
248
|
sessionSlug?: Prisma.StringWithAggregatesFilter<"SessionFollow"> | string
|
|
236
249
|
muted?: Prisma.BoolWithAggregatesFilter<"SessionFollow"> | boolean
|
|
237
250
|
createdAt?: Prisma.DateTimeWithAggregatesFilter<"SessionFollow"> | Date | string
|
|
@@ -241,6 +254,7 @@ export type SessionFollowScalarWhereWithAggregatesInput = {
|
|
|
241
254
|
export type SessionFollowCreateInput = {
|
|
242
255
|
id?: string
|
|
243
256
|
userEmail: string
|
|
257
|
+
accountId?: string | null
|
|
244
258
|
sessionSlug: string
|
|
245
259
|
muted?: boolean
|
|
246
260
|
createdAt?: Date | string
|
|
@@ -250,6 +264,7 @@ export type SessionFollowCreateInput = {
|
|
|
250
264
|
export type SessionFollowUncheckedCreateInput = {
|
|
251
265
|
id?: string
|
|
252
266
|
userEmail: string
|
|
267
|
+
accountId?: string | null
|
|
253
268
|
sessionSlug: string
|
|
254
269
|
muted?: boolean
|
|
255
270
|
createdAt?: Date | string
|
|
@@ -259,6 +274,7 @@ export type SessionFollowUncheckedCreateInput = {
|
|
|
259
274
|
export type SessionFollowUpdateInput = {
|
|
260
275
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
261
276
|
userEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
|
277
|
+
accountId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
262
278
|
sessionSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
|
263
279
|
muted?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
264
280
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
@@ -268,6 +284,7 @@ export type SessionFollowUpdateInput = {
|
|
|
268
284
|
export type SessionFollowUncheckedUpdateInput = {
|
|
269
285
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
270
286
|
userEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
|
287
|
+
accountId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
271
288
|
sessionSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
|
272
289
|
muted?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
273
290
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
@@ -277,6 +294,7 @@ export type SessionFollowUncheckedUpdateInput = {
|
|
|
277
294
|
export type SessionFollowCreateManyInput = {
|
|
278
295
|
id?: string
|
|
279
296
|
userEmail: string
|
|
297
|
+
accountId?: string | null
|
|
280
298
|
sessionSlug: string
|
|
281
299
|
muted?: boolean
|
|
282
300
|
createdAt?: Date | string
|
|
@@ -286,6 +304,7 @@ export type SessionFollowCreateManyInput = {
|
|
|
286
304
|
export type SessionFollowUpdateManyMutationInput = {
|
|
287
305
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
288
306
|
userEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
|
307
|
+
accountId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
289
308
|
sessionSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
|
290
309
|
muted?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
291
310
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
@@ -295,6 +314,7 @@ export type SessionFollowUpdateManyMutationInput = {
|
|
|
295
314
|
export type SessionFollowUncheckedUpdateManyInput = {
|
|
296
315
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
297
316
|
userEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
|
317
|
+
accountId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
298
318
|
sessionSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
|
299
319
|
muted?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
300
320
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
@@ -306,9 +326,16 @@ export type SessionFollowUserEmailSessionSlugCompoundUniqueInput = {
|
|
|
306
326
|
sessionSlug: string
|
|
307
327
|
}
|
|
308
328
|
|
|
329
|
+
export type SessionFollowUserEmailAccountIdSessionSlugCompoundUniqueInput = {
|
|
330
|
+
userEmail: string
|
|
331
|
+
accountId: string
|
|
332
|
+
sessionSlug: string
|
|
333
|
+
}
|
|
334
|
+
|
|
309
335
|
export type SessionFollowCountOrderByAggregateInput = {
|
|
310
336
|
id?: Prisma.SortOrder
|
|
311
337
|
userEmail?: Prisma.SortOrder
|
|
338
|
+
accountId?: Prisma.SortOrder
|
|
312
339
|
sessionSlug?: Prisma.SortOrder
|
|
313
340
|
muted?: Prisma.SortOrder
|
|
314
341
|
createdAt?: Prisma.SortOrder
|
|
@@ -318,6 +345,7 @@ export type SessionFollowCountOrderByAggregateInput = {
|
|
|
318
345
|
export type SessionFollowMaxOrderByAggregateInput = {
|
|
319
346
|
id?: Prisma.SortOrder
|
|
320
347
|
userEmail?: Prisma.SortOrder
|
|
348
|
+
accountId?: Prisma.SortOrder
|
|
321
349
|
sessionSlug?: Prisma.SortOrder
|
|
322
350
|
muted?: Prisma.SortOrder
|
|
323
351
|
createdAt?: Prisma.SortOrder
|
|
@@ -327,6 +355,7 @@ export type SessionFollowMaxOrderByAggregateInput = {
|
|
|
327
355
|
export type SessionFollowMinOrderByAggregateInput = {
|
|
328
356
|
id?: Prisma.SortOrder
|
|
329
357
|
userEmail?: Prisma.SortOrder
|
|
358
|
+
accountId?: Prisma.SortOrder
|
|
330
359
|
sessionSlug?: Prisma.SortOrder
|
|
331
360
|
muted?: Prisma.SortOrder
|
|
332
361
|
createdAt?: Prisma.SortOrder
|
|
@@ -342,6 +371,7 @@ export type BoolFieldUpdateOperationsInput = {
|
|
|
342
371
|
export type SessionFollowSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
343
372
|
id?: boolean
|
|
344
373
|
userEmail?: boolean
|
|
374
|
+
accountId?: boolean
|
|
345
375
|
sessionSlug?: boolean
|
|
346
376
|
muted?: boolean
|
|
347
377
|
createdAt?: boolean
|
|
@@ -351,6 +381,7 @@ export type SessionFollowSelect<ExtArgs extends runtime.Types.Extensions.Interna
|
|
|
351
381
|
export type SessionFollowSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
352
382
|
id?: boolean
|
|
353
383
|
userEmail?: boolean
|
|
384
|
+
accountId?: boolean
|
|
354
385
|
sessionSlug?: boolean
|
|
355
386
|
muted?: boolean
|
|
356
387
|
createdAt?: boolean
|
|
@@ -360,6 +391,7 @@ export type SessionFollowSelectCreateManyAndReturn<ExtArgs extends runtime.Types
|
|
|
360
391
|
export type SessionFollowSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
|
361
392
|
id?: boolean
|
|
362
393
|
userEmail?: boolean
|
|
394
|
+
accountId?: boolean
|
|
363
395
|
sessionSlug?: boolean
|
|
364
396
|
muted?: boolean
|
|
365
397
|
createdAt?: boolean
|
|
@@ -369,13 +401,14 @@ export type SessionFollowSelectUpdateManyAndReturn<ExtArgs extends runtime.Types
|
|
|
369
401
|
export type SessionFollowSelectScalar = {
|
|
370
402
|
id?: boolean
|
|
371
403
|
userEmail?: boolean
|
|
404
|
+
accountId?: boolean
|
|
372
405
|
sessionSlug?: boolean
|
|
373
406
|
muted?: boolean
|
|
374
407
|
createdAt?: boolean
|
|
375
408
|
updatedAt?: boolean
|
|
376
409
|
}
|
|
377
410
|
|
|
378
|
-
export type SessionFollowOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "userEmail" | "sessionSlug" | "muted" | "createdAt" | "updatedAt", ExtArgs["result"]["sessionFollow"]>
|
|
411
|
+
export type SessionFollowOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "userEmail" | "accountId" | "sessionSlug" | "muted" | "createdAt" | "updatedAt", ExtArgs["result"]["sessionFollow"]>
|
|
379
412
|
|
|
380
413
|
export type $SessionFollowPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
|
381
414
|
name: "SessionFollow"
|
|
@@ -383,6 +416,7 @@ export type $SessionFollowPayload<ExtArgs extends runtime.Types.Extensions.Inter
|
|
|
383
416
|
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
|
384
417
|
id: string
|
|
385
418
|
userEmail: string
|
|
419
|
+
accountId: string | null
|
|
386
420
|
sessionSlug: string
|
|
387
421
|
muted: boolean
|
|
388
422
|
createdAt: Date
|
|
@@ -812,6 +846,7 @@ export interface Prisma__SessionFollowClient<T, Null = never, ExtArgs extends ru
|
|
|
812
846
|
export interface SessionFollowFieldRefs {
|
|
813
847
|
readonly id: Prisma.FieldRef<"SessionFollow", 'String'>
|
|
814
848
|
readonly userEmail: Prisma.FieldRef<"SessionFollow", 'String'>
|
|
849
|
+
readonly accountId: Prisma.FieldRef<"SessionFollow", 'String'>
|
|
815
850
|
readonly sessionSlug: Prisma.FieldRef<"SessionFollow", 'String'>
|
|
816
851
|
readonly muted: Prisma.FieldRef<"SessionFollow", 'Boolean'>
|
|
817
852
|
readonly createdAt: Prisma.FieldRef<"SessionFollow", 'DateTime'>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
-- Add a nullable accountId to SessionFollow and SessionAlertState, with a unique
|
|
2
|
+
-- index on (userEmail, accountId, sessionSlug). Additive: the existing
|
|
3
|
+
-- (userEmail, sessionSlug) unique indexes stay. No FK: coding tables do not
|
|
4
|
+
-- hard-depend on platform tables.
|
|
5
|
+
-- Idempotent: IF NOT EXISTS for columns and indexes; the backfill only touches
|
|
6
|
+
-- rows whose accountId is still NULL.
|
|
7
|
+
|
|
8
|
+
ALTER TABLE "SessionFollow" ADD COLUMN IF NOT EXISTS "accountId" TEXT;
|
|
9
|
+
ALTER TABLE "SessionAlertState" ADD COLUMN IF NOT EXISTS "accountId" TEXT;
|
|
10
|
+
|
|
11
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "SessionFollow_userEmail_accountId_sessionSlug_key" ON "SessionFollow"("userEmail", "accountId", "sessionSlug");
|
|
12
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "SessionAlertState_userEmail_accountId_sessionSlug_key" ON "SessionAlertState"("userEmail", "accountId", "sessionSlug");
|
|
13
|
+
|
|
14
|
+
-- Backfill from AccountMember (email is unique and lowercased). Users with no
|
|
15
|
+
-- membership keep a NULL accountId.
|
|
16
|
+
UPDATE "SessionFollow" AS t
|
|
17
|
+
SET "accountId" = m."accountId"
|
|
18
|
+
FROM "AccountMember" AS m
|
|
19
|
+
WHERE t."accountId" IS NULL AND lower(t."userEmail") = m."email";
|
|
20
|
+
|
|
21
|
+
UPDATE "SessionAlertState" AS t
|
|
22
|
+
SET "accountId" = m."accountId"
|
|
23
|
+
FROM "AccountMember" AS m
|
|
24
|
+
WHERE t."accountId" IS NULL AND lower(t."userEmail") = m."email";
|
|
25
|
+
|
|
26
|
+
DO $$
|
|
27
|
+
DECLARE
|
|
28
|
+
follow_null bigint;
|
|
29
|
+
alert_null bigint;
|
|
30
|
+
BEGIN
|
|
31
|
+
SELECT count(*) INTO follow_null FROM "SessionFollow" WHERE "accountId" IS NULL;
|
|
32
|
+
SELECT count(*) INTO alert_null FROM "SessionAlertState" WHERE "accountId" IS NULL;
|
|
33
|
+
RAISE NOTICE 'accountId backfill: % SessionFollow and % SessionAlertState rows left NULL (no account)', follow_null, alert_null;
|
|
34
|
+
END $$;
|
|
@@ -59,12 +59,16 @@ model AgentPhaseMethodology {
|
|
|
59
59
|
model SessionFollow {
|
|
60
60
|
id String @id @default(cuid())
|
|
61
61
|
userEmail String
|
|
62
|
+
// ACC-3.1: nullable, backfilled from AccountMember by lower(userEmail). No FK:
|
|
63
|
+
// coding models do not hard-depend on platform tables.
|
|
64
|
+
accountId String?
|
|
62
65
|
sessionSlug String
|
|
63
66
|
muted Boolean @default(false)
|
|
64
67
|
createdAt DateTime @default(now())
|
|
65
68
|
updatedAt DateTime @updatedAt
|
|
66
69
|
|
|
67
70
|
@@unique([userEmail, sessionSlug])
|
|
71
|
+
@@unique([userEmail, accountId, sessionSlug])
|
|
68
72
|
@@index([sessionSlug])
|
|
69
73
|
}
|
|
70
74
|
|
|
@@ -76,10 +80,12 @@ model SessionFollow {
|
|
|
76
80
|
model SessionAlertState {
|
|
77
81
|
id String @id @default(cuid())
|
|
78
82
|
userEmail String
|
|
83
|
+
accountId String? // see SessionFollow.accountId
|
|
79
84
|
sessionSlug String
|
|
80
85
|
lastAlertedAt DateTime?
|
|
81
86
|
createdAt DateTime @default(now())
|
|
82
87
|
updatedAt DateTime @updatedAt
|
|
83
88
|
|
|
84
89
|
@@unique([userEmail, sessionSlug])
|
|
90
|
+
@@unique([userEmail, accountId, sessionSlug])
|
|
85
91
|
}
|