@claroshq/claros 0.0.0-stage → 0.8.3

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.
Files changed (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -2
  3. package/assets/dashboard/apple-touch-icon.png +0 -0
  4. package/assets/dashboard/assets/bricolage-grotesque-latin-ext-wght-normal-CcLUaPy7.woff2 +0 -0
  5. package/assets/dashboard/assets/bricolage-grotesque-latin-wght-normal-DLoelf7F.woff2 +0 -0
  6. package/assets/dashboard/assets/bricolage-grotesque-vietnamese-wght-normal-BUzh504Q.woff2 +0 -0
  7. package/assets/dashboard/assets/index-Dvs1k10B.js +23 -0
  8. package/assets/dashboard/assets/index-gR64IOwq.css +1 -0
  9. package/assets/dashboard/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g.woff2 +0 -0
  10. package/assets/dashboard/assets/instrument-sans-latin-wght-normal-BbzFLZTg.woff2 +0 -0
  11. package/assets/dashboard/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  12. package/assets/dashboard/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  13. package/assets/dashboard/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  14. package/assets/dashboard/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  15. package/assets/dashboard/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  16. package/assets/dashboard/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  17. package/assets/dashboard/assets/quicksand-latin-ext-wght-normal-CrJ75Ewg.woff2 +0 -0
  18. package/assets/dashboard/assets/quicksand-latin-wght-normal-Buj9m_3d.woff2 +0 -0
  19. package/assets/dashboard/assets/quicksand-vietnamese-wght-normal-ei70gACF.woff2 +0 -0
  20. package/assets/dashboard/claros.js +122 -0
  21. package/assets/dashboard/favicon-16.png +0 -0
  22. package/assets/dashboard/favicon-32.png +0 -0
  23. package/assets/dashboard/favicon.ico +0 -0
  24. package/assets/dashboard/favicon.svg +17 -0
  25. package/assets/dashboard/fonts-license.txt +119 -0
  26. package/assets/dashboard/index.html +34 -0
  27. package/assets/migrations/0000_baseline.sql +343 -0
  28. package/assets/migrations/0001_kb_fts.sql +22 -0
  29. package/assets/migrations/0002_instance_layer.sql +51 -0
  30. package/assets/migrations/0003_suppressions_lower_email.sql +22 -0
  31. package/assets/migrations/0004_claim_tokens.sql +9 -0
  32. package/assets/migrations/0005_topics_transports.sql +36 -0
  33. package/assets/migrations/0006_ops_alerts.sql +28 -0
  34. package/assets/migrations/0007_integration_surface.sql +46 -0
  35. package/assets/migrations/0008_p5_engine.sql +31 -0
  36. package/assets/migrations/0009_p5b_readiness.sql +11 -0
  37. package/assets/migrations/meta/0000_snapshot.json +2489 -0
  38. package/assets/migrations/meta/0002_snapshot.json +2645 -0
  39. package/assets/migrations/meta/0004_snapshot.json +2698 -0
  40. package/assets/migrations/meta/0005_snapshot.json +2959 -0
  41. package/assets/migrations/meta/0006_snapshot.json +3138 -0
  42. package/assets/migrations/meta/0007_snapshot.json +3469 -0
  43. package/assets/migrations/meta/0008_snapshot.json +3709 -0
  44. package/assets/migrations/meta/0009_snapshot.json +3785 -0
  45. package/assets/migrations/meta/_journal.json +76 -0
  46. package/assets/worker/index.js +57863 -0
  47. package/bin/claros.mjs +13 -0
  48. package/dist/apply.d.ts +10 -0
  49. package/dist/apply.d.ts.map +1 -0
  50. package/dist/apply.js +72 -0
  51. package/dist/apply.js.map +1 -0
  52. package/dist/assets.d.ts +15 -0
  53. package/dist/assets.d.ts.map +1 -0
  54. package/dist/assets.js +48 -0
  55. package/dist/assets.js.map +1 -0
  56. package/dist/claim.d.ts +12 -0
  57. package/dist/claim.d.ts.map +1 -0
  58. package/dist/claim.js +26 -0
  59. package/dist/claim.js.map +1 -0
  60. package/dist/cli.d.ts +13 -0
  61. package/dist/cli.d.ts.map +1 -0
  62. package/dist/cli.js +158 -0
  63. package/dist/cli.js.map +1 -0
  64. package/dist/cloudflare-api.d.ts +48 -0
  65. package/dist/cloudflare-api.d.ts.map +1 -0
  66. package/dist/cloudflare-api.js +94 -0
  67. package/dist/cloudflare-api.js.map +1 -0
  68. package/dist/import.d.ts +16 -0
  69. package/dist/import.d.ts.map +1 -0
  70. package/dist/import.js +97 -0
  71. package/dist/import.js.map +1 -0
  72. package/dist/ops.d.ts +84 -0
  73. package/dist/ops.d.ts.map +1 -0
  74. package/dist/ops.js +552 -0
  75. package/dist/ops.js.map +1 -0
  76. package/dist/state.d.ts +53 -0
  77. package/dist/state.d.ts.map +1 -0
  78. package/dist/state.js +87 -0
  79. package/dist/state.js.map +1 -0
  80. package/dist/template.d.ts +77 -0
  81. package/dist/template.d.ts.map +1 -0
  82. package/dist/template.js +127 -0
  83. package/dist/template.js.map +1 -0
  84. package/dist/version.d.ts +3 -0
  85. package/dist/version.d.ts.map +1 -0
  86. package/dist/version.js +36 -0
  87. package/dist/version.js.map +1 -0
  88. package/dist/wrangler.d.ts +116 -0
  89. package/dist/wrangler.d.ts.map +1 -0
  90. package/dist/wrangler.js +210 -0
  91. package/dist/wrangler.js.map +1 -0
  92. package/package.json +53 -4
@@ -0,0 +1,3138 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "b29bf8a8-c33c-4f2b-b153-1b9121f2fc47",
5
+ "prevId": "951c4454-fe23-41cd-a7d3-8fa56c594ded",
6
+ "tables": {
7
+ "api_keys": {
8
+ "name": "api_keys",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "tenant_id": {
18
+ "name": "tenant_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": false,
22
+ "autoincrement": false
23
+ },
24
+ "key_hash": {
25
+ "name": "key_hash",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "prefix": {
32
+ "name": "prefix",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "label": {
39
+ "name": "label",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "kind": {
46
+ "name": "kind",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": true,
50
+ "autoincrement": false,
51
+ "default": "'secret'"
52
+ },
53
+ "allowed_origins": {
54
+ "name": "allowed_origins",
55
+ "type": "text",
56
+ "primaryKey": false,
57
+ "notNull": false,
58
+ "autoincrement": false
59
+ },
60
+ "last_used_at": {
61
+ "name": "last_used_at",
62
+ "type": "integer",
63
+ "primaryKey": false,
64
+ "notNull": false,
65
+ "autoincrement": false
66
+ },
67
+ "created_at": {
68
+ "name": "created_at",
69
+ "type": "integer",
70
+ "primaryKey": false,
71
+ "notNull": false,
72
+ "autoincrement": false
73
+ },
74
+ "revoked_at": {
75
+ "name": "revoked_at",
76
+ "type": "integer",
77
+ "primaryKey": false,
78
+ "notNull": false,
79
+ "autoincrement": false
80
+ }
81
+ },
82
+ "indexes": {
83
+ "uq_api_keys_hash_active": {
84
+ "name": "uq_api_keys_hash_active",
85
+ "columns": [
86
+ "key_hash"
87
+ ],
88
+ "isUnique": true,
89
+ "where": "revoked_at IS NULL"
90
+ },
91
+ "idx_api_keys_tenant": {
92
+ "name": "idx_api_keys_tenant",
93
+ "columns": [
94
+ "tenant_id"
95
+ ],
96
+ "isUnique": false
97
+ }
98
+ },
99
+ "foreignKeys": {
100
+ "api_keys_tenant_id_tenants_id_fk": {
101
+ "name": "api_keys_tenant_id_tenants_id_fk",
102
+ "tableFrom": "api_keys",
103
+ "tableTo": "tenants",
104
+ "columnsFrom": [
105
+ "tenant_id"
106
+ ],
107
+ "columnsTo": [
108
+ "id"
109
+ ],
110
+ "onDelete": "no action",
111
+ "onUpdate": "no action"
112
+ }
113
+ },
114
+ "compositePrimaryKeys": {},
115
+ "uniqueConstraints": {},
116
+ "checkConstraints": {}
117
+ },
118
+ "claim_tokens": {
119
+ "name": "claim_tokens",
120
+ "columns": {
121
+ "id": {
122
+ "name": "id",
123
+ "type": "text",
124
+ "primaryKey": true,
125
+ "notNull": true,
126
+ "autoincrement": false
127
+ },
128
+ "token_hash": {
129
+ "name": "token_hash",
130
+ "type": "text",
131
+ "primaryKey": false,
132
+ "notNull": true,
133
+ "autoincrement": false
134
+ },
135
+ "expires_at": {
136
+ "name": "expires_at",
137
+ "type": "integer",
138
+ "primaryKey": false,
139
+ "notNull": true,
140
+ "autoincrement": false
141
+ },
142
+ "consumed_at": {
143
+ "name": "consumed_at",
144
+ "type": "integer",
145
+ "primaryKey": false,
146
+ "notNull": false,
147
+ "autoincrement": false
148
+ },
149
+ "created_at": {
150
+ "name": "created_at",
151
+ "type": "integer",
152
+ "primaryKey": false,
153
+ "notNull": false,
154
+ "autoincrement": false
155
+ }
156
+ },
157
+ "indexes": {
158
+ "uq_claim_tokens_token_hash": {
159
+ "name": "uq_claim_tokens_token_hash",
160
+ "columns": [
161
+ "token_hash"
162
+ ],
163
+ "isUnique": true
164
+ }
165
+ },
166
+ "foreignKeys": {},
167
+ "compositePrimaryKeys": {},
168
+ "uniqueConstraints": {},
169
+ "checkConstraints": {}
170
+ },
171
+ "contact_conflicts": {
172
+ "name": "contact_conflicts",
173
+ "columns": {
174
+ "id": {
175
+ "name": "id",
176
+ "type": "text",
177
+ "primaryKey": true,
178
+ "notNull": true,
179
+ "autoincrement": false
180
+ },
181
+ "tenant_id": {
182
+ "name": "tenant_id",
183
+ "type": "text",
184
+ "primaryKey": false,
185
+ "notNull": true,
186
+ "autoincrement": false
187
+ },
188
+ "contact_id": {
189
+ "name": "contact_id",
190
+ "type": "text",
191
+ "primaryKey": false,
192
+ "notNull": true,
193
+ "autoincrement": false
194
+ },
195
+ "field": {
196
+ "name": "field",
197
+ "type": "text",
198
+ "primaryKey": false,
199
+ "notNull": true,
200
+ "autoincrement": false
201
+ },
202
+ "rejected_value": {
203
+ "name": "rejected_value",
204
+ "type": "text",
205
+ "primaryKey": false,
206
+ "notNull": true,
207
+ "autoincrement": false
208
+ },
209
+ "event_id": {
210
+ "name": "event_id",
211
+ "type": "text",
212
+ "primaryKey": false,
213
+ "notNull": true,
214
+ "autoincrement": false
215
+ },
216
+ "created_at": {
217
+ "name": "created_at",
218
+ "type": "integer",
219
+ "primaryKey": false,
220
+ "notNull": false,
221
+ "autoincrement": false
222
+ }
223
+ },
224
+ "indexes": {
225
+ "idx_contact_conflicts_tenant": {
226
+ "name": "idx_contact_conflicts_tenant",
227
+ "columns": [
228
+ "tenant_id",
229
+ "created_at"
230
+ ],
231
+ "isUnique": false
232
+ },
233
+ "idx_contact_conflicts_contact": {
234
+ "name": "idx_contact_conflicts_contact",
235
+ "columns": [
236
+ "contact_id"
237
+ ],
238
+ "isUnique": false
239
+ }
240
+ },
241
+ "foreignKeys": {
242
+ "contact_conflicts_tenant_id_tenants_id_fk": {
243
+ "name": "contact_conflicts_tenant_id_tenants_id_fk",
244
+ "tableFrom": "contact_conflicts",
245
+ "tableTo": "tenants",
246
+ "columnsFrom": [
247
+ "tenant_id"
248
+ ],
249
+ "columnsTo": [
250
+ "id"
251
+ ],
252
+ "onDelete": "no action",
253
+ "onUpdate": "no action"
254
+ },
255
+ "contact_conflicts_contact_id_contacts_id_fk": {
256
+ "name": "contact_conflicts_contact_id_contacts_id_fk",
257
+ "tableFrom": "contact_conflicts",
258
+ "tableTo": "contacts",
259
+ "columnsFrom": [
260
+ "contact_id"
261
+ ],
262
+ "columnsTo": [
263
+ "id"
264
+ ],
265
+ "onDelete": "no action",
266
+ "onUpdate": "no action"
267
+ }
268
+ },
269
+ "compositePrimaryKeys": {},
270
+ "uniqueConstraints": {},
271
+ "checkConstraints": {}
272
+ },
273
+ "contact_topics": {
274
+ "name": "contact_topics",
275
+ "columns": {
276
+ "tenant_id": {
277
+ "name": "tenant_id",
278
+ "type": "text",
279
+ "primaryKey": false,
280
+ "notNull": true,
281
+ "autoincrement": false
282
+ },
283
+ "contact_id": {
284
+ "name": "contact_id",
285
+ "type": "text",
286
+ "primaryKey": false,
287
+ "notNull": true,
288
+ "autoincrement": false
289
+ },
290
+ "topic_id": {
291
+ "name": "topic_id",
292
+ "type": "text",
293
+ "primaryKey": false,
294
+ "notNull": true,
295
+ "autoincrement": false
296
+ },
297
+ "status": {
298
+ "name": "status",
299
+ "type": "text",
300
+ "primaryKey": false,
301
+ "notNull": true,
302
+ "autoincrement": false
303
+ },
304
+ "updated_at": {
305
+ "name": "updated_at",
306
+ "type": "integer",
307
+ "primaryKey": false,
308
+ "notNull": false,
309
+ "autoincrement": false
310
+ },
311
+ "source": {
312
+ "name": "source",
313
+ "type": "text",
314
+ "primaryKey": false,
315
+ "notNull": false,
316
+ "autoincrement": false
317
+ }
318
+ },
319
+ "indexes": {
320
+ "idx_contact_topics_tenant_topic": {
321
+ "name": "idx_contact_topics_tenant_topic",
322
+ "columns": [
323
+ "tenant_id",
324
+ "topic_id"
325
+ ],
326
+ "isUnique": false
327
+ }
328
+ },
329
+ "foreignKeys": {
330
+ "contact_topics_tenant_id_tenants_id_fk": {
331
+ "name": "contact_topics_tenant_id_tenants_id_fk",
332
+ "tableFrom": "contact_topics",
333
+ "tableTo": "tenants",
334
+ "columnsFrom": [
335
+ "tenant_id"
336
+ ],
337
+ "columnsTo": [
338
+ "id"
339
+ ],
340
+ "onDelete": "no action",
341
+ "onUpdate": "no action"
342
+ },
343
+ "contact_topics_contact_id_contacts_id_fk": {
344
+ "name": "contact_topics_contact_id_contacts_id_fk",
345
+ "tableFrom": "contact_topics",
346
+ "tableTo": "contacts",
347
+ "columnsFrom": [
348
+ "contact_id"
349
+ ],
350
+ "columnsTo": [
351
+ "id"
352
+ ],
353
+ "onDelete": "no action",
354
+ "onUpdate": "no action"
355
+ },
356
+ "contact_topics_topic_id_topics_id_fk": {
357
+ "name": "contact_topics_topic_id_topics_id_fk",
358
+ "tableFrom": "contact_topics",
359
+ "tableTo": "topics",
360
+ "columnsFrom": [
361
+ "topic_id"
362
+ ],
363
+ "columnsTo": [
364
+ "id"
365
+ ],
366
+ "onDelete": "no action",
367
+ "onUpdate": "no action"
368
+ }
369
+ },
370
+ "compositePrimaryKeys": {
371
+ "contact_topics_pkey": {
372
+ "columns": [
373
+ "contact_id",
374
+ "topic_id"
375
+ ],
376
+ "name": "contact_topics_pkey"
377
+ }
378
+ },
379
+ "uniqueConstraints": {},
380
+ "checkConstraints": {}
381
+ },
382
+ "contacts": {
383
+ "name": "contacts",
384
+ "columns": {
385
+ "id": {
386
+ "name": "id",
387
+ "type": "text",
388
+ "primaryKey": true,
389
+ "notNull": true,
390
+ "autoincrement": false
391
+ },
392
+ "tenant_id": {
393
+ "name": "tenant_id",
394
+ "type": "text",
395
+ "primaryKey": false,
396
+ "notNull": true,
397
+ "autoincrement": false
398
+ },
399
+ "external_id": {
400
+ "name": "external_id",
401
+ "type": "text",
402
+ "primaryKey": false,
403
+ "notNull": true,
404
+ "autoincrement": false
405
+ },
406
+ "email": {
407
+ "name": "email",
408
+ "type": "text",
409
+ "primaryKey": false,
410
+ "notNull": false,
411
+ "autoincrement": false
412
+ },
413
+ "name": {
414
+ "name": "name",
415
+ "type": "text",
416
+ "primaryKey": false,
417
+ "notNull": false,
418
+ "autoincrement": false
419
+ },
420
+ "company": {
421
+ "name": "company",
422
+ "type": "text",
423
+ "primaryKey": false,
424
+ "notNull": false,
425
+ "autoincrement": false
426
+ },
427
+ "properties": {
428
+ "name": "properties",
429
+ "type": "text",
430
+ "primaryKey": false,
431
+ "notNull": false,
432
+ "autoincrement": false
433
+ },
434
+ "lifecycle_state": {
435
+ "name": "lifecycle_state",
436
+ "type": "text",
437
+ "primaryKey": false,
438
+ "notNull": true,
439
+ "autoincrement": false
440
+ },
441
+ "engagement_depth": {
442
+ "name": "engagement_depth",
443
+ "type": "text",
444
+ "primaryKey": false,
445
+ "notNull": false,
446
+ "autoincrement": false
447
+ },
448
+ "payment_status": {
449
+ "name": "payment_status",
450
+ "type": "text",
451
+ "primaryKey": false,
452
+ "notNull": false,
453
+ "autoincrement": false,
454
+ "default": "'free'"
455
+ },
456
+ "first_seen_at": {
457
+ "name": "first_seen_at",
458
+ "type": "integer",
459
+ "primaryKey": false,
460
+ "notNull": false,
461
+ "autoincrement": false
462
+ },
463
+ "last_seen_at": {
464
+ "name": "last_seen_at",
465
+ "type": "integer",
466
+ "primaryKey": false,
467
+ "notNull": false,
468
+ "autoincrement": false
469
+ },
470
+ "activated_at": {
471
+ "name": "activated_at",
472
+ "type": "integer",
473
+ "primaryKey": false,
474
+ "notNull": false,
475
+ "autoincrement": false
476
+ },
477
+ "created_at": {
478
+ "name": "created_at",
479
+ "type": "integer",
480
+ "primaryKey": false,
481
+ "notNull": false,
482
+ "autoincrement": false
483
+ },
484
+ "event_count_bucket_current": {
485
+ "name": "event_count_bucket_current",
486
+ "type": "integer",
487
+ "primaryKey": false,
488
+ "notNull": false,
489
+ "autoincrement": false,
490
+ "default": 0
491
+ },
492
+ "event_count_bucket_prev": {
493
+ "name": "event_count_bucket_prev",
494
+ "type": "integer",
495
+ "primaryKey": false,
496
+ "notNull": false,
497
+ "autoincrement": false,
498
+ "default": 0
499
+ },
500
+ "last_counter_reset_at": {
501
+ "name": "last_counter_reset_at",
502
+ "type": "integer",
503
+ "primaryKey": false,
504
+ "notNull": false,
505
+ "autoincrement": false
506
+ }
507
+ },
508
+ "indexes": {
509
+ "uq_contacts_tenant_external_id": {
510
+ "name": "uq_contacts_tenant_external_id",
511
+ "columns": [
512
+ "tenant_id",
513
+ "external_id"
514
+ ],
515
+ "isUnique": true
516
+ },
517
+ "uq_contacts_tenant_email": {
518
+ "name": "uq_contacts_tenant_email",
519
+ "columns": [
520
+ "tenant_id",
521
+ "email"
522
+ ],
523
+ "isUnique": true,
524
+ "where": "email IS NOT NULL"
525
+ },
526
+ "idx_contacts_tenant_state": {
527
+ "name": "idx_contacts_tenant_state",
528
+ "columns": [
529
+ "tenant_id",
530
+ "lifecycle_state"
531
+ ],
532
+ "isUnique": false
533
+ },
534
+ "idx_contacts_last_seen": {
535
+ "name": "idx_contacts_last_seen",
536
+ "columns": [
537
+ "tenant_id",
538
+ "last_seen_at"
539
+ ],
540
+ "isUnique": false
541
+ },
542
+ "idx_contacts_tenant_created": {
543
+ "name": "idx_contacts_tenant_created",
544
+ "columns": [
545
+ "tenant_id",
546
+ "created_at",
547
+ "id"
548
+ ],
549
+ "isUnique": false
550
+ }
551
+ },
552
+ "foreignKeys": {
553
+ "contacts_tenant_id_tenants_id_fk": {
554
+ "name": "contacts_tenant_id_tenants_id_fk",
555
+ "tableFrom": "contacts",
556
+ "tableTo": "tenants",
557
+ "columnsFrom": [
558
+ "tenant_id"
559
+ ],
560
+ "columnsTo": [
561
+ "id"
562
+ ],
563
+ "onDelete": "no action",
564
+ "onUpdate": "no action"
565
+ }
566
+ },
567
+ "compositePrimaryKeys": {},
568
+ "uniqueConstraints": {},
569
+ "checkConstraints": {}
570
+ },
571
+ "events": {
572
+ "name": "events",
573
+ "columns": {
574
+ "id": {
575
+ "name": "id",
576
+ "type": "text",
577
+ "primaryKey": true,
578
+ "notNull": true,
579
+ "autoincrement": false
580
+ },
581
+ "tenant_id": {
582
+ "name": "tenant_id",
583
+ "type": "text",
584
+ "primaryKey": false,
585
+ "notNull": true,
586
+ "autoincrement": false
587
+ },
588
+ "contact_id": {
589
+ "name": "contact_id",
590
+ "type": "text",
591
+ "primaryKey": false,
592
+ "notNull": true,
593
+ "autoincrement": false
594
+ },
595
+ "type": {
596
+ "name": "type",
597
+ "type": "text",
598
+ "primaryKey": false,
599
+ "notNull": true,
600
+ "autoincrement": false
601
+ },
602
+ "event_name": {
603
+ "name": "event_name",
604
+ "type": "text",
605
+ "primaryKey": false,
606
+ "notNull": false,
607
+ "autoincrement": false
608
+ },
609
+ "properties": {
610
+ "name": "properties",
611
+ "type": "text",
612
+ "primaryKey": false,
613
+ "notNull": false,
614
+ "autoincrement": false
615
+ },
616
+ "context": {
617
+ "name": "context",
618
+ "type": "text",
619
+ "primaryKey": false,
620
+ "notNull": false,
621
+ "autoincrement": false
622
+ },
623
+ "message_id": {
624
+ "name": "message_id",
625
+ "type": "text",
626
+ "primaryKey": false,
627
+ "notNull": false,
628
+ "autoincrement": false
629
+ },
630
+ "timestamp": {
631
+ "name": "timestamp",
632
+ "type": "integer",
633
+ "primaryKey": false,
634
+ "notNull": true,
635
+ "autoincrement": false
636
+ },
637
+ "received_at": {
638
+ "name": "received_at",
639
+ "type": "integer",
640
+ "primaryKey": false,
641
+ "notNull": true,
642
+ "autoincrement": false
643
+ }
644
+ },
645
+ "indexes": {
646
+ "idx_events_contact_time": {
647
+ "name": "idx_events_contact_time",
648
+ "columns": [
649
+ "contact_id",
650
+ "timestamp"
651
+ ],
652
+ "isUnique": false
653
+ },
654
+ "idx_events_tenant_name": {
655
+ "name": "idx_events_tenant_name",
656
+ "columns": [
657
+ "tenant_id",
658
+ "event_name",
659
+ "timestamp"
660
+ ],
661
+ "isUnique": false
662
+ },
663
+ "idx_events_tenant_time": {
664
+ "name": "idx_events_tenant_time",
665
+ "columns": [
666
+ "tenant_id",
667
+ "timestamp"
668
+ ],
669
+ "isUnique": false
670
+ },
671
+ "idx_events_dedup_lookup": {
672
+ "name": "idx_events_dedup_lookup",
673
+ "columns": [
674
+ "tenant_id",
675
+ "message_id"
676
+ ],
677
+ "isUnique": false,
678
+ "where": "message_id IS NOT NULL"
679
+ }
680
+ },
681
+ "foreignKeys": {
682
+ "events_tenant_id_tenants_id_fk": {
683
+ "name": "events_tenant_id_tenants_id_fk",
684
+ "tableFrom": "events",
685
+ "tableTo": "tenants",
686
+ "columnsFrom": [
687
+ "tenant_id"
688
+ ],
689
+ "columnsTo": [
690
+ "id"
691
+ ],
692
+ "onDelete": "no action",
693
+ "onUpdate": "no action"
694
+ },
695
+ "events_contact_id_contacts_id_fk": {
696
+ "name": "events_contact_id_contacts_id_fk",
697
+ "tableFrom": "events",
698
+ "tableTo": "contacts",
699
+ "columnsFrom": [
700
+ "contact_id"
701
+ ],
702
+ "columnsTo": [
703
+ "id"
704
+ ],
705
+ "onDelete": "no action",
706
+ "onUpdate": "no action"
707
+ }
708
+ },
709
+ "compositePrimaryKeys": {},
710
+ "uniqueConstraints": {},
711
+ "checkConstraints": {}
712
+ },
713
+ "flow_memberships": {
714
+ "name": "flow_memberships",
715
+ "columns": {
716
+ "id": {
717
+ "name": "id",
718
+ "type": "text",
719
+ "primaryKey": true,
720
+ "notNull": true,
721
+ "autoincrement": false
722
+ },
723
+ "tenant_id": {
724
+ "name": "tenant_id",
725
+ "type": "text",
726
+ "primaryKey": false,
727
+ "notNull": true,
728
+ "autoincrement": false
729
+ },
730
+ "contact_id": {
731
+ "name": "contact_id",
732
+ "type": "text",
733
+ "primaryKey": false,
734
+ "notNull": true,
735
+ "autoincrement": false
736
+ },
737
+ "flow_id": {
738
+ "name": "flow_id",
739
+ "type": "text",
740
+ "primaryKey": false,
741
+ "notNull": true,
742
+ "autoincrement": false
743
+ },
744
+ "current_step": {
745
+ "name": "current_step",
746
+ "type": "integer",
747
+ "primaryKey": false,
748
+ "notNull": true,
749
+ "autoincrement": false,
750
+ "default": 1
751
+ },
752
+ "status": {
753
+ "name": "status",
754
+ "type": "text",
755
+ "primaryKey": false,
756
+ "notNull": true,
757
+ "autoincrement": false,
758
+ "default": "'active'"
759
+ },
760
+ "entered_at": {
761
+ "name": "entered_at",
762
+ "type": "integer",
763
+ "primaryKey": false,
764
+ "notNull": true,
765
+ "autoincrement": false
766
+ },
767
+ "completed_at": {
768
+ "name": "completed_at",
769
+ "type": "integer",
770
+ "primaryKey": false,
771
+ "notNull": false,
772
+ "autoincrement": false
773
+ },
774
+ "exited_at": {
775
+ "name": "exited_at",
776
+ "type": "integer",
777
+ "primaryKey": false,
778
+ "notNull": false,
779
+ "autoincrement": false
780
+ },
781
+ "exit_reason": {
782
+ "name": "exit_reason",
783
+ "type": "text",
784
+ "primaryKey": false,
785
+ "notNull": false,
786
+ "autoincrement": false
787
+ },
788
+ "condition_error": {
789
+ "name": "condition_error",
790
+ "type": "text",
791
+ "primaryKey": false,
792
+ "notNull": false,
793
+ "autoincrement": false
794
+ }
795
+ },
796
+ "indexes": {
797
+ "uq_flow_membership_active": {
798
+ "name": "uq_flow_membership_active",
799
+ "columns": [
800
+ "contact_id",
801
+ "flow_id"
802
+ ],
803
+ "isUnique": true,
804
+ "where": "status = 'active'"
805
+ },
806
+ "idx_flow_members_contact": {
807
+ "name": "idx_flow_members_contact",
808
+ "columns": [
809
+ "contact_id",
810
+ "status"
811
+ ],
812
+ "isUnique": false
813
+ },
814
+ "idx_flow_members_flow": {
815
+ "name": "idx_flow_members_flow",
816
+ "columns": [
817
+ "flow_id",
818
+ "status",
819
+ "current_step"
820
+ ],
821
+ "isUnique": false
822
+ }
823
+ },
824
+ "foreignKeys": {
825
+ "flow_memberships_tenant_id_tenants_id_fk": {
826
+ "name": "flow_memberships_tenant_id_tenants_id_fk",
827
+ "tableFrom": "flow_memberships",
828
+ "tableTo": "tenants",
829
+ "columnsFrom": [
830
+ "tenant_id"
831
+ ],
832
+ "columnsTo": [
833
+ "id"
834
+ ],
835
+ "onDelete": "no action",
836
+ "onUpdate": "no action"
837
+ },
838
+ "flow_memberships_contact_id_contacts_id_fk": {
839
+ "name": "flow_memberships_contact_id_contacts_id_fk",
840
+ "tableFrom": "flow_memberships",
841
+ "tableTo": "contacts",
842
+ "columnsFrom": [
843
+ "contact_id"
844
+ ],
845
+ "columnsTo": [
846
+ "id"
847
+ ],
848
+ "onDelete": "no action",
849
+ "onUpdate": "no action"
850
+ },
851
+ "flow_memberships_flow_id_flows_id_fk": {
852
+ "name": "flow_memberships_flow_id_flows_id_fk",
853
+ "tableFrom": "flow_memberships",
854
+ "tableTo": "flows",
855
+ "columnsFrom": [
856
+ "flow_id"
857
+ ],
858
+ "columnsTo": [
859
+ "id"
860
+ ],
861
+ "onDelete": "no action",
862
+ "onUpdate": "no action"
863
+ }
864
+ },
865
+ "compositePrimaryKeys": {},
866
+ "uniqueConstraints": {},
867
+ "checkConstraints": {}
868
+ },
869
+ "flows": {
870
+ "name": "flows",
871
+ "columns": {
872
+ "id": {
873
+ "name": "id",
874
+ "type": "text",
875
+ "primaryKey": true,
876
+ "notNull": true,
877
+ "autoincrement": false
878
+ },
879
+ "tenant_id": {
880
+ "name": "tenant_id",
881
+ "type": "text",
882
+ "primaryKey": false,
883
+ "notNull": true,
884
+ "autoincrement": false
885
+ },
886
+ "name": {
887
+ "name": "name",
888
+ "type": "text",
889
+ "primaryKey": false,
890
+ "notNull": true,
891
+ "autoincrement": false
892
+ },
893
+ "description": {
894
+ "name": "description",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": false,
898
+ "autoincrement": false
899
+ },
900
+ "priority": {
901
+ "name": "priority",
902
+ "type": "integer",
903
+ "primaryKey": false,
904
+ "notNull": false,
905
+ "autoincrement": false,
906
+ "default": 0
907
+ },
908
+ "trigger_type": {
909
+ "name": "trigger_type",
910
+ "type": "text",
911
+ "primaryKey": false,
912
+ "notNull": true,
913
+ "autoincrement": false
914
+ },
915
+ "trigger_config": {
916
+ "name": "trigger_config",
917
+ "type": "text",
918
+ "primaryKey": false,
919
+ "notNull": true,
920
+ "autoincrement": false
921
+ },
922
+ "steps": {
923
+ "name": "steps",
924
+ "type": "text",
925
+ "primaryKey": false,
926
+ "notNull": true,
927
+ "autoincrement": false
928
+ },
929
+ "source": {
930
+ "name": "source",
931
+ "type": "text",
932
+ "primaryKey": false,
933
+ "notNull": false,
934
+ "autoincrement": false,
935
+ "default": "'manual'"
936
+ },
937
+ "content_mode": {
938
+ "name": "content_mode",
939
+ "type": "text",
940
+ "primaryKey": false,
941
+ "notNull": false,
942
+ "autoincrement": false,
943
+ "default": "'ai_drafted'"
944
+ },
945
+ "status": {
946
+ "name": "status",
947
+ "type": "text",
948
+ "primaryKey": false,
949
+ "notNull": false,
950
+ "autoincrement": false,
951
+ "default": "'draft'"
952
+ },
953
+ "approval_mode": {
954
+ "name": "approval_mode",
955
+ "type": "text",
956
+ "primaryKey": false,
957
+ "notNull": false,
958
+ "autoincrement": false,
959
+ "default": "'require'"
960
+ },
961
+ "flow_class": {
962
+ "name": "flow_class",
963
+ "type": "text",
964
+ "primaryKey": false,
965
+ "notNull": true,
966
+ "autoincrement": false,
967
+ "default": "'nurture'"
968
+ },
969
+ "reentry_policy": {
970
+ "name": "reentry_policy",
971
+ "type": "text",
972
+ "primaryKey": false,
973
+ "notNull": true,
974
+ "autoincrement": false,
975
+ "default": "'cooldown'"
976
+ },
977
+ "reentry_cooldown_days": {
978
+ "name": "reentry_cooldown_days",
979
+ "type": "integer",
980
+ "primaryKey": false,
981
+ "notNull": false,
982
+ "autoincrement": false,
983
+ "default": 30
984
+ },
985
+ "prompt_source": {
986
+ "name": "prompt_source",
987
+ "type": "text",
988
+ "primaryKey": false,
989
+ "notNull": false,
990
+ "autoincrement": false
991
+ },
992
+ "compiled_plan": {
993
+ "name": "compiled_plan",
994
+ "type": "text",
995
+ "primaryKey": false,
996
+ "notNull": false,
997
+ "autoincrement": false
998
+ },
999
+ "compiled_at": {
1000
+ "name": "compiled_at",
1001
+ "type": "integer",
1002
+ "primaryKey": false,
1003
+ "notNull": false,
1004
+ "autoincrement": false
1005
+ },
1006
+ "compile_status": {
1007
+ "name": "compile_status",
1008
+ "type": "text",
1009
+ "primaryKey": false,
1010
+ "notNull": false,
1011
+ "autoincrement": false
1012
+ },
1013
+ "compile_error": {
1014
+ "name": "compile_error",
1015
+ "type": "text",
1016
+ "primaryKey": false,
1017
+ "notNull": false,
1018
+ "autoincrement": false
1019
+ },
1020
+ "topic_id": {
1021
+ "name": "topic_id",
1022
+ "type": "text",
1023
+ "primaryKey": false,
1024
+ "notNull": false,
1025
+ "autoincrement": false
1026
+ },
1027
+ "created_at": {
1028
+ "name": "created_at",
1029
+ "type": "integer",
1030
+ "primaryKey": false,
1031
+ "notNull": false,
1032
+ "autoincrement": false
1033
+ },
1034
+ "updated_at": {
1035
+ "name": "updated_at",
1036
+ "type": "integer",
1037
+ "primaryKey": false,
1038
+ "notNull": false,
1039
+ "autoincrement": false
1040
+ }
1041
+ },
1042
+ "indexes": {},
1043
+ "foreignKeys": {
1044
+ "flows_tenant_id_tenants_id_fk": {
1045
+ "name": "flows_tenant_id_tenants_id_fk",
1046
+ "tableFrom": "flows",
1047
+ "tableTo": "tenants",
1048
+ "columnsFrom": [
1049
+ "tenant_id"
1050
+ ],
1051
+ "columnsTo": [
1052
+ "id"
1053
+ ],
1054
+ "onDelete": "no action",
1055
+ "onUpdate": "no action"
1056
+ },
1057
+ "flows_topic_id_topics_id_fk": {
1058
+ "name": "flows_topic_id_topics_id_fk",
1059
+ "tableFrom": "flows",
1060
+ "tableTo": "topics",
1061
+ "columnsFrom": [
1062
+ "topic_id"
1063
+ ],
1064
+ "columnsTo": [
1065
+ "id"
1066
+ ],
1067
+ "onDelete": "no action",
1068
+ "onUpdate": "no action"
1069
+ }
1070
+ },
1071
+ "compositePrimaryKeys": {},
1072
+ "uniqueConstraints": {},
1073
+ "checkConstraints": {}
1074
+ },
1075
+ "instance_settings": {
1076
+ "name": "instance_settings",
1077
+ "columns": {
1078
+ "key": {
1079
+ "name": "key",
1080
+ "type": "text",
1081
+ "primaryKey": true,
1082
+ "notNull": true,
1083
+ "autoincrement": false
1084
+ },
1085
+ "value": {
1086
+ "name": "value",
1087
+ "type": "text",
1088
+ "primaryKey": false,
1089
+ "notNull": true,
1090
+ "autoincrement": false
1091
+ },
1092
+ "updated_at": {
1093
+ "name": "updated_at",
1094
+ "type": "integer",
1095
+ "primaryKey": false,
1096
+ "notNull": false,
1097
+ "autoincrement": false
1098
+ }
1099
+ },
1100
+ "indexes": {},
1101
+ "foreignKeys": {},
1102
+ "compositePrimaryKeys": {},
1103
+ "uniqueConstraints": {},
1104
+ "checkConstraints": {}
1105
+ },
1106
+ "invites": {
1107
+ "name": "invites",
1108
+ "columns": {
1109
+ "id": {
1110
+ "name": "id",
1111
+ "type": "text",
1112
+ "primaryKey": true,
1113
+ "notNull": true,
1114
+ "autoincrement": false
1115
+ },
1116
+ "tenant_id": {
1117
+ "name": "tenant_id",
1118
+ "type": "text",
1119
+ "primaryKey": false,
1120
+ "notNull": true,
1121
+ "autoincrement": false
1122
+ },
1123
+ "email": {
1124
+ "name": "email",
1125
+ "type": "text",
1126
+ "primaryKey": false,
1127
+ "notNull": true,
1128
+ "autoincrement": false
1129
+ },
1130
+ "role": {
1131
+ "name": "role",
1132
+ "type": "text",
1133
+ "primaryKey": false,
1134
+ "notNull": true,
1135
+ "autoincrement": false,
1136
+ "default": "'member'"
1137
+ },
1138
+ "token_hash": {
1139
+ "name": "token_hash",
1140
+ "type": "text",
1141
+ "primaryKey": false,
1142
+ "notNull": true,
1143
+ "autoincrement": false
1144
+ },
1145
+ "invited_by": {
1146
+ "name": "invited_by",
1147
+ "type": "text",
1148
+ "primaryKey": false,
1149
+ "notNull": true,
1150
+ "autoincrement": false
1151
+ },
1152
+ "expires_at": {
1153
+ "name": "expires_at",
1154
+ "type": "integer",
1155
+ "primaryKey": false,
1156
+ "notNull": true,
1157
+ "autoincrement": false
1158
+ },
1159
+ "accepted_at": {
1160
+ "name": "accepted_at",
1161
+ "type": "integer",
1162
+ "primaryKey": false,
1163
+ "notNull": false,
1164
+ "autoincrement": false
1165
+ },
1166
+ "created_at": {
1167
+ "name": "created_at",
1168
+ "type": "integer",
1169
+ "primaryKey": false,
1170
+ "notNull": false,
1171
+ "autoincrement": false
1172
+ }
1173
+ },
1174
+ "indexes": {
1175
+ "idx_invites_token_hash": {
1176
+ "name": "idx_invites_token_hash",
1177
+ "columns": [
1178
+ "token_hash"
1179
+ ],
1180
+ "isUnique": false
1181
+ },
1182
+ "idx_invites_tenant": {
1183
+ "name": "idx_invites_tenant",
1184
+ "columns": [
1185
+ "tenant_id"
1186
+ ],
1187
+ "isUnique": false
1188
+ }
1189
+ },
1190
+ "foreignKeys": {
1191
+ "invites_tenant_id_tenants_id_fk": {
1192
+ "name": "invites_tenant_id_tenants_id_fk",
1193
+ "tableFrom": "invites",
1194
+ "tableTo": "tenants",
1195
+ "columnsFrom": [
1196
+ "tenant_id"
1197
+ ],
1198
+ "columnsTo": [
1199
+ "id"
1200
+ ],
1201
+ "onDelete": "no action",
1202
+ "onUpdate": "no action"
1203
+ },
1204
+ "invites_invited_by_users_id_fk": {
1205
+ "name": "invites_invited_by_users_id_fk",
1206
+ "tableFrom": "invites",
1207
+ "tableTo": "users",
1208
+ "columnsFrom": [
1209
+ "invited_by"
1210
+ ],
1211
+ "columnsTo": [
1212
+ "id"
1213
+ ],
1214
+ "onDelete": "no action",
1215
+ "onUpdate": "no action"
1216
+ }
1217
+ },
1218
+ "compositePrimaryKeys": {},
1219
+ "uniqueConstraints": {},
1220
+ "checkConstraints": {}
1221
+ },
1222
+ "kb_entries": {
1223
+ "name": "kb_entries",
1224
+ "columns": {
1225
+ "id": {
1226
+ "name": "id",
1227
+ "type": "text",
1228
+ "primaryKey": true,
1229
+ "notNull": true,
1230
+ "autoincrement": false
1231
+ },
1232
+ "tenant_id": {
1233
+ "name": "tenant_id",
1234
+ "type": "text",
1235
+ "primaryKey": false,
1236
+ "notNull": true,
1237
+ "autoincrement": false
1238
+ },
1239
+ "title": {
1240
+ "name": "title",
1241
+ "type": "text",
1242
+ "primaryKey": false,
1243
+ "notNull": true,
1244
+ "autoincrement": false
1245
+ },
1246
+ "content": {
1247
+ "name": "content",
1248
+ "type": "text",
1249
+ "primaryKey": false,
1250
+ "notNull": true,
1251
+ "autoincrement": false
1252
+ },
1253
+ "content_type": {
1254
+ "name": "content_type",
1255
+ "type": "text",
1256
+ "primaryKey": false,
1257
+ "notNull": false,
1258
+ "autoincrement": false,
1259
+ "default": "'markdown'"
1260
+ },
1261
+ "source": {
1262
+ "name": "source",
1263
+ "type": "text",
1264
+ "primaryKey": false,
1265
+ "notNull": false,
1266
+ "autoincrement": false,
1267
+ "default": "'manual'"
1268
+ },
1269
+ "source_url": {
1270
+ "name": "source_url",
1271
+ "type": "text",
1272
+ "primaryKey": false,
1273
+ "notNull": false,
1274
+ "autoincrement": false
1275
+ },
1276
+ "tags": {
1277
+ "name": "tags",
1278
+ "type": "text",
1279
+ "primaryKey": false,
1280
+ "notNull": false,
1281
+ "autoincrement": false
1282
+ },
1283
+ "embedding": {
1284
+ "name": "embedding",
1285
+ "type": "text",
1286
+ "primaryKey": false,
1287
+ "notNull": false,
1288
+ "autoincrement": false
1289
+ },
1290
+ "embedding_status": {
1291
+ "name": "embedding_status",
1292
+ "type": "text",
1293
+ "primaryKey": false,
1294
+ "notNull": false,
1295
+ "autoincrement": false
1296
+ },
1297
+ "embedding_error": {
1298
+ "name": "embedding_error",
1299
+ "type": "text",
1300
+ "primaryKey": false,
1301
+ "notNull": false,
1302
+ "autoincrement": false
1303
+ },
1304
+ "is_active": {
1305
+ "name": "is_active",
1306
+ "type": "integer",
1307
+ "primaryKey": false,
1308
+ "notNull": false,
1309
+ "autoincrement": false,
1310
+ "default": true
1311
+ },
1312
+ "created_at": {
1313
+ "name": "created_at",
1314
+ "type": "integer",
1315
+ "primaryKey": false,
1316
+ "notNull": false,
1317
+ "autoincrement": false
1318
+ },
1319
+ "updated_at": {
1320
+ "name": "updated_at",
1321
+ "type": "integer",
1322
+ "primaryKey": false,
1323
+ "notNull": false,
1324
+ "autoincrement": false
1325
+ }
1326
+ },
1327
+ "indexes": {
1328
+ "idx_kb_entries_tenant_created": {
1329
+ "name": "idx_kb_entries_tenant_created",
1330
+ "columns": [
1331
+ "tenant_id",
1332
+ "created_at",
1333
+ "id"
1334
+ ],
1335
+ "isUnique": false
1336
+ }
1337
+ },
1338
+ "foreignKeys": {
1339
+ "kb_entries_tenant_id_tenants_id_fk": {
1340
+ "name": "kb_entries_tenant_id_tenants_id_fk",
1341
+ "tableFrom": "kb_entries",
1342
+ "tableTo": "tenants",
1343
+ "columnsFrom": [
1344
+ "tenant_id"
1345
+ ],
1346
+ "columnsTo": [
1347
+ "id"
1348
+ ],
1349
+ "onDelete": "no action",
1350
+ "onUpdate": "no action"
1351
+ }
1352
+ },
1353
+ "compositePrimaryKeys": {},
1354
+ "uniqueConstraints": {},
1355
+ "checkConstraints": {}
1356
+ },
1357
+ "lifecycle_messages": {
1358
+ "name": "lifecycle_messages",
1359
+ "columns": {
1360
+ "id": {
1361
+ "name": "id",
1362
+ "type": "text",
1363
+ "primaryKey": true,
1364
+ "notNull": true,
1365
+ "autoincrement": false
1366
+ },
1367
+ "tenant_id": {
1368
+ "name": "tenant_id",
1369
+ "type": "text",
1370
+ "primaryKey": false,
1371
+ "notNull": true,
1372
+ "autoincrement": false
1373
+ },
1374
+ "contact_id": {
1375
+ "name": "contact_id",
1376
+ "type": "text",
1377
+ "primaryKey": false,
1378
+ "notNull": true,
1379
+ "autoincrement": false
1380
+ },
1381
+ "flow_id": {
1382
+ "name": "flow_id",
1383
+ "type": "text",
1384
+ "primaryKey": false,
1385
+ "notNull": true,
1386
+ "autoincrement": false
1387
+ },
1388
+ "membership_id": {
1389
+ "name": "membership_id",
1390
+ "type": "text",
1391
+ "primaryKey": false,
1392
+ "notNull": true,
1393
+ "autoincrement": false
1394
+ },
1395
+ "flow_step_order": {
1396
+ "name": "flow_step_order",
1397
+ "type": "integer",
1398
+ "primaryKey": false,
1399
+ "notNull": false,
1400
+ "autoincrement": false
1401
+ },
1402
+ "status": {
1403
+ "name": "status",
1404
+ "type": "text",
1405
+ "primaryKey": false,
1406
+ "notNull": true,
1407
+ "autoincrement": false
1408
+ },
1409
+ "feedback": {
1410
+ "name": "feedback",
1411
+ "type": "text",
1412
+ "primaryKey": false,
1413
+ "notNull": false,
1414
+ "autoincrement": false
1415
+ },
1416
+ "subject": {
1417
+ "name": "subject",
1418
+ "type": "text",
1419
+ "primaryKey": false,
1420
+ "notNull": false,
1421
+ "autoincrement": false
1422
+ },
1423
+ "body_html": {
1424
+ "name": "body_html",
1425
+ "type": "text",
1426
+ "primaryKey": false,
1427
+ "notNull": false,
1428
+ "autoincrement": false
1429
+ },
1430
+ "body_text": {
1431
+ "name": "body_text",
1432
+ "type": "text",
1433
+ "primaryKey": false,
1434
+ "notNull": false,
1435
+ "autoincrement": false
1436
+ },
1437
+ "brain_reasoning": {
1438
+ "name": "brain_reasoning",
1439
+ "type": "text",
1440
+ "primaryKey": false,
1441
+ "notNull": false,
1442
+ "autoincrement": false
1443
+ },
1444
+ "brain_action_type": {
1445
+ "name": "brain_action_type",
1446
+ "type": "text",
1447
+ "primaryKey": false,
1448
+ "notNull": false,
1449
+ "autoincrement": false
1450
+ },
1451
+ "scheduled_send_at": {
1452
+ "name": "scheduled_send_at",
1453
+ "type": "integer",
1454
+ "primaryKey": false,
1455
+ "notNull": false,
1456
+ "autoincrement": false
1457
+ },
1458
+ "approved_at": {
1459
+ "name": "approved_at",
1460
+ "type": "integer",
1461
+ "primaryKey": false,
1462
+ "notNull": false,
1463
+ "autoincrement": false
1464
+ },
1465
+ "sent_at": {
1466
+ "name": "sent_at",
1467
+ "type": "integer",
1468
+ "primaryKey": false,
1469
+ "notNull": false,
1470
+ "autoincrement": false
1471
+ },
1472
+ "retry_count": {
1473
+ "name": "retry_count",
1474
+ "type": "integer",
1475
+ "primaryKey": false,
1476
+ "notNull": false,
1477
+ "autoincrement": false,
1478
+ "default": 0
1479
+ },
1480
+ "provider_message_id": {
1481
+ "name": "provider_message_id",
1482
+ "type": "text",
1483
+ "primaryKey": false,
1484
+ "notNull": false,
1485
+ "autoincrement": false
1486
+ },
1487
+ "recipient_address": {
1488
+ "name": "recipient_address",
1489
+ "type": "text",
1490
+ "primaryKey": false,
1491
+ "notNull": false,
1492
+ "autoincrement": false
1493
+ },
1494
+ "topic_id": {
1495
+ "name": "topic_id",
1496
+ "type": "text",
1497
+ "primaryKey": false,
1498
+ "notNull": false,
1499
+ "autoincrement": false
1500
+ },
1501
+ "transport_id": {
1502
+ "name": "transport_id",
1503
+ "type": "text",
1504
+ "primaryKey": false,
1505
+ "notNull": false,
1506
+ "autoincrement": false
1507
+ },
1508
+ "status_reason": {
1509
+ "name": "status_reason",
1510
+ "type": "text",
1511
+ "primaryKey": false,
1512
+ "notNull": false,
1513
+ "autoincrement": false
1514
+ },
1515
+ "created_at": {
1516
+ "name": "created_at",
1517
+ "type": "integer",
1518
+ "primaryKey": false,
1519
+ "notNull": false,
1520
+ "autoincrement": false
1521
+ },
1522
+ "updated_at": {
1523
+ "name": "updated_at",
1524
+ "type": "integer",
1525
+ "primaryKey": false,
1526
+ "notNull": false,
1527
+ "autoincrement": false
1528
+ }
1529
+ },
1530
+ "indexes": {
1531
+ "idx_messages_drain": {
1532
+ "name": "idx_messages_drain",
1533
+ "columns": [
1534
+ "tenant_id",
1535
+ "status",
1536
+ "scheduled_send_at"
1537
+ ],
1538
+ "isUnique": false,
1539
+ "where": "status IN ('approved', 'sending')"
1540
+ },
1541
+ "idx_messages_contact": {
1542
+ "name": "idx_messages_contact",
1543
+ "columns": [
1544
+ "contact_id",
1545
+ "status",
1546
+ "created_at"
1547
+ ],
1548
+ "isUnique": false
1549
+ },
1550
+ "idx_messages_contact_sent": {
1551
+ "name": "idx_messages_contact_sent",
1552
+ "columns": [
1553
+ "contact_id",
1554
+ "sent_at"
1555
+ ],
1556
+ "isUnique": false,
1557
+ "where": "status IN ('sending', 'sent')"
1558
+ },
1559
+ "uq_messages_membership_step": {
1560
+ "name": "uq_messages_membership_step",
1561
+ "columns": [
1562
+ "membership_id",
1563
+ "flow_step_order"
1564
+ ],
1565
+ "isUnique": true
1566
+ },
1567
+ "idx_messages_generation": {
1568
+ "name": "idx_messages_generation",
1569
+ "columns": [
1570
+ "tenant_id",
1571
+ "status",
1572
+ "created_at"
1573
+ ],
1574
+ "isUnique": false,
1575
+ "where": "status IN ('pending_generation', 'generating')"
1576
+ },
1577
+ "idx_messages_provider_id": {
1578
+ "name": "idx_messages_provider_id",
1579
+ "columns": [
1580
+ "provider_message_id"
1581
+ ],
1582
+ "isUnique": false,
1583
+ "where": "provider_message_id IS NOT NULL"
1584
+ },
1585
+ "idx_messages_tenant_sent": {
1586
+ "name": "idx_messages_tenant_sent",
1587
+ "columns": [
1588
+ "tenant_id",
1589
+ "sent_at"
1590
+ ],
1591
+ "isUnique": false,
1592
+ "where": "sent_at IS NOT NULL"
1593
+ }
1594
+ },
1595
+ "foreignKeys": {
1596
+ "lifecycle_messages_tenant_id_tenants_id_fk": {
1597
+ "name": "lifecycle_messages_tenant_id_tenants_id_fk",
1598
+ "tableFrom": "lifecycle_messages",
1599
+ "tableTo": "tenants",
1600
+ "columnsFrom": [
1601
+ "tenant_id"
1602
+ ],
1603
+ "columnsTo": [
1604
+ "id"
1605
+ ],
1606
+ "onDelete": "no action",
1607
+ "onUpdate": "no action"
1608
+ },
1609
+ "lifecycle_messages_contact_id_contacts_id_fk": {
1610
+ "name": "lifecycle_messages_contact_id_contacts_id_fk",
1611
+ "tableFrom": "lifecycle_messages",
1612
+ "tableTo": "contacts",
1613
+ "columnsFrom": [
1614
+ "contact_id"
1615
+ ],
1616
+ "columnsTo": [
1617
+ "id"
1618
+ ],
1619
+ "onDelete": "no action",
1620
+ "onUpdate": "no action"
1621
+ },
1622
+ "lifecycle_messages_flow_id_flows_id_fk": {
1623
+ "name": "lifecycle_messages_flow_id_flows_id_fk",
1624
+ "tableFrom": "lifecycle_messages",
1625
+ "tableTo": "flows",
1626
+ "columnsFrom": [
1627
+ "flow_id"
1628
+ ],
1629
+ "columnsTo": [
1630
+ "id"
1631
+ ],
1632
+ "onDelete": "no action",
1633
+ "onUpdate": "no action"
1634
+ },
1635
+ "lifecycle_messages_membership_id_flow_memberships_id_fk": {
1636
+ "name": "lifecycle_messages_membership_id_flow_memberships_id_fk",
1637
+ "tableFrom": "lifecycle_messages",
1638
+ "tableTo": "flow_memberships",
1639
+ "columnsFrom": [
1640
+ "membership_id"
1641
+ ],
1642
+ "columnsTo": [
1643
+ "id"
1644
+ ],
1645
+ "onDelete": "no action",
1646
+ "onUpdate": "no action"
1647
+ }
1648
+ },
1649
+ "compositePrimaryKeys": {},
1650
+ "uniqueConstraints": {},
1651
+ "checkConstraints": {}
1652
+ },
1653
+ "lifecycle_transitions": {
1654
+ "name": "lifecycle_transitions",
1655
+ "columns": {
1656
+ "id": {
1657
+ "name": "id",
1658
+ "type": "text",
1659
+ "primaryKey": true,
1660
+ "notNull": true,
1661
+ "autoincrement": false
1662
+ },
1663
+ "tenant_id": {
1664
+ "name": "tenant_id",
1665
+ "type": "text",
1666
+ "primaryKey": false,
1667
+ "notNull": true,
1668
+ "autoincrement": false
1669
+ },
1670
+ "contact_id": {
1671
+ "name": "contact_id",
1672
+ "type": "text",
1673
+ "primaryKey": false,
1674
+ "notNull": true,
1675
+ "autoincrement": false
1676
+ },
1677
+ "from_state": {
1678
+ "name": "from_state",
1679
+ "type": "text",
1680
+ "primaryKey": false,
1681
+ "notNull": true,
1682
+ "autoincrement": false
1683
+ },
1684
+ "to_state": {
1685
+ "name": "to_state",
1686
+ "type": "text",
1687
+ "primaryKey": false,
1688
+ "notNull": true,
1689
+ "autoincrement": false
1690
+ },
1691
+ "trigger_event_id": {
1692
+ "name": "trigger_event_id",
1693
+ "type": "text",
1694
+ "primaryKey": false,
1695
+ "notNull": false,
1696
+ "autoincrement": false
1697
+ },
1698
+ "metadata": {
1699
+ "name": "metadata",
1700
+ "type": "text",
1701
+ "primaryKey": false,
1702
+ "notNull": false,
1703
+ "autoincrement": false
1704
+ },
1705
+ "transitioned_at": {
1706
+ "name": "transitioned_at",
1707
+ "type": "integer",
1708
+ "primaryKey": false,
1709
+ "notNull": true,
1710
+ "autoincrement": false
1711
+ }
1712
+ },
1713
+ "indexes": {
1714
+ "idx_transitions_contact": {
1715
+ "name": "idx_transitions_contact",
1716
+ "columns": [
1717
+ "contact_id",
1718
+ "transitioned_at"
1719
+ ],
1720
+ "isUnique": false
1721
+ },
1722
+ "idx_transitions_tenant_time": {
1723
+ "name": "idx_transitions_tenant_time",
1724
+ "columns": [
1725
+ "tenant_id",
1726
+ "transitioned_at"
1727
+ ],
1728
+ "isUnique": false
1729
+ }
1730
+ },
1731
+ "foreignKeys": {
1732
+ "lifecycle_transitions_tenant_id_tenants_id_fk": {
1733
+ "name": "lifecycle_transitions_tenant_id_tenants_id_fk",
1734
+ "tableFrom": "lifecycle_transitions",
1735
+ "tableTo": "tenants",
1736
+ "columnsFrom": [
1737
+ "tenant_id"
1738
+ ],
1739
+ "columnsTo": [
1740
+ "id"
1741
+ ],
1742
+ "onDelete": "no action",
1743
+ "onUpdate": "no action"
1744
+ },
1745
+ "lifecycle_transitions_contact_id_contacts_id_fk": {
1746
+ "name": "lifecycle_transitions_contact_id_contacts_id_fk",
1747
+ "tableFrom": "lifecycle_transitions",
1748
+ "tableTo": "contacts",
1749
+ "columnsFrom": [
1750
+ "contact_id"
1751
+ ],
1752
+ "columnsTo": [
1753
+ "id"
1754
+ ],
1755
+ "onDelete": "no action",
1756
+ "onUpdate": "no action"
1757
+ }
1758
+ },
1759
+ "compositePrimaryKeys": {},
1760
+ "uniqueConstraints": {},
1761
+ "checkConstraints": {}
1762
+ },
1763
+ "llm_configs": {
1764
+ "name": "llm_configs",
1765
+ "columns": {
1766
+ "id": {
1767
+ "name": "id",
1768
+ "type": "text",
1769
+ "primaryKey": true,
1770
+ "notNull": true,
1771
+ "autoincrement": false
1772
+ },
1773
+ "tenant_id": {
1774
+ "name": "tenant_id",
1775
+ "type": "text",
1776
+ "primaryKey": false,
1777
+ "notNull": true,
1778
+ "autoincrement": false
1779
+ },
1780
+ "provider": {
1781
+ "name": "provider",
1782
+ "type": "text",
1783
+ "primaryKey": false,
1784
+ "notNull": true,
1785
+ "autoincrement": false
1786
+ },
1787
+ "config": {
1788
+ "name": "config",
1789
+ "type": "text",
1790
+ "primaryKey": false,
1791
+ "notNull": true,
1792
+ "autoincrement": false
1793
+ },
1794
+ "is_active": {
1795
+ "name": "is_active",
1796
+ "type": "integer",
1797
+ "primaryKey": false,
1798
+ "notNull": false,
1799
+ "autoincrement": false,
1800
+ "default": true
1801
+ },
1802
+ "created_at": {
1803
+ "name": "created_at",
1804
+ "type": "integer",
1805
+ "primaryKey": false,
1806
+ "notNull": false,
1807
+ "autoincrement": false
1808
+ }
1809
+ },
1810
+ "indexes": {},
1811
+ "foreignKeys": {
1812
+ "llm_configs_tenant_id_tenants_id_fk": {
1813
+ "name": "llm_configs_tenant_id_tenants_id_fk",
1814
+ "tableFrom": "llm_configs",
1815
+ "tableTo": "tenants",
1816
+ "columnsFrom": [
1817
+ "tenant_id"
1818
+ ],
1819
+ "columnsTo": [
1820
+ "id"
1821
+ ],
1822
+ "onDelete": "no action",
1823
+ "onUpdate": "no action"
1824
+ }
1825
+ },
1826
+ "compositePrimaryKeys": {},
1827
+ "uniqueConstraints": {},
1828
+ "checkConstraints": {}
1829
+ },
1830
+ "magic_link_tokens": {
1831
+ "name": "magic_link_tokens",
1832
+ "columns": {
1833
+ "id": {
1834
+ "name": "id",
1835
+ "type": "text",
1836
+ "primaryKey": true,
1837
+ "notNull": true,
1838
+ "autoincrement": false
1839
+ },
1840
+ "tenant_id": {
1841
+ "name": "tenant_id",
1842
+ "type": "text",
1843
+ "primaryKey": false,
1844
+ "notNull": true,
1845
+ "autoincrement": false
1846
+ },
1847
+ "user_id": {
1848
+ "name": "user_id",
1849
+ "type": "text",
1850
+ "primaryKey": false,
1851
+ "notNull": true,
1852
+ "autoincrement": false
1853
+ },
1854
+ "token_hash": {
1855
+ "name": "token_hash",
1856
+ "type": "text",
1857
+ "primaryKey": false,
1858
+ "notNull": true,
1859
+ "autoincrement": false
1860
+ },
1861
+ "expires_at": {
1862
+ "name": "expires_at",
1863
+ "type": "integer",
1864
+ "primaryKey": false,
1865
+ "notNull": true,
1866
+ "autoincrement": false
1867
+ },
1868
+ "consumed_at": {
1869
+ "name": "consumed_at",
1870
+ "type": "integer",
1871
+ "primaryKey": false,
1872
+ "notNull": false,
1873
+ "autoincrement": false
1874
+ },
1875
+ "created_at": {
1876
+ "name": "created_at",
1877
+ "type": "integer",
1878
+ "primaryKey": false,
1879
+ "notNull": false,
1880
+ "autoincrement": false
1881
+ }
1882
+ },
1883
+ "indexes": {
1884
+ "idx_magic_link_tokens_hash": {
1885
+ "name": "idx_magic_link_tokens_hash",
1886
+ "columns": [
1887
+ "token_hash"
1888
+ ],
1889
+ "isUnique": false
1890
+ }
1891
+ },
1892
+ "foreignKeys": {
1893
+ "magic_link_tokens_tenant_id_tenants_id_fk": {
1894
+ "name": "magic_link_tokens_tenant_id_tenants_id_fk",
1895
+ "tableFrom": "magic_link_tokens",
1896
+ "tableTo": "tenants",
1897
+ "columnsFrom": [
1898
+ "tenant_id"
1899
+ ],
1900
+ "columnsTo": [
1901
+ "id"
1902
+ ],
1903
+ "onDelete": "no action",
1904
+ "onUpdate": "no action"
1905
+ },
1906
+ "magic_link_tokens_user_id_users_id_fk": {
1907
+ "name": "magic_link_tokens_user_id_users_id_fk",
1908
+ "tableFrom": "magic_link_tokens",
1909
+ "tableTo": "users",
1910
+ "columnsFrom": [
1911
+ "user_id"
1912
+ ],
1913
+ "columnsTo": [
1914
+ "id"
1915
+ ],
1916
+ "onDelete": "cascade",
1917
+ "onUpdate": "no action"
1918
+ }
1919
+ },
1920
+ "compositePrimaryKeys": {},
1921
+ "uniqueConstraints": {},
1922
+ "checkConstraints": {}
1923
+ },
1924
+ "memberships": {
1925
+ "name": "memberships",
1926
+ "columns": {
1927
+ "user_id": {
1928
+ "name": "user_id",
1929
+ "type": "text",
1930
+ "primaryKey": false,
1931
+ "notNull": true,
1932
+ "autoincrement": false
1933
+ },
1934
+ "tenant_id": {
1935
+ "name": "tenant_id",
1936
+ "type": "text",
1937
+ "primaryKey": false,
1938
+ "notNull": true,
1939
+ "autoincrement": false
1940
+ },
1941
+ "role": {
1942
+ "name": "role",
1943
+ "type": "text",
1944
+ "primaryKey": false,
1945
+ "notNull": true,
1946
+ "autoincrement": false
1947
+ },
1948
+ "created_at": {
1949
+ "name": "created_at",
1950
+ "type": "integer",
1951
+ "primaryKey": false,
1952
+ "notNull": false,
1953
+ "autoincrement": false
1954
+ }
1955
+ },
1956
+ "indexes": {
1957
+ "idx_memberships_tenant": {
1958
+ "name": "idx_memberships_tenant",
1959
+ "columns": [
1960
+ "tenant_id"
1961
+ ],
1962
+ "isUnique": false
1963
+ }
1964
+ },
1965
+ "foreignKeys": {
1966
+ "memberships_user_id_users_id_fk": {
1967
+ "name": "memberships_user_id_users_id_fk",
1968
+ "tableFrom": "memberships",
1969
+ "tableTo": "users",
1970
+ "columnsFrom": [
1971
+ "user_id"
1972
+ ],
1973
+ "columnsTo": [
1974
+ "id"
1975
+ ],
1976
+ "onDelete": "cascade",
1977
+ "onUpdate": "no action"
1978
+ },
1979
+ "memberships_tenant_id_tenants_id_fk": {
1980
+ "name": "memberships_tenant_id_tenants_id_fk",
1981
+ "tableFrom": "memberships",
1982
+ "tableTo": "tenants",
1983
+ "columnsFrom": [
1984
+ "tenant_id"
1985
+ ],
1986
+ "columnsTo": [
1987
+ "id"
1988
+ ],
1989
+ "onDelete": "no action",
1990
+ "onUpdate": "no action"
1991
+ }
1992
+ },
1993
+ "compositePrimaryKeys": {
1994
+ "memberships_pkey": {
1995
+ "columns": [
1996
+ "user_id",
1997
+ "tenant_id"
1998
+ ],
1999
+ "name": "memberships_pkey"
2000
+ }
2001
+ },
2002
+ "uniqueConstraints": {},
2003
+ "checkConstraints": {}
2004
+ },
2005
+ "message_events": {
2006
+ "name": "message_events",
2007
+ "columns": {
2008
+ "id": {
2009
+ "name": "id",
2010
+ "type": "text",
2011
+ "primaryKey": true,
2012
+ "notNull": true,
2013
+ "autoincrement": false
2014
+ },
2015
+ "tenant_id": {
2016
+ "name": "tenant_id",
2017
+ "type": "text",
2018
+ "primaryKey": false,
2019
+ "notNull": true,
2020
+ "autoincrement": false
2021
+ },
2022
+ "message_id": {
2023
+ "name": "message_id",
2024
+ "type": "text",
2025
+ "primaryKey": false,
2026
+ "notNull": true,
2027
+ "autoincrement": false
2028
+ },
2029
+ "event_type": {
2030
+ "name": "event_type",
2031
+ "type": "text",
2032
+ "primaryKey": false,
2033
+ "notNull": true,
2034
+ "autoincrement": false
2035
+ },
2036
+ "occurred_at": {
2037
+ "name": "occurred_at",
2038
+ "type": "integer",
2039
+ "primaryKey": false,
2040
+ "notNull": true,
2041
+ "autoincrement": false
2042
+ },
2043
+ "provider_event_id": {
2044
+ "name": "provider_event_id",
2045
+ "type": "text",
2046
+ "primaryKey": false,
2047
+ "notNull": false,
2048
+ "autoincrement": false
2049
+ },
2050
+ "metadata": {
2051
+ "name": "metadata",
2052
+ "type": "text",
2053
+ "primaryKey": false,
2054
+ "notNull": false,
2055
+ "autoincrement": false
2056
+ },
2057
+ "created_at": {
2058
+ "name": "created_at",
2059
+ "type": "integer",
2060
+ "primaryKey": false,
2061
+ "notNull": false,
2062
+ "autoincrement": false
2063
+ }
2064
+ },
2065
+ "indexes": {
2066
+ "idx_message_events_message": {
2067
+ "name": "idx_message_events_message",
2068
+ "columns": [
2069
+ "message_id",
2070
+ "occurred_at"
2071
+ ],
2072
+ "isUnique": false
2073
+ },
2074
+ "idx_message_events_tenant_type_day": {
2075
+ "name": "idx_message_events_tenant_type_day",
2076
+ "columns": [
2077
+ "tenant_id",
2078
+ "event_type",
2079
+ "occurred_at"
2080
+ ],
2081
+ "isUnique": false
2082
+ },
2083
+ "uq_message_events_provider_dedup": {
2084
+ "name": "uq_message_events_provider_dedup",
2085
+ "columns": [
2086
+ "tenant_id",
2087
+ "provider_event_id"
2088
+ ],
2089
+ "isUnique": true,
2090
+ "where": "provider_event_id IS NOT NULL"
2091
+ }
2092
+ },
2093
+ "foreignKeys": {
2094
+ "message_events_tenant_id_tenants_id_fk": {
2095
+ "name": "message_events_tenant_id_tenants_id_fk",
2096
+ "tableFrom": "message_events",
2097
+ "tableTo": "tenants",
2098
+ "columnsFrom": [
2099
+ "tenant_id"
2100
+ ],
2101
+ "columnsTo": [
2102
+ "id"
2103
+ ],
2104
+ "onDelete": "no action",
2105
+ "onUpdate": "no action"
2106
+ },
2107
+ "message_events_message_id_lifecycle_messages_id_fk": {
2108
+ "name": "message_events_message_id_lifecycle_messages_id_fk",
2109
+ "tableFrom": "message_events",
2110
+ "tableTo": "lifecycle_messages",
2111
+ "columnsFrom": [
2112
+ "message_id"
2113
+ ],
2114
+ "columnsTo": [
2115
+ "id"
2116
+ ],
2117
+ "onDelete": "no action",
2118
+ "onUpdate": "no action"
2119
+ }
2120
+ },
2121
+ "compositePrimaryKeys": {},
2122
+ "uniqueConstraints": {},
2123
+ "checkConstraints": {}
2124
+ },
2125
+ "ops_alerts": {
2126
+ "name": "ops_alerts",
2127
+ "columns": {
2128
+ "fingerprint": {
2129
+ "name": "fingerprint",
2130
+ "type": "text",
2131
+ "primaryKey": true,
2132
+ "notNull": true,
2133
+ "autoincrement": false
2134
+ },
2135
+ "kind": {
2136
+ "name": "kind",
2137
+ "type": "text",
2138
+ "primaryKey": false,
2139
+ "notNull": true,
2140
+ "autoincrement": false
2141
+ },
2142
+ "tenant_id": {
2143
+ "name": "tenant_id",
2144
+ "type": "text",
2145
+ "primaryKey": false,
2146
+ "notNull": false,
2147
+ "autoincrement": false
2148
+ },
2149
+ "severity": {
2150
+ "name": "severity",
2151
+ "type": "text",
2152
+ "primaryKey": false,
2153
+ "notNull": true,
2154
+ "autoincrement": false
2155
+ },
2156
+ "message": {
2157
+ "name": "message",
2158
+ "type": "text",
2159
+ "primaryKey": false,
2160
+ "notNull": true,
2161
+ "autoincrement": false
2162
+ },
2163
+ "first_at": {
2164
+ "name": "first_at",
2165
+ "type": "integer",
2166
+ "primaryKey": false,
2167
+ "notNull": true,
2168
+ "autoincrement": false
2169
+ },
2170
+ "last_at": {
2171
+ "name": "last_at",
2172
+ "type": "integer",
2173
+ "primaryKey": false,
2174
+ "notNull": true,
2175
+ "autoincrement": false
2176
+ },
2177
+ "count": {
2178
+ "name": "count",
2179
+ "type": "integer",
2180
+ "primaryKey": false,
2181
+ "notNull": true,
2182
+ "autoincrement": false,
2183
+ "default": 1
2184
+ },
2185
+ "last_notified_at": {
2186
+ "name": "last_notified_at",
2187
+ "type": "integer",
2188
+ "primaryKey": false,
2189
+ "notNull": false,
2190
+ "autoincrement": false
2191
+ },
2192
+ "notified_count": {
2193
+ "name": "notified_count",
2194
+ "type": "integer",
2195
+ "primaryKey": false,
2196
+ "notNull": true,
2197
+ "autoincrement": false,
2198
+ "default": 0
2199
+ },
2200
+ "status": {
2201
+ "name": "status",
2202
+ "type": "text",
2203
+ "primaryKey": false,
2204
+ "notNull": true,
2205
+ "autoincrement": false,
2206
+ "default": "'open'"
2207
+ },
2208
+ "muted_until": {
2209
+ "name": "muted_until",
2210
+ "type": "integer",
2211
+ "primaryKey": false,
2212
+ "notNull": false,
2213
+ "autoincrement": false
2214
+ }
2215
+ },
2216
+ "indexes": {},
2217
+ "foreignKeys": {},
2218
+ "compositePrimaryKeys": {},
2219
+ "uniqueConstraints": {},
2220
+ "checkConstraints": {}
2221
+ },
2222
+ "ops_events": {
2223
+ "name": "ops_events",
2224
+ "columns": {
2225
+ "id": {
2226
+ "name": "id",
2227
+ "type": "text",
2228
+ "primaryKey": true,
2229
+ "notNull": true,
2230
+ "autoincrement": false
2231
+ },
2232
+ "at": {
2233
+ "name": "at",
2234
+ "type": "integer",
2235
+ "primaryKey": false,
2236
+ "notNull": true,
2237
+ "autoincrement": false
2238
+ },
2239
+ "tenant_id": {
2240
+ "name": "tenant_id",
2241
+ "type": "text",
2242
+ "primaryKey": false,
2243
+ "notNull": false,
2244
+ "autoincrement": false
2245
+ },
2246
+ "kind": {
2247
+ "name": "kind",
2248
+ "type": "text",
2249
+ "primaryKey": false,
2250
+ "notNull": true,
2251
+ "autoincrement": false
2252
+ },
2253
+ "severity": {
2254
+ "name": "severity",
2255
+ "type": "text",
2256
+ "primaryKey": false,
2257
+ "notNull": true,
2258
+ "autoincrement": false
2259
+ },
2260
+ "fingerprint": {
2261
+ "name": "fingerprint",
2262
+ "type": "text",
2263
+ "primaryKey": false,
2264
+ "notNull": true,
2265
+ "autoincrement": false
2266
+ },
2267
+ "message": {
2268
+ "name": "message",
2269
+ "type": "text",
2270
+ "primaryKey": false,
2271
+ "notNull": true,
2272
+ "autoincrement": false
2273
+ },
2274
+ "context": {
2275
+ "name": "context",
2276
+ "type": "text",
2277
+ "primaryKey": false,
2278
+ "notNull": false,
2279
+ "autoincrement": false
2280
+ }
2281
+ },
2282
+ "indexes": {
2283
+ "idx_ops_events_fingerprint_at": {
2284
+ "name": "idx_ops_events_fingerprint_at",
2285
+ "columns": [
2286
+ "fingerprint",
2287
+ "at"
2288
+ ],
2289
+ "isUnique": false
2290
+ },
2291
+ "idx_ops_events_at": {
2292
+ "name": "idx_ops_events_at",
2293
+ "columns": [
2294
+ "at"
2295
+ ],
2296
+ "isUnique": false
2297
+ }
2298
+ },
2299
+ "foreignKeys": {},
2300
+ "compositePrimaryKeys": {},
2301
+ "uniqueConstraints": {},
2302
+ "checkConstraints": {}
2303
+ },
2304
+ "retention_grid_snapshots": {
2305
+ "name": "retention_grid_snapshots",
2306
+ "columns": {
2307
+ "tenant_id": {
2308
+ "name": "tenant_id",
2309
+ "type": "text",
2310
+ "primaryKey": false,
2311
+ "notNull": true,
2312
+ "autoincrement": false
2313
+ },
2314
+ "snapshot_date": {
2315
+ "name": "snapshot_date",
2316
+ "type": "text",
2317
+ "primaryKey": false,
2318
+ "notNull": true,
2319
+ "autoincrement": false
2320
+ },
2321
+ "tenure_bucket": {
2322
+ "name": "tenure_bucket",
2323
+ "type": "text",
2324
+ "primaryKey": false,
2325
+ "notNull": true,
2326
+ "autoincrement": false
2327
+ },
2328
+ "recency_bucket": {
2329
+ "name": "recency_bucket",
2330
+ "type": "text",
2331
+ "primaryKey": false,
2332
+ "notNull": true,
2333
+ "autoincrement": false
2334
+ },
2335
+ "contact_count": {
2336
+ "name": "contact_count",
2337
+ "type": "integer",
2338
+ "primaryKey": false,
2339
+ "notNull": true,
2340
+ "autoincrement": false
2341
+ },
2342
+ "paying_count": {
2343
+ "name": "paying_count",
2344
+ "type": "integer",
2345
+ "primaryKey": false,
2346
+ "notNull": true,
2347
+ "autoincrement": false
2348
+ }
2349
+ },
2350
+ "indexes": {},
2351
+ "foreignKeys": {
2352
+ "retention_grid_snapshots_tenant_id_tenants_id_fk": {
2353
+ "name": "retention_grid_snapshots_tenant_id_tenants_id_fk",
2354
+ "tableFrom": "retention_grid_snapshots",
2355
+ "tableTo": "tenants",
2356
+ "columnsFrom": [
2357
+ "tenant_id"
2358
+ ],
2359
+ "columnsTo": [
2360
+ "id"
2361
+ ],
2362
+ "onDelete": "no action",
2363
+ "onUpdate": "no action"
2364
+ }
2365
+ },
2366
+ "compositePrimaryKeys": {
2367
+ "retention_grid_snapshots_tenant_id_snapshot_date_tenure_bucket_recency_bucket_pk": {
2368
+ "columns": [
2369
+ "tenant_id",
2370
+ "snapshot_date",
2371
+ "tenure_bucket",
2372
+ "recency_bucket"
2373
+ ],
2374
+ "name": "retention_grid_snapshots_tenant_id_snapshot_date_tenure_bucket_recency_bucket_pk"
2375
+ }
2376
+ },
2377
+ "uniqueConstraints": {},
2378
+ "checkConstraints": {}
2379
+ },
2380
+ "scan_checkpoints": {
2381
+ "name": "scan_checkpoints",
2382
+ "columns": {
2383
+ "scan_phase": {
2384
+ "name": "scan_phase",
2385
+ "type": "text",
2386
+ "primaryKey": false,
2387
+ "notNull": true,
2388
+ "autoincrement": false
2389
+ },
2390
+ "tenant_id": {
2391
+ "name": "tenant_id",
2392
+ "type": "text",
2393
+ "primaryKey": false,
2394
+ "notNull": true,
2395
+ "autoincrement": false
2396
+ },
2397
+ "last_id": {
2398
+ "name": "last_id",
2399
+ "type": "text",
2400
+ "primaryKey": false,
2401
+ "notNull": true,
2402
+ "autoincrement": false
2403
+ },
2404
+ "started_at": {
2405
+ "name": "started_at",
2406
+ "type": "integer",
2407
+ "primaryKey": false,
2408
+ "notNull": true,
2409
+ "autoincrement": false
2410
+ },
2411
+ "discard_count": {
2412
+ "name": "discard_count",
2413
+ "type": "integer",
2414
+ "primaryKey": false,
2415
+ "notNull": true,
2416
+ "autoincrement": false,
2417
+ "default": 0
2418
+ }
2419
+ },
2420
+ "indexes": {},
2421
+ "foreignKeys": {
2422
+ "scan_checkpoints_tenant_id_tenants_id_fk": {
2423
+ "name": "scan_checkpoints_tenant_id_tenants_id_fk",
2424
+ "tableFrom": "scan_checkpoints",
2425
+ "tableTo": "tenants",
2426
+ "columnsFrom": [
2427
+ "tenant_id"
2428
+ ],
2429
+ "columnsTo": [
2430
+ "id"
2431
+ ],
2432
+ "onDelete": "no action",
2433
+ "onUpdate": "no action"
2434
+ }
2435
+ },
2436
+ "compositePrimaryKeys": {
2437
+ "scan_checkpoints_scan_phase_tenant_id_pk": {
2438
+ "columns": [
2439
+ "scan_phase",
2440
+ "tenant_id"
2441
+ ],
2442
+ "name": "scan_checkpoints_scan_phase_tenant_id_pk"
2443
+ }
2444
+ },
2445
+ "uniqueConstraints": {},
2446
+ "checkConstraints": {}
2447
+ },
2448
+ "sessions": {
2449
+ "name": "sessions",
2450
+ "columns": {
2451
+ "id": {
2452
+ "name": "id",
2453
+ "type": "text",
2454
+ "primaryKey": true,
2455
+ "notNull": true,
2456
+ "autoincrement": false
2457
+ },
2458
+ "tenant_id": {
2459
+ "name": "tenant_id",
2460
+ "type": "text",
2461
+ "primaryKey": false,
2462
+ "notNull": true,
2463
+ "autoincrement": false
2464
+ },
2465
+ "user_id": {
2466
+ "name": "user_id",
2467
+ "type": "text",
2468
+ "primaryKey": false,
2469
+ "notNull": true,
2470
+ "autoincrement": false
2471
+ },
2472
+ "expires_at": {
2473
+ "name": "expires_at",
2474
+ "type": "integer",
2475
+ "primaryKey": false,
2476
+ "notNull": true,
2477
+ "autoincrement": false
2478
+ },
2479
+ "created_at": {
2480
+ "name": "created_at",
2481
+ "type": "integer",
2482
+ "primaryKey": false,
2483
+ "notNull": false,
2484
+ "autoincrement": false
2485
+ }
2486
+ },
2487
+ "indexes": {},
2488
+ "foreignKeys": {
2489
+ "sessions_tenant_id_tenants_id_fk": {
2490
+ "name": "sessions_tenant_id_tenants_id_fk",
2491
+ "tableFrom": "sessions",
2492
+ "tableTo": "tenants",
2493
+ "columnsFrom": [
2494
+ "tenant_id"
2495
+ ],
2496
+ "columnsTo": [
2497
+ "id"
2498
+ ],
2499
+ "onDelete": "no action",
2500
+ "onUpdate": "no action"
2501
+ },
2502
+ "sessions_user_id_users_id_fk": {
2503
+ "name": "sessions_user_id_users_id_fk",
2504
+ "tableFrom": "sessions",
2505
+ "tableTo": "users",
2506
+ "columnsFrom": [
2507
+ "user_id"
2508
+ ],
2509
+ "columnsTo": [
2510
+ "id"
2511
+ ],
2512
+ "onDelete": "cascade",
2513
+ "onUpdate": "no action"
2514
+ }
2515
+ },
2516
+ "compositePrimaryKeys": {},
2517
+ "uniqueConstraints": {},
2518
+ "checkConstraints": {}
2519
+ },
2520
+ "suppressions": {
2521
+ "name": "suppressions",
2522
+ "columns": {
2523
+ "id": {
2524
+ "name": "id",
2525
+ "type": "text",
2526
+ "primaryKey": true,
2527
+ "notNull": true,
2528
+ "autoincrement": false
2529
+ },
2530
+ "tenant_id": {
2531
+ "name": "tenant_id",
2532
+ "type": "text",
2533
+ "primaryKey": false,
2534
+ "notNull": true,
2535
+ "autoincrement": false
2536
+ },
2537
+ "email": {
2538
+ "name": "email",
2539
+ "type": "text",
2540
+ "primaryKey": false,
2541
+ "notNull": true,
2542
+ "autoincrement": false
2543
+ },
2544
+ "reason": {
2545
+ "name": "reason",
2546
+ "type": "text",
2547
+ "primaryKey": false,
2548
+ "notNull": true,
2549
+ "autoincrement": false
2550
+ },
2551
+ "source": {
2552
+ "name": "source",
2553
+ "type": "text",
2554
+ "primaryKey": false,
2555
+ "notNull": false,
2556
+ "autoincrement": false
2557
+ },
2558
+ "created_at": {
2559
+ "name": "created_at",
2560
+ "type": "integer",
2561
+ "primaryKey": false,
2562
+ "notNull": false,
2563
+ "autoincrement": false
2564
+ }
2565
+ },
2566
+ "indexes": {},
2567
+ "foreignKeys": {
2568
+ "suppressions_tenant_id_tenants_id_fk": {
2569
+ "name": "suppressions_tenant_id_tenants_id_fk",
2570
+ "tableFrom": "suppressions",
2571
+ "tableTo": "tenants",
2572
+ "columnsFrom": [
2573
+ "tenant_id"
2574
+ ],
2575
+ "columnsTo": [
2576
+ "id"
2577
+ ],
2578
+ "onDelete": "no action",
2579
+ "onUpdate": "no action"
2580
+ }
2581
+ },
2582
+ "compositePrimaryKeys": {},
2583
+ "uniqueConstraints": {},
2584
+ "checkConstraints": {}
2585
+ },
2586
+ "templates": {
2587
+ "name": "templates",
2588
+ "columns": {
2589
+ "id": {
2590
+ "name": "id",
2591
+ "type": "text",
2592
+ "primaryKey": true,
2593
+ "notNull": true,
2594
+ "autoincrement": false
2595
+ },
2596
+ "tenant_id": {
2597
+ "name": "tenant_id",
2598
+ "type": "text",
2599
+ "primaryKey": false,
2600
+ "notNull": true,
2601
+ "autoincrement": false
2602
+ },
2603
+ "name": {
2604
+ "name": "name",
2605
+ "type": "text",
2606
+ "primaryKey": false,
2607
+ "notNull": true,
2608
+ "autoincrement": false
2609
+ },
2610
+ "slug": {
2611
+ "name": "slug",
2612
+ "type": "text",
2613
+ "primaryKey": false,
2614
+ "notNull": true,
2615
+ "autoincrement": false
2616
+ },
2617
+ "subject": {
2618
+ "name": "subject",
2619
+ "type": "text",
2620
+ "primaryKey": false,
2621
+ "notNull": true,
2622
+ "autoincrement": false
2623
+ },
2624
+ "body_html": {
2625
+ "name": "body_html",
2626
+ "type": "text",
2627
+ "primaryKey": false,
2628
+ "notNull": true,
2629
+ "autoincrement": false
2630
+ },
2631
+ "body_text": {
2632
+ "name": "body_text",
2633
+ "type": "text",
2634
+ "primaryKey": false,
2635
+ "notNull": false,
2636
+ "autoincrement": false
2637
+ },
2638
+ "variables": {
2639
+ "name": "variables",
2640
+ "type": "text",
2641
+ "primaryKey": false,
2642
+ "notNull": false,
2643
+ "autoincrement": false
2644
+ },
2645
+ "category": {
2646
+ "name": "category",
2647
+ "type": "text",
2648
+ "primaryKey": false,
2649
+ "notNull": false,
2650
+ "autoincrement": false
2651
+ },
2652
+ "is_active": {
2653
+ "name": "is_active",
2654
+ "type": "integer",
2655
+ "primaryKey": false,
2656
+ "notNull": false,
2657
+ "autoincrement": false,
2658
+ "default": true
2659
+ },
2660
+ "created_at": {
2661
+ "name": "created_at",
2662
+ "type": "integer",
2663
+ "primaryKey": false,
2664
+ "notNull": false,
2665
+ "autoincrement": false
2666
+ }
2667
+ },
2668
+ "indexes": {
2669
+ "uq_templates_tenant_slug": {
2670
+ "name": "uq_templates_tenant_slug",
2671
+ "columns": [
2672
+ "tenant_id",
2673
+ "slug"
2674
+ ],
2675
+ "isUnique": true
2676
+ }
2677
+ },
2678
+ "foreignKeys": {
2679
+ "templates_tenant_id_tenants_id_fk": {
2680
+ "name": "templates_tenant_id_tenants_id_fk",
2681
+ "tableFrom": "templates",
2682
+ "tableTo": "tenants",
2683
+ "columnsFrom": [
2684
+ "tenant_id"
2685
+ ],
2686
+ "columnsTo": [
2687
+ "id"
2688
+ ],
2689
+ "onDelete": "no action",
2690
+ "onUpdate": "no action"
2691
+ }
2692
+ },
2693
+ "compositePrimaryKeys": {},
2694
+ "uniqueConstraints": {},
2695
+ "checkConstraints": {}
2696
+ },
2697
+ "tenants": {
2698
+ "name": "tenants",
2699
+ "columns": {
2700
+ "id": {
2701
+ "name": "id",
2702
+ "type": "text",
2703
+ "primaryKey": true,
2704
+ "notNull": true,
2705
+ "autoincrement": false
2706
+ },
2707
+ "name": {
2708
+ "name": "name",
2709
+ "type": "text",
2710
+ "primaryKey": false,
2711
+ "notNull": true,
2712
+ "autoincrement": false
2713
+ },
2714
+ "slug": {
2715
+ "name": "slug",
2716
+ "type": "text",
2717
+ "primaryKey": false,
2718
+ "notNull": true,
2719
+ "autoincrement": false
2720
+ },
2721
+ "plan": {
2722
+ "name": "plan",
2723
+ "type": "text",
2724
+ "primaryKey": false,
2725
+ "notNull": false,
2726
+ "autoincrement": false,
2727
+ "default": "'free'"
2728
+ },
2729
+ "settings": {
2730
+ "name": "settings",
2731
+ "type": "text",
2732
+ "primaryKey": false,
2733
+ "notNull": false,
2734
+ "autoincrement": false
2735
+ },
2736
+ "business_model": {
2737
+ "name": "business_model",
2738
+ "type": "text",
2739
+ "primaryKey": false,
2740
+ "notNull": false,
2741
+ "autoincrement": false
2742
+ },
2743
+ "created_at": {
2744
+ "name": "created_at",
2745
+ "type": "integer",
2746
+ "primaryKey": false,
2747
+ "notNull": false,
2748
+ "autoincrement": false
2749
+ },
2750
+ "archived_at": {
2751
+ "name": "archived_at",
2752
+ "type": "integer",
2753
+ "primaryKey": false,
2754
+ "notNull": false,
2755
+ "autoincrement": false
2756
+ },
2757
+ "public_host": {
2758
+ "name": "public_host",
2759
+ "type": "text",
2760
+ "primaryKey": false,
2761
+ "notNull": false,
2762
+ "autoincrement": false
2763
+ },
2764
+ "locale": {
2765
+ "name": "locale",
2766
+ "type": "text",
2767
+ "primaryKey": false,
2768
+ "notNull": false,
2769
+ "autoincrement": false
2770
+ },
2771
+ "config_version": {
2772
+ "name": "config_version",
2773
+ "type": "integer",
2774
+ "primaryKey": false,
2775
+ "notNull": true,
2776
+ "autoincrement": false,
2777
+ "default": 0
2778
+ }
2779
+ },
2780
+ "indexes": {
2781
+ "tenants_slug_unique": {
2782
+ "name": "tenants_slug_unique",
2783
+ "columns": [
2784
+ "slug"
2785
+ ],
2786
+ "isUnique": true
2787
+ },
2788
+ "uq_tenants_public_host": {
2789
+ "name": "uq_tenants_public_host",
2790
+ "columns": [
2791
+ "public_host"
2792
+ ],
2793
+ "isUnique": true,
2794
+ "where": "public_host IS NOT NULL"
2795
+ }
2796
+ },
2797
+ "foreignKeys": {},
2798
+ "compositePrimaryKeys": {},
2799
+ "uniqueConstraints": {},
2800
+ "checkConstraints": {}
2801
+ },
2802
+ "topics": {
2803
+ "name": "topics",
2804
+ "columns": {
2805
+ "id": {
2806
+ "name": "id",
2807
+ "type": "text",
2808
+ "primaryKey": true,
2809
+ "notNull": true,
2810
+ "autoincrement": false
2811
+ },
2812
+ "tenant_id": {
2813
+ "name": "tenant_id",
2814
+ "type": "text",
2815
+ "primaryKey": false,
2816
+ "notNull": true,
2817
+ "autoincrement": false
2818
+ },
2819
+ "slug": {
2820
+ "name": "slug",
2821
+ "type": "text",
2822
+ "primaryKey": false,
2823
+ "notNull": true,
2824
+ "autoincrement": false
2825
+ },
2826
+ "name": {
2827
+ "name": "name",
2828
+ "type": "text",
2829
+ "primaryKey": false,
2830
+ "notNull": true,
2831
+ "autoincrement": false
2832
+ },
2833
+ "kind": {
2834
+ "name": "kind",
2835
+ "type": "text",
2836
+ "primaryKey": false,
2837
+ "notNull": true,
2838
+ "autoincrement": false
2839
+ },
2840
+ "description": {
2841
+ "name": "description",
2842
+ "type": "text",
2843
+ "primaryKey": false,
2844
+ "notNull": false,
2845
+ "autoincrement": false
2846
+ },
2847
+ "default_subscribed": {
2848
+ "name": "default_subscribed",
2849
+ "type": "integer",
2850
+ "primaryKey": false,
2851
+ "notNull": true,
2852
+ "autoincrement": false,
2853
+ "default": true
2854
+ },
2855
+ "created_at": {
2856
+ "name": "created_at",
2857
+ "type": "integer",
2858
+ "primaryKey": false,
2859
+ "notNull": false,
2860
+ "autoincrement": false
2861
+ }
2862
+ },
2863
+ "indexes": {
2864
+ "uq_topics_tenant_slug": {
2865
+ "name": "uq_topics_tenant_slug",
2866
+ "columns": [
2867
+ "tenant_id",
2868
+ "slug"
2869
+ ],
2870
+ "isUnique": true
2871
+ }
2872
+ },
2873
+ "foreignKeys": {
2874
+ "topics_tenant_id_tenants_id_fk": {
2875
+ "name": "topics_tenant_id_tenants_id_fk",
2876
+ "tableFrom": "topics",
2877
+ "tableTo": "tenants",
2878
+ "columnsFrom": [
2879
+ "tenant_id"
2880
+ ],
2881
+ "columnsTo": [
2882
+ "id"
2883
+ ],
2884
+ "onDelete": "no action",
2885
+ "onUpdate": "no action"
2886
+ }
2887
+ },
2888
+ "compositePrimaryKeys": {},
2889
+ "uniqueConstraints": {},
2890
+ "checkConstraints": {}
2891
+ },
2892
+ "transport_configs": {
2893
+ "name": "transport_configs",
2894
+ "columns": {
2895
+ "id": {
2896
+ "name": "id",
2897
+ "type": "text",
2898
+ "primaryKey": true,
2899
+ "notNull": true,
2900
+ "autoincrement": false
2901
+ },
2902
+ "tenant_id": {
2903
+ "name": "tenant_id",
2904
+ "type": "text",
2905
+ "primaryKey": false,
2906
+ "notNull": true,
2907
+ "autoincrement": false
2908
+ },
2909
+ "provider": {
2910
+ "name": "provider",
2911
+ "type": "text",
2912
+ "primaryKey": false,
2913
+ "notNull": true,
2914
+ "autoincrement": false
2915
+ },
2916
+ "config": {
2917
+ "name": "config",
2918
+ "type": "text",
2919
+ "primaryKey": false,
2920
+ "notNull": true,
2921
+ "autoincrement": false
2922
+ },
2923
+ "is_active": {
2924
+ "name": "is_active",
2925
+ "type": "integer",
2926
+ "primaryKey": false,
2927
+ "notNull": false,
2928
+ "autoincrement": false,
2929
+ "default": true
2930
+ },
2931
+ "dkim_verified": {
2932
+ "name": "dkim_verified",
2933
+ "type": "integer",
2934
+ "primaryKey": false,
2935
+ "notNull": false,
2936
+ "autoincrement": false,
2937
+ "default": false
2938
+ },
2939
+ "from_email": {
2940
+ "name": "from_email",
2941
+ "type": "text",
2942
+ "primaryKey": false,
2943
+ "notNull": true,
2944
+ "autoincrement": false
2945
+ },
2946
+ "from_name": {
2947
+ "name": "from_name",
2948
+ "type": "text",
2949
+ "primaryKey": false,
2950
+ "notNull": false,
2951
+ "autoincrement": false
2952
+ },
2953
+ "daily_limit": {
2954
+ "name": "daily_limit",
2955
+ "type": "integer",
2956
+ "primaryKey": false,
2957
+ "notNull": false,
2958
+ "autoincrement": false
2959
+ },
2960
+ "kind": {
2961
+ "name": "kind",
2962
+ "type": "text",
2963
+ "primaryKey": false,
2964
+ "notNull": false,
2965
+ "autoincrement": false
2966
+ },
2967
+ "name": {
2968
+ "name": "name",
2969
+ "type": "text",
2970
+ "primaryKey": false,
2971
+ "notNull": false,
2972
+ "autoincrement": false
2973
+ },
2974
+ "reply_to": {
2975
+ "name": "reply_to",
2976
+ "type": "text",
2977
+ "primaryKey": false,
2978
+ "notNull": false,
2979
+ "autoincrement": false
2980
+ },
2981
+ "created_at": {
2982
+ "name": "created_at",
2983
+ "type": "integer",
2984
+ "primaryKey": false,
2985
+ "notNull": false,
2986
+ "autoincrement": false
2987
+ }
2988
+ },
2989
+ "indexes": {},
2990
+ "foreignKeys": {
2991
+ "transport_configs_tenant_id_tenants_id_fk": {
2992
+ "name": "transport_configs_tenant_id_tenants_id_fk",
2993
+ "tableFrom": "transport_configs",
2994
+ "tableTo": "tenants",
2995
+ "columnsFrom": [
2996
+ "tenant_id"
2997
+ ],
2998
+ "columnsTo": [
2999
+ "id"
3000
+ ],
3001
+ "onDelete": "no action",
3002
+ "onUpdate": "no action"
3003
+ }
3004
+ },
3005
+ "compositePrimaryKeys": {},
3006
+ "uniqueConstraints": {},
3007
+ "checkConstraints": {}
3008
+ },
3009
+ "users": {
3010
+ "name": "users",
3011
+ "columns": {
3012
+ "id": {
3013
+ "name": "id",
3014
+ "type": "text",
3015
+ "primaryKey": true,
3016
+ "notNull": true,
3017
+ "autoincrement": false
3018
+ },
3019
+ "tenant_id": {
3020
+ "name": "tenant_id",
3021
+ "type": "text",
3022
+ "primaryKey": false,
3023
+ "notNull": true,
3024
+ "autoincrement": false
3025
+ },
3026
+ "email": {
3027
+ "name": "email",
3028
+ "type": "text",
3029
+ "primaryKey": false,
3030
+ "notNull": true,
3031
+ "autoincrement": false
3032
+ },
3033
+ "name": {
3034
+ "name": "name",
3035
+ "type": "text",
3036
+ "primaryKey": false,
3037
+ "notNull": false,
3038
+ "autoincrement": false
3039
+ },
3040
+ "role": {
3041
+ "name": "role",
3042
+ "type": "text",
3043
+ "primaryKey": false,
3044
+ "notNull": true,
3045
+ "autoincrement": false,
3046
+ "default": "'member'"
3047
+ },
3048
+ "instance_role": {
3049
+ "name": "instance_role",
3050
+ "type": "text",
3051
+ "primaryKey": false,
3052
+ "notNull": false,
3053
+ "autoincrement": false
3054
+ },
3055
+ "last_login_at": {
3056
+ "name": "last_login_at",
3057
+ "type": "integer",
3058
+ "primaryKey": false,
3059
+ "notNull": false,
3060
+ "autoincrement": false
3061
+ },
3062
+ "deactivated_at": {
3063
+ "name": "deactivated_at",
3064
+ "type": "integer",
3065
+ "primaryKey": false,
3066
+ "notNull": false,
3067
+ "autoincrement": false
3068
+ },
3069
+ "pending_email": {
3070
+ "name": "pending_email",
3071
+ "type": "text",
3072
+ "primaryKey": false,
3073
+ "notNull": false,
3074
+ "autoincrement": false
3075
+ },
3076
+ "pending_email_token_hash": {
3077
+ "name": "pending_email_token_hash",
3078
+ "type": "text",
3079
+ "primaryKey": false,
3080
+ "notNull": false,
3081
+ "autoincrement": false
3082
+ },
3083
+ "pending_email_expires_at": {
3084
+ "name": "pending_email_expires_at",
3085
+ "type": "integer",
3086
+ "primaryKey": false,
3087
+ "notNull": false,
3088
+ "autoincrement": false
3089
+ },
3090
+ "created_at": {
3091
+ "name": "created_at",
3092
+ "type": "integer",
3093
+ "primaryKey": false,
3094
+ "notNull": false,
3095
+ "autoincrement": false
3096
+ }
3097
+ },
3098
+ "indexes": {
3099
+ "uq_users_tenant_email": {
3100
+ "name": "uq_users_tenant_email",
3101
+ "columns": [
3102
+ "tenant_id",
3103
+ "email"
3104
+ ],
3105
+ "isUnique": true
3106
+ }
3107
+ },
3108
+ "foreignKeys": {
3109
+ "users_tenant_id_tenants_id_fk": {
3110
+ "name": "users_tenant_id_tenants_id_fk",
3111
+ "tableFrom": "users",
3112
+ "tableTo": "tenants",
3113
+ "columnsFrom": [
3114
+ "tenant_id"
3115
+ ],
3116
+ "columnsTo": [
3117
+ "id"
3118
+ ],
3119
+ "onDelete": "no action",
3120
+ "onUpdate": "no action"
3121
+ }
3122
+ },
3123
+ "compositePrimaryKeys": {},
3124
+ "uniqueConstraints": {},
3125
+ "checkConstraints": {}
3126
+ }
3127
+ },
3128
+ "views": {},
3129
+ "enums": {},
3130
+ "_meta": {
3131
+ "schemas": {},
3132
+ "tables": {},
3133
+ "columns": {}
3134
+ },
3135
+ "internal": {
3136
+ "indexes": {}
3137
+ }
3138
+ }