@intx/db 0.1.2

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 (91) hide show
  1. package/README.md +37 -0
  2. package/drizzle.config.ts +23 -0
  3. package/migrations/.gitkeep +0 -0
  4. package/migrations/0000_brown_wither.sql +50 -0
  5. package/migrations/0001_white_aqueduct.sql +105 -0
  6. package/migrations/0002_clever_falcon.sql +56 -0
  7. package/migrations/0003_stiff_tyrannus.sql +44 -0
  8. package/migrations/0004_rename_capability_to_offering.sql +1 -0
  9. package/migrations/0005_gigantic_cardiac.sql +1 -0
  10. package/migrations/0006_sidecar.sql +8 -0
  11. package/migrations/0007_agent_running_session.sql +1 -0
  12. package/migrations/0008_session.sql +10 -0
  13. package/migrations/0009_session_messages.sql +18 -0
  14. package/migrations/0010_agent_sidecar_pubkey.sql +2 -0
  15. package/migrations/0011_session_message_from.sql +2 -0
  16. package/migrations/0012_agent_instance.sql +22 -0
  17. package/migrations/0013_instance_session_id.sql +2 -0
  18. package/migrations/0014_drop_agent_runtime_columns.sql +12 -0
  19. package/migrations/0015_add_instance_id_to_session_message.sql +2 -0
  20. package/migrations/0016_jazzy_gamma_corps.sql +3 -0
  21. package/migrations/0017_hesitant_marvex.sql +1 -0
  22. package/migrations/0018_natural_sinister_six.sql +5 -0
  23. package/migrations/0019_rename_grant_source_to_origin.sql +1 -0
  24. package/migrations/0020_add_agent_role.sql +9 -0
  25. package/migrations/0021_acoustic_ozymandias.sql +15 -0
  26. package/migrations/0022_material_sleepwalker.sql +27 -0
  27. package/migrations/0023_flawless_scarlet_witch.sql +2 -0
  28. package/migrations/0024_bumpy_sharon_ventura.sql +1 -0
  29. package/migrations/0025_curvy_firestar.sql +26 -0
  30. package/migrations/0026_keen_ultimo.sql +13 -0
  31. package/migrations/0027_git_tokens.sql +21 -0
  32. package/migrations/0028_wet_sugar_man.sql +1 -0
  33. package/migrations/meta/0000_snapshot.json +316 -0
  34. package/migrations/meta/0001_snapshot.json +968 -0
  35. package/migrations/meta/0002_snapshot.json +1315 -0
  36. package/migrations/meta/0003_snapshot.json +1594 -0
  37. package/migrations/meta/0004_snapshot.json +1594 -0
  38. package/migrations/meta/0005_snapshot.json +1600 -0
  39. package/migrations/meta/0011_snapshot.json +1921 -0
  40. package/migrations/meta/0012_snapshot.json +2067 -0
  41. package/migrations/meta/0013_snapshot.json +2082 -0
  42. package/migrations/meta/0014_snapshot.json +2049 -0
  43. package/migrations/meta/0015_snapshot.json +2064 -0
  44. package/migrations/meta/0016_snapshot.json +2085 -0
  45. package/migrations/meta/0017_snapshot.json +2085 -0
  46. package/migrations/meta/0018_snapshot.json +2070 -0
  47. package/migrations/meta/0019_snapshot.json +2070 -0
  48. package/migrations/meta/0020_snapshot.json +2126 -0
  49. package/migrations/meta/0021_snapshot.json +2239 -0
  50. package/migrations/meta/0022_snapshot.json +2425 -0
  51. package/migrations/meta/0023_snapshot.json +2260 -0
  52. package/migrations/meta/0024_snapshot.json +2254 -0
  53. package/migrations/meta/0025_snapshot.json +2418 -0
  54. package/migrations/meta/0026_snapshot.json +2508 -0
  55. package/migrations/meta/0027_snapshot.json +2657 -0
  56. package/migrations/meta/0028_snapshot.json +2657 -0
  57. package/migrations/meta/_journal.json +209 -0
  58. package/package.json +27 -0
  59. package/src/client.ts +24 -0
  60. package/src/config.ts +19 -0
  61. package/src/connection.ts +27 -0
  62. package/src/credential-resolution.ts +378 -0
  63. package/src/grant-store.ts +51 -0
  64. package/src/index.ts +32 -0
  65. package/src/migrate.test.ts +35 -0
  66. package/src/migrate.ts +168 -0
  67. package/src/parse-row.test.ts +113 -0
  68. package/src/parse-row.ts +185 -0
  69. package/src/schema/agent-assets.ts +21 -0
  70. package/src/schema/agents.ts +49 -0
  71. package/src/schema/assets.ts +24 -0
  72. package/src/schema/auth.ts +51 -0
  73. package/src/schema/credentials.ts +43 -0
  74. package/src/schema/git-tokens.ts +83 -0
  75. package/src/schema/grants.ts +26 -0
  76. package/src/schema/index.ts +19 -0
  77. package/src/schema/instances.ts +36 -0
  78. package/src/schema/messages.ts +108 -0
  79. package/src/schema/oauth-clients.ts +26 -0
  80. package/src/schema/offerings.ts +20 -0
  81. package/src/schema/principals.ts +28 -0
  82. package/src/schema/providers.ts +23 -0
  83. package/src/schema/roles.ts +51 -0
  84. package/src/schema/session-assets.ts +49 -0
  85. package/src/schema/sessions.ts +26 -0
  86. package/src/schema/sidecar.ts +14 -0
  87. package/src/schema/tenants.ts +41 -0
  88. package/src/schema/wallets.ts +44 -0
  89. package/src/tenant-hierarchy.ts +34 -0
  90. package/tsconfig.json +4 -0
  91. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,1594 @@
1
+ {
2
+ "id": "a5b7e8c2-d0da-4eac-8175-83a1ad1c9ac6",
3
+ "prevId": "cc772331-a383-4ac4-9128-e6b45d3cb36b",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "user_id": {
18
+ "name": "user_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "account_id": {
24
+ "name": "account_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "provider_id": {
30
+ "name": "provider_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "access_token_expires_at": {
48
+ "name": "access_token_expires_at",
49
+ "type": "timestamp",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "refresh_token_expires_at": {
54
+ "name": "refresh_token_expires_at",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "scope": {
60
+ "name": "scope",
61
+ "type": "text",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "id_token": {
66
+ "name": "id_token",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "now()"
90
+ }
91
+ },
92
+ "indexes": {},
93
+ "foreignKeys": {
94
+ "account_user_id_user_id_fk": {
95
+ "name": "account_user_id_user_id_fk",
96
+ "tableFrom": "account",
97
+ "tableTo": "user",
98
+ "columnsFrom": ["user_id"],
99
+ "columnsTo": ["id"],
100
+ "onDelete": "cascade",
101
+ "onUpdate": "no action"
102
+ }
103
+ },
104
+ "compositePrimaryKeys": {},
105
+ "uniqueConstraints": {},
106
+ "policies": {},
107
+ "checkConstraints": {},
108
+ "isRLSEnabled": false
109
+ },
110
+ "public.session": {
111
+ "name": "session",
112
+ "schema": "",
113
+ "columns": {
114
+ "id": {
115
+ "name": "id",
116
+ "type": "text",
117
+ "primaryKey": true,
118
+ "notNull": true
119
+ },
120
+ "user_id": {
121
+ "name": "user_id",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": true
125
+ },
126
+ "token": {
127
+ "name": "token",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": true
131
+ },
132
+ "expires_at": {
133
+ "name": "expires_at",
134
+ "type": "timestamp",
135
+ "primaryKey": false,
136
+ "notNull": true
137
+ },
138
+ "ip_address": {
139
+ "name": "ip_address",
140
+ "type": "text",
141
+ "primaryKey": false,
142
+ "notNull": false
143
+ },
144
+ "user_agent": {
145
+ "name": "user_agent",
146
+ "type": "text",
147
+ "primaryKey": false,
148
+ "notNull": false
149
+ },
150
+ "created_at": {
151
+ "name": "created_at",
152
+ "type": "timestamp",
153
+ "primaryKey": false,
154
+ "notNull": true,
155
+ "default": "now()"
156
+ },
157
+ "updated_at": {
158
+ "name": "updated_at",
159
+ "type": "timestamp",
160
+ "primaryKey": false,
161
+ "notNull": true,
162
+ "default": "now()"
163
+ }
164
+ },
165
+ "indexes": {},
166
+ "foreignKeys": {
167
+ "session_user_id_user_id_fk": {
168
+ "name": "session_user_id_user_id_fk",
169
+ "tableFrom": "session",
170
+ "tableTo": "user",
171
+ "columnsFrom": ["user_id"],
172
+ "columnsTo": ["id"],
173
+ "onDelete": "cascade",
174
+ "onUpdate": "no action"
175
+ }
176
+ },
177
+ "compositePrimaryKeys": {},
178
+ "uniqueConstraints": {
179
+ "session_token_unique": {
180
+ "name": "session_token_unique",
181
+ "nullsNotDistinct": false,
182
+ "columns": ["token"]
183
+ }
184
+ },
185
+ "policies": {},
186
+ "checkConstraints": {},
187
+ "isRLSEnabled": false
188
+ },
189
+ "public.user": {
190
+ "name": "user",
191
+ "schema": "",
192
+ "columns": {
193
+ "id": {
194
+ "name": "id",
195
+ "type": "text",
196
+ "primaryKey": true,
197
+ "notNull": true
198
+ },
199
+ "name": {
200
+ "name": "name",
201
+ "type": "text",
202
+ "primaryKey": false,
203
+ "notNull": true
204
+ },
205
+ "email": {
206
+ "name": "email",
207
+ "type": "text",
208
+ "primaryKey": false,
209
+ "notNull": true
210
+ },
211
+ "email_verified": {
212
+ "name": "email_verified",
213
+ "type": "boolean",
214
+ "primaryKey": false,
215
+ "notNull": true,
216
+ "default": false
217
+ },
218
+ "image": {
219
+ "name": "image",
220
+ "type": "text",
221
+ "primaryKey": false,
222
+ "notNull": false
223
+ },
224
+ "created_at": {
225
+ "name": "created_at",
226
+ "type": "timestamp",
227
+ "primaryKey": false,
228
+ "notNull": true,
229
+ "default": "now()"
230
+ },
231
+ "updated_at": {
232
+ "name": "updated_at",
233
+ "type": "timestamp",
234
+ "primaryKey": false,
235
+ "notNull": true,
236
+ "default": "now()"
237
+ }
238
+ },
239
+ "indexes": {},
240
+ "foreignKeys": {},
241
+ "compositePrimaryKeys": {},
242
+ "uniqueConstraints": {
243
+ "user_email_unique": {
244
+ "name": "user_email_unique",
245
+ "nullsNotDistinct": false,
246
+ "columns": ["email"]
247
+ }
248
+ },
249
+ "policies": {},
250
+ "checkConstraints": {},
251
+ "isRLSEnabled": false
252
+ },
253
+ "public.verification": {
254
+ "name": "verification",
255
+ "schema": "",
256
+ "columns": {
257
+ "id": {
258
+ "name": "id",
259
+ "type": "text",
260
+ "primaryKey": true,
261
+ "notNull": true
262
+ },
263
+ "identifier": {
264
+ "name": "identifier",
265
+ "type": "text",
266
+ "primaryKey": false,
267
+ "notNull": true
268
+ },
269
+ "value": {
270
+ "name": "value",
271
+ "type": "text",
272
+ "primaryKey": false,
273
+ "notNull": true
274
+ },
275
+ "expires_at": {
276
+ "name": "expires_at",
277
+ "type": "timestamp",
278
+ "primaryKey": false,
279
+ "notNull": true
280
+ },
281
+ "created_at": {
282
+ "name": "created_at",
283
+ "type": "timestamp",
284
+ "primaryKey": false,
285
+ "notNull": true,
286
+ "default": "now()"
287
+ },
288
+ "updated_at": {
289
+ "name": "updated_at",
290
+ "type": "timestamp",
291
+ "primaryKey": false,
292
+ "notNull": true,
293
+ "default": "now()"
294
+ }
295
+ },
296
+ "indexes": {},
297
+ "foreignKeys": {},
298
+ "compositePrimaryKeys": {},
299
+ "uniqueConstraints": {},
300
+ "policies": {},
301
+ "checkConstraints": {},
302
+ "isRLSEnabled": false
303
+ },
304
+ "public.federation_trust": {
305
+ "name": "federation_trust",
306
+ "schema": "",
307
+ "columns": {
308
+ "id": {
309
+ "name": "id",
310
+ "type": "text",
311
+ "primaryKey": true,
312
+ "notNull": true
313
+ },
314
+ "tenant_id": {
315
+ "name": "tenant_id",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true
319
+ },
320
+ "target_tenant_id": {
321
+ "name": "target_tenant_id",
322
+ "type": "text",
323
+ "primaryKey": false,
324
+ "notNull": true
325
+ },
326
+ "direction": {
327
+ "name": "direction",
328
+ "type": "text",
329
+ "primaryKey": false,
330
+ "notNull": true
331
+ },
332
+ "created_at": {
333
+ "name": "created_at",
334
+ "type": "timestamp",
335
+ "primaryKey": false,
336
+ "notNull": true,
337
+ "default": "now()"
338
+ }
339
+ },
340
+ "indexes": {},
341
+ "foreignKeys": {
342
+ "federation_trust_tenant_id_tenant_id_fk": {
343
+ "name": "federation_trust_tenant_id_tenant_id_fk",
344
+ "tableFrom": "federation_trust",
345
+ "tableTo": "tenant",
346
+ "columnsFrom": ["tenant_id"],
347
+ "columnsTo": ["id"],
348
+ "onDelete": "cascade",
349
+ "onUpdate": "no action"
350
+ },
351
+ "federation_trust_target_tenant_id_tenant_id_fk": {
352
+ "name": "federation_trust_target_tenant_id_tenant_id_fk",
353
+ "tableFrom": "federation_trust",
354
+ "tableTo": "tenant",
355
+ "columnsFrom": ["target_tenant_id"],
356
+ "columnsTo": ["id"],
357
+ "onDelete": "cascade",
358
+ "onUpdate": "no action"
359
+ }
360
+ },
361
+ "compositePrimaryKeys": {},
362
+ "uniqueConstraints": {
363
+ "federation_trust_tenant_id_target_tenant_id_unique": {
364
+ "name": "federation_trust_tenant_id_target_tenant_id_unique",
365
+ "nullsNotDistinct": false,
366
+ "columns": ["tenant_id", "target_tenant_id"]
367
+ }
368
+ },
369
+ "policies": {},
370
+ "checkConstraints": {},
371
+ "isRLSEnabled": false
372
+ },
373
+ "public.tenant": {
374
+ "name": "tenant",
375
+ "schema": "",
376
+ "columns": {
377
+ "id": {
378
+ "name": "id",
379
+ "type": "text",
380
+ "primaryKey": true,
381
+ "notNull": true
382
+ },
383
+ "name": {
384
+ "name": "name",
385
+ "type": "text",
386
+ "primaryKey": false,
387
+ "notNull": true
388
+ },
389
+ "slug": {
390
+ "name": "slug",
391
+ "type": "text",
392
+ "primaryKey": false,
393
+ "notNull": true
394
+ },
395
+ "domain": {
396
+ "name": "domain",
397
+ "type": "text",
398
+ "primaryKey": false,
399
+ "notNull": true
400
+ },
401
+ "parent_id": {
402
+ "name": "parent_id",
403
+ "type": "text",
404
+ "primaryKey": false,
405
+ "notNull": false
406
+ },
407
+ "config": {
408
+ "name": "config",
409
+ "type": "jsonb",
410
+ "primaryKey": false,
411
+ "notNull": false
412
+ },
413
+ "created_at": {
414
+ "name": "created_at",
415
+ "type": "timestamp",
416
+ "primaryKey": false,
417
+ "notNull": true,
418
+ "default": "now()"
419
+ },
420
+ "updated_at": {
421
+ "name": "updated_at",
422
+ "type": "timestamp",
423
+ "primaryKey": false,
424
+ "notNull": true,
425
+ "default": "now()"
426
+ }
427
+ },
428
+ "indexes": {},
429
+ "foreignKeys": {
430
+ "tenant_parent_id_tenant_id_fk": {
431
+ "name": "tenant_parent_id_tenant_id_fk",
432
+ "tableFrom": "tenant",
433
+ "tableTo": "tenant",
434
+ "columnsFrom": ["parent_id"],
435
+ "columnsTo": ["id"],
436
+ "onDelete": "no action",
437
+ "onUpdate": "no action"
438
+ }
439
+ },
440
+ "compositePrimaryKeys": {},
441
+ "uniqueConstraints": {
442
+ "tenant_slug_unique": {
443
+ "name": "tenant_slug_unique",
444
+ "nullsNotDistinct": false,
445
+ "columns": ["slug"]
446
+ },
447
+ "tenant_domain_unique": {
448
+ "name": "tenant_domain_unique",
449
+ "nullsNotDistinct": false,
450
+ "columns": ["domain"]
451
+ }
452
+ },
453
+ "policies": {},
454
+ "checkConstraints": {},
455
+ "isRLSEnabled": false
456
+ },
457
+ "public.principal": {
458
+ "name": "principal",
459
+ "schema": "",
460
+ "columns": {
461
+ "id": {
462
+ "name": "id",
463
+ "type": "text",
464
+ "primaryKey": true,
465
+ "notNull": true
466
+ },
467
+ "tenant_id": {
468
+ "name": "tenant_id",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": true
472
+ },
473
+ "kind": {
474
+ "name": "kind",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true
478
+ },
479
+ "ref_id": {
480
+ "name": "ref_id",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "status": {
486
+ "name": "status",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "created_at": {
492
+ "name": "created_at",
493
+ "type": "timestamp",
494
+ "primaryKey": false,
495
+ "notNull": true,
496
+ "default": "now()"
497
+ },
498
+ "updated_at": {
499
+ "name": "updated_at",
500
+ "type": "timestamp",
501
+ "primaryKey": false,
502
+ "notNull": true,
503
+ "default": "now()"
504
+ }
505
+ },
506
+ "indexes": {},
507
+ "foreignKeys": {
508
+ "principal_tenant_id_tenant_id_fk": {
509
+ "name": "principal_tenant_id_tenant_id_fk",
510
+ "tableFrom": "principal",
511
+ "tableTo": "tenant",
512
+ "columnsFrom": ["tenant_id"],
513
+ "columnsTo": ["id"],
514
+ "onDelete": "cascade",
515
+ "onUpdate": "no action"
516
+ }
517
+ },
518
+ "compositePrimaryKeys": {},
519
+ "uniqueConstraints": {
520
+ "principal_tenant_id_kind_ref_id_unique": {
521
+ "name": "principal_tenant_id_kind_ref_id_unique",
522
+ "nullsNotDistinct": false,
523
+ "columns": ["tenant_id", "kind", "ref_id"]
524
+ }
525
+ },
526
+ "policies": {},
527
+ "checkConstraints": {},
528
+ "isRLSEnabled": false
529
+ },
530
+ "public.principal_role": {
531
+ "name": "principal_role",
532
+ "schema": "",
533
+ "columns": {
534
+ "principal_id": {
535
+ "name": "principal_id",
536
+ "type": "text",
537
+ "primaryKey": false,
538
+ "notNull": true
539
+ },
540
+ "role_id": {
541
+ "name": "role_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": true
545
+ },
546
+ "created_at": {
547
+ "name": "created_at",
548
+ "type": "timestamp",
549
+ "primaryKey": false,
550
+ "notNull": true,
551
+ "default": "now()"
552
+ }
553
+ },
554
+ "indexes": {},
555
+ "foreignKeys": {
556
+ "principal_role_principal_id_principal_id_fk": {
557
+ "name": "principal_role_principal_id_principal_id_fk",
558
+ "tableFrom": "principal_role",
559
+ "tableTo": "principal",
560
+ "columnsFrom": ["principal_id"],
561
+ "columnsTo": ["id"],
562
+ "onDelete": "cascade",
563
+ "onUpdate": "no action"
564
+ },
565
+ "principal_role_role_id_role_id_fk": {
566
+ "name": "principal_role_role_id_role_id_fk",
567
+ "tableFrom": "principal_role",
568
+ "tableTo": "role",
569
+ "columnsFrom": ["role_id"],
570
+ "columnsTo": ["id"],
571
+ "onDelete": "cascade",
572
+ "onUpdate": "no action"
573
+ }
574
+ },
575
+ "compositePrimaryKeys": {
576
+ "principal_role_principal_id_role_id_pk": {
577
+ "name": "principal_role_principal_id_role_id_pk",
578
+ "columns": ["principal_id", "role_id"]
579
+ }
580
+ },
581
+ "uniqueConstraints": {},
582
+ "policies": {},
583
+ "checkConstraints": {},
584
+ "isRLSEnabled": false
585
+ },
586
+ "public.role": {
587
+ "name": "role",
588
+ "schema": "",
589
+ "columns": {
590
+ "id": {
591
+ "name": "id",
592
+ "type": "text",
593
+ "primaryKey": true,
594
+ "notNull": true
595
+ },
596
+ "tenant_id": {
597
+ "name": "tenant_id",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": true
601
+ },
602
+ "name": {
603
+ "name": "name",
604
+ "type": "text",
605
+ "primaryKey": false,
606
+ "notNull": true
607
+ },
608
+ "description": {
609
+ "name": "description",
610
+ "type": "text",
611
+ "primaryKey": false,
612
+ "notNull": false
613
+ },
614
+ "is_system": {
615
+ "name": "is_system",
616
+ "type": "boolean",
617
+ "primaryKey": false,
618
+ "notNull": true,
619
+ "default": false
620
+ },
621
+ "created_at": {
622
+ "name": "created_at",
623
+ "type": "timestamp",
624
+ "primaryKey": false,
625
+ "notNull": true,
626
+ "default": "now()"
627
+ },
628
+ "updated_at": {
629
+ "name": "updated_at",
630
+ "type": "timestamp",
631
+ "primaryKey": false,
632
+ "notNull": true,
633
+ "default": "now()"
634
+ }
635
+ },
636
+ "indexes": {},
637
+ "foreignKeys": {
638
+ "role_tenant_id_tenant_id_fk": {
639
+ "name": "role_tenant_id_tenant_id_fk",
640
+ "tableFrom": "role",
641
+ "tableTo": "tenant",
642
+ "columnsFrom": ["tenant_id"],
643
+ "columnsTo": ["id"],
644
+ "onDelete": "cascade",
645
+ "onUpdate": "no action"
646
+ }
647
+ },
648
+ "compositePrimaryKeys": {},
649
+ "uniqueConstraints": {},
650
+ "policies": {},
651
+ "checkConstraints": {},
652
+ "isRLSEnabled": false
653
+ },
654
+ "public.grant": {
655
+ "name": "grant",
656
+ "schema": "",
657
+ "columns": {
658
+ "id": {
659
+ "name": "id",
660
+ "type": "text",
661
+ "primaryKey": true,
662
+ "notNull": true
663
+ },
664
+ "tenant_id": {
665
+ "name": "tenant_id",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": true
669
+ },
670
+ "role_id": {
671
+ "name": "role_id",
672
+ "type": "text",
673
+ "primaryKey": false,
674
+ "notNull": false
675
+ },
676
+ "principal_id": {
677
+ "name": "principal_id",
678
+ "type": "text",
679
+ "primaryKey": false,
680
+ "notNull": false
681
+ },
682
+ "resource": {
683
+ "name": "resource",
684
+ "type": "text",
685
+ "primaryKey": false,
686
+ "notNull": true
687
+ },
688
+ "action": {
689
+ "name": "action",
690
+ "type": "text",
691
+ "primaryKey": false,
692
+ "notNull": true
693
+ },
694
+ "effect": {
695
+ "name": "effect",
696
+ "type": "text",
697
+ "primaryKey": false,
698
+ "notNull": true
699
+ },
700
+ "conditions": {
701
+ "name": "conditions",
702
+ "type": "jsonb",
703
+ "primaryKey": false,
704
+ "notNull": false
705
+ },
706
+ "source": {
707
+ "name": "source",
708
+ "type": "text",
709
+ "primaryKey": false,
710
+ "notNull": true
711
+ },
712
+ "expires_at": {
713
+ "name": "expires_at",
714
+ "type": "timestamp",
715
+ "primaryKey": false,
716
+ "notNull": false
717
+ },
718
+ "created_at": {
719
+ "name": "created_at",
720
+ "type": "timestamp",
721
+ "primaryKey": false,
722
+ "notNull": true,
723
+ "default": "now()"
724
+ },
725
+ "updated_at": {
726
+ "name": "updated_at",
727
+ "type": "timestamp",
728
+ "primaryKey": false,
729
+ "notNull": true,
730
+ "default": "now()"
731
+ }
732
+ },
733
+ "indexes": {},
734
+ "foreignKeys": {
735
+ "grant_tenant_id_tenant_id_fk": {
736
+ "name": "grant_tenant_id_tenant_id_fk",
737
+ "tableFrom": "grant",
738
+ "tableTo": "tenant",
739
+ "columnsFrom": ["tenant_id"],
740
+ "columnsTo": ["id"],
741
+ "onDelete": "cascade",
742
+ "onUpdate": "no action"
743
+ },
744
+ "grant_role_id_role_id_fk": {
745
+ "name": "grant_role_id_role_id_fk",
746
+ "tableFrom": "grant",
747
+ "tableTo": "role",
748
+ "columnsFrom": ["role_id"],
749
+ "columnsTo": ["id"],
750
+ "onDelete": "cascade",
751
+ "onUpdate": "no action"
752
+ },
753
+ "grant_principal_id_principal_id_fk": {
754
+ "name": "grant_principal_id_principal_id_fk",
755
+ "tableFrom": "grant",
756
+ "tableTo": "principal",
757
+ "columnsFrom": ["principal_id"],
758
+ "columnsTo": ["id"],
759
+ "onDelete": "cascade",
760
+ "onUpdate": "no action"
761
+ }
762
+ },
763
+ "compositePrimaryKeys": {},
764
+ "uniqueConstraints": {},
765
+ "policies": {},
766
+ "checkConstraints": {},
767
+ "isRLSEnabled": false
768
+ },
769
+ "public.agent": {
770
+ "name": "agent",
771
+ "schema": "",
772
+ "columns": {
773
+ "id": {
774
+ "name": "id",
775
+ "type": "text",
776
+ "primaryKey": true,
777
+ "notNull": true
778
+ },
779
+ "tenant_id": {
780
+ "name": "tenant_id",
781
+ "type": "text",
782
+ "primaryKey": false,
783
+ "notNull": true
784
+ },
785
+ "principal_id": {
786
+ "name": "principal_id",
787
+ "type": "text",
788
+ "primaryKey": false,
789
+ "notNull": true
790
+ },
791
+ "name": {
792
+ "name": "name",
793
+ "type": "text",
794
+ "primaryKey": false,
795
+ "notNull": true
796
+ },
797
+ "description": {
798
+ "name": "description",
799
+ "type": "text",
800
+ "primaryKey": false,
801
+ "notNull": false
802
+ },
803
+ "system_prompt": {
804
+ "name": "system_prompt",
805
+ "type": "text",
806
+ "primaryKey": false,
807
+ "notNull": false
808
+ },
809
+ "skills": {
810
+ "name": "skills",
811
+ "type": "jsonb",
812
+ "primaryKey": false,
813
+ "notNull": false
814
+ },
815
+ "context_config": {
816
+ "name": "context_config",
817
+ "type": "jsonb",
818
+ "primaryKey": false,
819
+ "notNull": false
820
+ },
821
+ "initial_state": {
822
+ "name": "initial_state",
823
+ "type": "jsonb",
824
+ "primaryKey": false,
825
+ "notNull": false
826
+ },
827
+ "model_config": {
828
+ "name": "model_config",
829
+ "type": "jsonb",
830
+ "primaryKey": false,
831
+ "notNull": false
832
+ },
833
+ "capabilities": {
834
+ "name": "capabilities",
835
+ "type": "jsonb",
836
+ "primaryKey": false,
837
+ "notNull": false
838
+ },
839
+ "current_version": {
840
+ "name": "current_version",
841
+ "type": "text",
842
+ "primaryKey": false,
843
+ "notNull": true,
844
+ "default": "'1'"
845
+ },
846
+ "status": {
847
+ "name": "status",
848
+ "type": "text",
849
+ "primaryKey": false,
850
+ "notNull": true,
851
+ "default": "'deployed'"
852
+ },
853
+ "kernel_id": {
854
+ "name": "kernel_id",
855
+ "type": "text",
856
+ "primaryKey": false,
857
+ "notNull": false
858
+ },
859
+ "created_at": {
860
+ "name": "created_at",
861
+ "type": "timestamp",
862
+ "primaryKey": false,
863
+ "notNull": true,
864
+ "default": "now()"
865
+ },
866
+ "updated_at": {
867
+ "name": "updated_at",
868
+ "type": "timestamp",
869
+ "primaryKey": false,
870
+ "notNull": true,
871
+ "default": "now()"
872
+ }
873
+ },
874
+ "indexes": {},
875
+ "foreignKeys": {
876
+ "agent_tenant_id_tenant_id_fk": {
877
+ "name": "agent_tenant_id_tenant_id_fk",
878
+ "tableFrom": "agent",
879
+ "tableTo": "tenant",
880
+ "columnsFrom": ["tenant_id"],
881
+ "columnsTo": ["id"],
882
+ "onDelete": "cascade",
883
+ "onUpdate": "no action"
884
+ },
885
+ "agent_principal_id_principal_id_fk": {
886
+ "name": "agent_principal_id_principal_id_fk",
887
+ "tableFrom": "agent",
888
+ "tableTo": "principal",
889
+ "columnsFrom": ["principal_id"],
890
+ "columnsTo": ["id"],
891
+ "onDelete": "no action",
892
+ "onUpdate": "no action"
893
+ }
894
+ },
895
+ "compositePrimaryKeys": {},
896
+ "uniqueConstraints": {},
897
+ "policies": {},
898
+ "checkConstraints": {},
899
+ "isRLSEnabled": false
900
+ },
901
+ "public.agent_version": {
902
+ "name": "agent_version",
903
+ "schema": "",
904
+ "columns": {
905
+ "id": {
906
+ "name": "id",
907
+ "type": "text",
908
+ "primaryKey": true,
909
+ "notNull": true
910
+ },
911
+ "agent_id": {
912
+ "name": "agent_id",
913
+ "type": "text",
914
+ "primaryKey": false,
915
+ "notNull": true
916
+ },
917
+ "version": {
918
+ "name": "version",
919
+ "type": "text",
920
+ "primaryKey": false,
921
+ "notNull": true
922
+ },
923
+ "status": {
924
+ "name": "status",
925
+ "type": "text",
926
+ "primaryKey": false,
927
+ "notNull": true,
928
+ "default": "'active'"
929
+ },
930
+ "created_at": {
931
+ "name": "created_at",
932
+ "type": "timestamp",
933
+ "primaryKey": false,
934
+ "notNull": true,
935
+ "default": "now()"
936
+ }
937
+ },
938
+ "indexes": {},
939
+ "foreignKeys": {
940
+ "agent_version_agent_id_agent_id_fk": {
941
+ "name": "agent_version_agent_id_agent_id_fk",
942
+ "tableFrom": "agent_version",
943
+ "tableTo": "agent",
944
+ "columnsFrom": ["agent_id"],
945
+ "columnsTo": ["id"],
946
+ "onDelete": "cascade",
947
+ "onUpdate": "no action"
948
+ }
949
+ },
950
+ "compositePrimaryKeys": {},
951
+ "uniqueConstraints": {},
952
+ "policies": {},
953
+ "checkConstraints": {},
954
+ "isRLSEnabled": false
955
+ },
956
+ "public.provider": {
957
+ "name": "provider",
958
+ "schema": "",
959
+ "columns": {
960
+ "id": {
961
+ "name": "id",
962
+ "type": "text",
963
+ "primaryKey": true,
964
+ "notNull": true
965
+ },
966
+ "tenant_id": {
967
+ "name": "tenant_id",
968
+ "type": "text",
969
+ "primaryKey": false,
970
+ "notNull": true
971
+ },
972
+ "name": {
973
+ "name": "name",
974
+ "type": "text",
975
+ "primaryKey": false,
976
+ "notNull": true
977
+ },
978
+ "plugin": {
979
+ "name": "plugin",
980
+ "type": "text",
981
+ "primaryKey": false,
982
+ "notNull": true
983
+ },
984
+ "authorization_url": {
985
+ "name": "authorization_url",
986
+ "type": "text",
987
+ "primaryKey": false,
988
+ "notNull": false
989
+ },
990
+ "token_url": {
991
+ "name": "token_url",
992
+ "type": "text",
993
+ "primaryKey": false,
994
+ "notNull": false
995
+ },
996
+ "user_info_url": {
997
+ "name": "user_info_url",
998
+ "type": "text",
999
+ "primaryKey": false,
1000
+ "notNull": false
1001
+ },
1002
+ "scopes": {
1003
+ "name": "scopes",
1004
+ "type": "text[]",
1005
+ "primaryKey": false,
1006
+ "notNull": false
1007
+ },
1008
+ "metadata": {
1009
+ "name": "metadata",
1010
+ "type": "jsonb",
1011
+ "primaryKey": false,
1012
+ "notNull": false
1013
+ },
1014
+ "created_at": {
1015
+ "name": "created_at",
1016
+ "type": "timestamp",
1017
+ "primaryKey": false,
1018
+ "notNull": true,
1019
+ "default": "now()"
1020
+ },
1021
+ "updated_at": {
1022
+ "name": "updated_at",
1023
+ "type": "timestamp",
1024
+ "primaryKey": false,
1025
+ "notNull": true,
1026
+ "default": "now()"
1027
+ }
1028
+ },
1029
+ "indexes": {},
1030
+ "foreignKeys": {
1031
+ "provider_tenant_id_tenant_id_fk": {
1032
+ "name": "provider_tenant_id_tenant_id_fk",
1033
+ "tableFrom": "provider",
1034
+ "tableTo": "tenant",
1035
+ "columnsFrom": ["tenant_id"],
1036
+ "columnsTo": ["id"],
1037
+ "onDelete": "cascade",
1038
+ "onUpdate": "no action"
1039
+ }
1040
+ },
1041
+ "compositePrimaryKeys": {},
1042
+ "uniqueConstraints": {
1043
+ "provider_tenant_name": {
1044
+ "name": "provider_tenant_name",
1045
+ "nullsNotDistinct": false,
1046
+ "columns": ["tenant_id", "name"]
1047
+ }
1048
+ },
1049
+ "policies": {},
1050
+ "checkConstraints": {},
1051
+ "isRLSEnabled": false
1052
+ },
1053
+ "public.oauth_client": {
1054
+ "name": "oauth_client",
1055
+ "schema": "",
1056
+ "columns": {
1057
+ "id": {
1058
+ "name": "id",
1059
+ "type": "text",
1060
+ "primaryKey": true,
1061
+ "notNull": true
1062
+ },
1063
+ "tenant_id": {
1064
+ "name": "tenant_id",
1065
+ "type": "text",
1066
+ "primaryKey": false,
1067
+ "notNull": true
1068
+ },
1069
+ "provider_id": {
1070
+ "name": "provider_id",
1071
+ "type": "text",
1072
+ "primaryKey": false,
1073
+ "notNull": true
1074
+ },
1075
+ "name": {
1076
+ "name": "name",
1077
+ "type": "text",
1078
+ "primaryKey": false,
1079
+ "notNull": true
1080
+ },
1081
+ "client_id": {
1082
+ "name": "client_id",
1083
+ "type": "text",
1084
+ "primaryKey": false,
1085
+ "notNull": true
1086
+ },
1087
+ "client_secret": {
1088
+ "name": "client_secret",
1089
+ "type": "text",
1090
+ "primaryKey": false,
1091
+ "notNull": true
1092
+ },
1093
+ "redirect_uris": {
1094
+ "name": "redirect_uris",
1095
+ "type": "text[]",
1096
+ "primaryKey": false,
1097
+ "notNull": false
1098
+ },
1099
+ "default_scopes": {
1100
+ "name": "default_scopes",
1101
+ "type": "text[]",
1102
+ "primaryKey": false,
1103
+ "notNull": false
1104
+ },
1105
+ "metadata": {
1106
+ "name": "metadata",
1107
+ "type": "jsonb",
1108
+ "primaryKey": false,
1109
+ "notNull": false
1110
+ },
1111
+ "created_at": {
1112
+ "name": "created_at",
1113
+ "type": "timestamp",
1114
+ "primaryKey": false,
1115
+ "notNull": true,
1116
+ "default": "now()"
1117
+ },
1118
+ "updated_at": {
1119
+ "name": "updated_at",
1120
+ "type": "timestamp",
1121
+ "primaryKey": false,
1122
+ "notNull": true,
1123
+ "default": "now()"
1124
+ }
1125
+ },
1126
+ "indexes": {},
1127
+ "foreignKeys": {
1128
+ "oauth_client_tenant_id_tenant_id_fk": {
1129
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1130
+ "tableFrom": "oauth_client",
1131
+ "tableTo": "tenant",
1132
+ "columnsFrom": ["tenant_id"],
1133
+ "columnsTo": ["id"],
1134
+ "onDelete": "cascade",
1135
+ "onUpdate": "no action"
1136
+ },
1137
+ "oauth_client_provider_id_provider_id_fk": {
1138
+ "name": "oauth_client_provider_id_provider_id_fk",
1139
+ "tableFrom": "oauth_client",
1140
+ "tableTo": "provider",
1141
+ "columnsFrom": ["provider_id"],
1142
+ "columnsTo": ["id"],
1143
+ "onDelete": "cascade",
1144
+ "onUpdate": "no action"
1145
+ }
1146
+ },
1147
+ "compositePrimaryKeys": {},
1148
+ "uniqueConstraints": {
1149
+ "oauth_client_tenant_provider": {
1150
+ "name": "oauth_client_tenant_provider",
1151
+ "nullsNotDistinct": false,
1152
+ "columns": ["tenant_id", "provider_id"]
1153
+ }
1154
+ },
1155
+ "policies": {},
1156
+ "checkConstraints": {},
1157
+ "isRLSEnabled": false
1158
+ },
1159
+ "public.credential": {
1160
+ "name": "credential",
1161
+ "schema": "",
1162
+ "columns": {
1163
+ "id": {
1164
+ "name": "id",
1165
+ "type": "text",
1166
+ "primaryKey": true,
1167
+ "notNull": true
1168
+ },
1169
+ "tenant_id": {
1170
+ "name": "tenant_id",
1171
+ "type": "text",
1172
+ "primaryKey": false,
1173
+ "notNull": true
1174
+ },
1175
+ "principal_id": {
1176
+ "name": "principal_id",
1177
+ "type": "text",
1178
+ "primaryKey": false,
1179
+ "notNull": false
1180
+ },
1181
+ "provider_id": {
1182
+ "name": "provider_id",
1183
+ "type": "text",
1184
+ "primaryKey": false,
1185
+ "notNull": true
1186
+ },
1187
+ "oauth_client_id": {
1188
+ "name": "oauth_client_id",
1189
+ "type": "text",
1190
+ "primaryKey": false,
1191
+ "notNull": false
1192
+ },
1193
+ "name": {
1194
+ "name": "name",
1195
+ "type": "text",
1196
+ "primaryKey": false,
1197
+ "notNull": true
1198
+ },
1199
+ "type": {
1200
+ "name": "type",
1201
+ "type": "text",
1202
+ "primaryKey": false,
1203
+ "notNull": true
1204
+ },
1205
+ "description": {
1206
+ "name": "description",
1207
+ "type": "text",
1208
+ "primaryKey": false,
1209
+ "notNull": false
1210
+ },
1211
+ "secret": {
1212
+ "name": "secret",
1213
+ "type": "text",
1214
+ "primaryKey": false,
1215
+ "notNull": true
1216
+ },
1217
+ "refresh_secret": {
1218
+ "name": "refresh_secret",
1219
+ "type": "text",
1220
+ "primaryKey": false,
1221
+ "notNull": false
1222
+ },
1223
+ "scopes": {
1224
+ "name": "scopes",
1225
+ "type": "text[]",
1226
+ "primaryKey": false,
1227
+ "notNull": false
1228
+ },
1229
+ "expires_at": {
1230
+ "name": "expires_at",
1231
+ "type": "timestamp",
1232
+ "primaryKey": false,
1233
+ "notNull": false
1234
+ },
1235
+ "status": {
1236
+ "name": "status",
1237
+ "type": "text",
1238
+ "primaryKey": false,
1239
+ "notNull": true,
1240
+ "default": "'active'"
1241
+ },
1242
+ "metadata": {
1243
+ "name": "metadata",
1244
+ "type": "jsonb",
1245
+ "primaryKey": false,
1246
+ "notNull": false
1247
+ },
1248
+ "created_at": {
1249
+ "name": "created_at",
1250
+ "type": "timestamp",
1251
+ "primaryKey": false,
1252
+ "notNull": true,
1253
+ "default": "now()"
1254
+ },
1255
+ "updated_at": {
1256
+ "name": "updated_at",
1257
+ "type": "timestamp",
1258
+ "primaryKey": false,
1259
+ "notNull": true,
1260
+ "default": "now()"
1261
+ }
1262
+ },
1263
+ "indexes": {},
1264
+ "foreignKeys": {
1265
+ "credential_tenant_id_tenant_id_fk": {
1266
+ "name": "credential_tenant_id_tenant_id_fk",
1267
+ "tableFrom": "credential",
1268
+ "tableTo": "tenant",
1269
+ "columnsFrom": ["tenant_id"],
1270
+ "columnsTo": ["id"],
1271
+ "onDelete": "cascade",
1272
+ "onUpdate": "no action"
1273
+ },
1274
+ "credential_principal_id_principal_id_fk": {
1275
+ "name": "credential_principal_id_principal_id_fk",
1276
+ "tableFrom": "credential",
1277
+ "tableTo": "principal",
1278
+ "columnsFrom": ["principal_id"],
1279
+ "columnsTo": ["id"],
1280
+ "onDelete": "set null",
1281
+ "onUpdate": "no action"
1282
+ },
1283
+ "credential_provider_id_provider_id_fk": {
1284
+ "name": "credential_provider_id_provider_id_fk",
1285
+ "tableFrom": "credential",
1286
+ "tableTo": "provider",
1287
+ "columnsFrom": ["provider_id"],
1288
+ "columnsTo": ["id"],
1289
+ "onDelete": "cascade",
1290
+ "onUpdate": "no action"
1291
+ },
1292
+ "credential_oauth_client_id_oauth_client_id_fk": {
1293
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1294
+ "tableFrom": "credential",
1295
+ "tableTo": "oauth_client",
1296
+ "columnsFrom": ["oauth_client_id"],
1297
+ "columnsTo": ["id"],
1298
+ "onDelete": "set null",
1299
+ "onUpdate": "no action"
1300
+ }
1301
+ },
1302
+ "compositePrimaryKeys": {},
1303
+ "uniqueConstraints": {
1304
+ "credential_tenant_name": {
1305
+ "name": "credential_tenant_name",
1306
+ "nullsNotDistinct": false,
1307
+ "columns": ["tenant_id", "name"]
1308
+ }
1309
+ },
1310
+ "policies": {},
1311
+ "checkConstraints": {},
1312
+ "isRLSEnabled": false
1313
+ },
1314
+ "public.transaction": {
1315
+ "name": "transaction",
1316
+ "schema": "",
1317
+ "columns": {
1318
+ "id": {
1319
+ "name": "id",
1320
+ "type": "text",
1321
+ "primaryKey": true,
1322
+ "notNull": true
1323
+ },
1324
+ "wallet_id": {
1325
+ "name": "wallet_id",
1326
+ "type": "text",
1327
+ "primaryKey": false,
1328
+ "notNull": true
1329
+ },
1330
+ "agent_id": {
1331
+ "name": "agent_id",
1332
+ "type": "text",
1333
+ "primaryKey": false,
1334
+ "notNull": false
1335
+ },
1336
+ "direction": {
1337
+ "name": "direction",
1338
+ "type": "text",
1339
+ "primaryKey": false,
1340
+ "notNull": true
1341
+ },
1342
+ "amount": {
1343
+ "name": "amount",
1344
+ "type": "text",
1345
+ "primaryKey": false,
1346
+ "notNull": true
1347
+ },
1348
+ "currency": {
1349
+ "name": "currency",
1350
+ "type": "text",
1351
+ "primaryKey": false,
1352
+ "notNull": true
1353
+ },
1354
+ "recipient_id": {
1355
+ "name": "recipient_id",
1356
+ "type": "text",
1357
+ "primaryKey": false,
1358
+ "notNull": false
1359
+ },
1360
+ "sender_id": {
1361
+ "name": "sender_id",
1362
+ "type": "text",
1363
+ "primaryKey": false,
1364
+ "notNull": false
1365
+ },
1366
+ "request_id": {
1367
+ "name": "request_id",
1368
+ "type": "text",
1369
+ "primaryKey": false,
1370
+ "notNull": false
1371
+ },
1372
+ "status": {
1373
+ "name": "status",
1374
+ "type": "text",
1375
+ "primaryKey": false,
1376
+ "notNull": true,
1377
+ "default": "'pending'"
1378
+ },
1379
+ "created_at": {
1380
+ "name": "created_at",
1381
+ "type": "timestamp",
1382
+ "primaryKey": false,
1383
+ "notNull": true,
1384
+ "default": "now()"
1385
+ }
1386
+ },
1387
+ "indexes": {},
1388
+ "foreignKeys": {
1389
+ "transaction_wallet_id_wallet_id_fk": {
1390
+ "name": "transaction_wallet_id_wallet_id_fk",
1391
+ "tableFrom": "transaction",
1392
+ "tableTo": "wallet",
1393
+ "columnsFrom": ["wallet_id"],
1394
+ "columnsTo": ["id"],
1395
+ "onDelete": "cascade",
1396
+ "onUpdate": "no action"
1397
+ },
1398
+ "transaction_agent_id_agent_id_fk": {
1399
+ "name": "transaction_agent_id_agent_id_fk",
1400
+ "tableFrom": "transaction",
1401
+ "tableTo": "agent",
1402
+ "columnsFrom": ["agent_id"],
1403
+ "columnsTo": ["id"],
1404
+ "onDelete": "set null",
1405
+ "onUpdate": "no action"
1406
+ }
1407
+ },
1408
+ "compositePrimaryKeys": {},
1409
+ "uniqueConstraints": {},
1410
+ "policies": {},
1411
+ "checkConstraints": {},
1412
+ "isRLSEnabled": false
1413
+ },
1414
+ "public.wallet": {
1415
+ "name": "wallet",
1416
+ "schema": "",
1417
+ "columns": {
1418
+ "id": {
1419
+ "name": "id",
1420
+ "type": "text",
1421
+ "primaryKey": true,
1422
+ "notNull": true
1423
+ },
1424
+ "tenant_id": {
1425
+ "name": "tenant_id",
1426
+ "type": "text",
1427
+ "primaryKey": false,
1428
+ "notNull": true
1429
+ },
1430
+ "name": {
1431
+ "name": "name",
1432
+ "type": "text",
1433
+ "primaryKey": false,
1434
+ "notNull": true
1435
+ },
1436
+ "backend_type": {
1437
+ "name": "backend_type",
1438
+ "type": "text",
1439
+ "primaryKey": false,
1440
+ "notNull": true
1441
+ },
1442
+ "currency": {
1443
+ "name": "currency",
1444
+ "type": "text",
1445
+ "primaryKey": false,
1446
+ "notNull": true
1447
+ },
1448
+ "balance": {
1449
+ "name": "balance",
1450
+ "type": "text",
1451
+ "primaryKey": false,
1452
+ "notNull": true,
1453
+ "default": "'0'"
1454
+ },
1455
+ "config": {
1456
+ "name": "config",
1457
+ "type": "jsonb",
1458
+ "primaryKey": false,
1459
+ "notNull": false
1460
+ },
1461
+ "created_at": {
1462
+ "name": "created_at",
1463
+ "type": "timestamp",
1464
+ "primaryKey": false,
1465
+ "notNull": true,
1466
+ "default": "now()"
1467
+ },
1468
+ "updated_at": {
1469
+ "name": "updated_at",
1470
+ "type": "timestamp",
1471
+ "primaryKey": false,
1472
+ "notNull": true,
1473
+ "default": "now()"
1474
+ }
1475
+ },
1476
+ "indexes": {},
1477
+ "foreignKeys": {
1478
+ "wallet_tenant_id_tenant_id_fk": {
1479
+ "name": "wallet_tenant_id_tenant_id_fk",
1480
+ "tableFrom": "wallet",
1481
+ "tableTo": "tenant",
1482
+ "columnsFrom": ["tenant_id"],
1483
+ "columnsTo": ["id"],
1484
+ "onDelete": "cascade",
1485
+ "onUpdate": "no action"
1486
+ }
1487
+ },
1488
+ "compositePrimaryKeys": {},
1489
+ "uniqueConstraints": {},
1490
+ "policies": {},
1491
+ "checkConstraints": {},
1492
+ "isRLSEnabled": false
1493
+ },
1494
+ "public.offering": {
1495
+ "name": "offering",
1496
+ "schema": "",
1497
+ "columns": {
1498
+ "id": {
1499
+ "name": "id",
1500
+ "type": "text",
1501
+ "primaryKey": true,
1502
+ "notNull": true
1503
+ },
1504
+ "agent_id": {
1505
+ "name": "agent_id",
1506
+ "type": "text",
1507
+ "primaryKey": false,
1508
+ "notNull": true
1509
+ },
1510
+ "tenant_id": {
1511
+ "name": "tenant_id",
1512
+ "type": "text",
1513
+ "primaryKey": false,
1514
+ "notNull": true
1515
+ },
1516
+ "name": {
1517
+ "name": "name",
1518
+ "type": "text",
1519
+ "primaryKey": false,
1520
+ "notNull": true
1521
+ },
1522
+ "description": {
1523
+ "name": "description",
1524
+ "type": "text",
1525
+ "primaryKey": false,
1526
+ "notNull": false
1527
+ },
1528
+ "pricing": {
1529
+ "name": "pricing",
1530
+ "type": "jsonb",
1531
+ "primaryKey": false,
1532
+ "notNull": false
1533
+ },
1534
+ "schema": {
1535
+ "name": "schema",
1536
+ "type": "jsonb",
1537
+ "primaryKey": false,
1538
+ "notNull": false
1539
+ },
1540
+ "created_at": {
1541
+ "name": "created_at",
1542
+ "type": "timestamp",
1543
+ "primaryKey": false,
1544
+ "notNull": true,
1545
+ "default": "now()"
1546
+ },
1547
+ "updated_at": {
1548
+ "name": "updated_at",
1549
+ "type": "timestamp",
1550
+ "primaryKey": false,
1551
+ "notNull": true,
1552
+ "default": "now()"
1553
+ }
1554
+ },
1555
+ "indexes": {},
1556
+ "foreignKeys": {
1557
+ "offering_agent_id_agent_id_fk": {
1558
+ "name": "offering_agent_id_agent_id_fk",
1559
+ "tableFrom": "offering",
1560
+ "tableTo": "agent",
1561
+ "columnsFrom": ["agent_id"],
1562
+ "columnsTo": ["id"],
1563
+ "onDelete": "cascade",
1564
+ "onUpdate": "no action"
1565
+ },
1566
+ "offering_tenant_id_tenant_id_fk": {
1567
+ "name": "offering_tenant_id_tenant_id_fk",
1568
+ "tableFrom": "offering",
1569
+ "tableTo": "tenant",
1570
+ "columnsFrom": ["tenant_id"],
1571
+ "columnsTo": ["id"],
1572
+ "onDelete": "cascade",
1573
+ "onUpdate": "no action"
1574
+ }
1575
+ },
1576
+ "compositePrimaryKeys": {},
1577
+ "uniqueConstraints": {},
1578
+ "policies": {},
1579
+ "checkConstraints": {},
1580
+ "isRLSEnabled": false
1581
+ }
1582
+ },
1583
+ "enums": {},
1584
+ "schemas": {},
1585
+ "sequences": {},
1586
+ "roles": {},
1587
+ "policies": {},
1588
+ "views": {},
1589
+ "_meta": {
1590
+ "columns": {},
1591
+ "schemas": {},
1592
+ "tables": {}
1593
+ }
1594
+ }