@intelligo-dev/core 1.0.0-beta.1

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 (254) hide show
  1. package/LICENSE +201 -0
  2. package/dist/conversations/errors.d.ts +31 -0
  3. package/dist/conversations/errors.d.ts.map +1 -0
  4. package/dist/conversations/errors.js +25 -0
  5. package/dist/conversations/errors.js.map +1 -0
  6. package/dist/conversations/index.d.ts +13 -0
  7. package/dist/conversations/index.d.ts.map +1 -0
  8. package/dist/conversations/index.js +12 -0
  9. package/dist/conversations/index.js.map +1 -0
  10. package/dist/conversations/service.d.ts +132 -0
  11. package/dist/conversations/service.d.ts.map +1 -0
  12. package/dist/conversations/service.js +347 -0
  13. package/dist/conversations/service.js.map +1 -0
  14. package/dist/conversations/types.d.ts +10 -0
  15. package/dist/conversations/types.d.ts.map +1 -0
  16. package/dist/conversations/types.js +5 -0
  17. package/dist/conversations/types.js.map +1 -0
  18. package/dist/db/client.d.ts +19 -0
  19. package/dist/db/client.d.ts.map +1 -0
  20. package/dist/db/client.js +52 -0
  21. package/dist/db/client.js.map +1 -0
  22. package/dist/db/index.d.ts +4 -0
  23. package/dist/db/index.d.ts.map +1 -0
  24. package/dist/db/index.js +8 -0
  25. package/dist/db/index.js.map +1 -0
  26. package/dist/db/schema/agents.d.ts +400 -0
  27. package/dist/db/schema/agents.d.ts.map +1 -0
  28. package/dist/db/schema/agents.js +39 -0
  29. package/dist/db/schema/agents.js.map +1 -0
  30. package/dist/db/schema/ai.d.ts +2222 -0
  31. package/dist/db/schema/ai.d.ts.map +1 -0
  32. package/dist/db/schema/ai.js +313 -0
  33. package/dist/db/schema/ai.js.map +1 -0
  34. package/dist/db/schema/auth.d.ts +1222 -0
  35. package/dist/db/schema/auth.d.ts.map +1 -0
  36. package/dist/db/schema/auth.js +162 -0
  37. package/dist/db/schema/auth.js.map +1 -0
  38. package/dist/db/schema/billing.d.ts +1199 -0
  39. package/dist/db/schema/billing.d.ts.map +1 -0
  40. package/dist/db/schema/billing.js +150 -0
  41. package/dist/db/schema/billing.js.map +1 -0
  42. package/dist/db/schema/feature-flags.d.ts +143 -0
  43. package/dist/db/schema/feature-flags.d.ts.map +1 -0
  44. package/dist/db/schema/feature-flags.js +25 -0
  45. package/dist/db/schema/feature-flags.js.map +1 -0
  46. package/dist/db/schema/identity.d.ts +1295 -0
  47. package/dist/db/schema/identity.d.ts.map +1 -0
  48. package/dist/db/schema/identity.js +258 -0
  49. package/dist/db/schema/identity.js.map +1 -0
  50. package/dist/db/schema/index.d.ts +16 -0
  51. package/dist/db/schema/index.d.ts.map +1 -0
  52. package/dist/db/schema/index.js +43 -0
  53. package/dist/db/schema/index.js.map +1 -0
  54. package/dist/db/schema/notifications.d.ts +182 -0
  55. package/dist/db/schema/notifications.d.ts.map +1 -0
  56. package/dist/db/schema/notifications.js +38 -0
  57. package/dist/db/schema/notifications.js.map +1 -0
  58. package/dist/db/schema/rag.d.ts +171 -0
  59. package/dist/db/schema/rag.d.ts.map +1 -0
  60. package/dist/db/schema/rag.js +42 -0
  61. package/dist/db/schema/rag.js.map +1 -0
  62. package/dist/db/schema/usage.d.ts +1193 -0
  63. package/dist/db/schema/usage.d.ts.map +1 -0
  64. package/dist/db/schema/usage.js +224 -0
  65. package/dist/db/schema/usage.js.map +1 -0
  66. package/dist/db/validate.d.ts +19 -0
  67. package/dist/db/validate.d.ts.map +1 -0
  68. package/dist/db/validate.js +58 -0
  69. package/dist/db/validate.js.map +1 -0
  70. package/dist/db/workspace-queries.d.ts +75 -0
  71. package/dist/db/workspace-queries.d.ts.map +1 -0
  72. package/dist/db/workspace-queries.js +78 -0
  73. package/dist/db/workspace-queries.js.map +1 -0
  74. package/dist/documents/classifier.d.ts +31 -0
  75. package/dist/documents/classifier.d.ts.map +1 -0
  76. package/dist/documents/classifier.js +41 -0
  77. package/dist/documents/classifier.js.map +1 -0
  78. package/dist/documents/errors.d.ts +32 -0
  79. package/dist/documents/errors.d.ts.map +1 -0
  80. package/dist/documents/errors.js +27 -0
  81. package/dist/documents/errors.js.map +1 -0
  82. package/dist/documents/index.d.ts +14 -0
  83. package/dist/documents/index.d.ts.map +1 -0
  84. package/dist/documents/index.js +13 -0
  85. package/dist/documents/index.js.map +1 -0
  86. package/dist/documents/service.d.ts +54 -0
  87. package/dist/documents/service.d.ts.map +1 -0
  88. package/dist/documents/service.js +146 -0
  89. package/dist/documents/service.js.map +1 -0
  90. package/dist/documents/types.d.ts +27 -0
  91. package/dist/documents/types.d.ts.map +1 -0
  92. package/dist/documents/types.js +5 -0
  93. package/dist/documents/types.js.map +1 -0
  94. package/dist/email/index.d.ts +5 -0
  95. package/dist/email/index.d.ts.map +1 -0
  96. package/dist/email/index.js +5 -0
  97. package/dist/email/index.js.map +1 -0
  98. package/dist/email/provider.d.ts +68 -0
  99. package/dist/email/provider.d.ts.map +1 -0
  100. package/dist/email/provider.js +199 -0
  101. package/dist/email/provider.js.map +1 -0
  102. package/dist/email/send.d.ts +47 -0
  103. package/dist/email/send.d.ts.map +1 -0
  104. package/dist/email/send.js +110 -0
  105. package/dist/email/send.js.map +1 -0
  106. package/dist/email/senders.d.ts +93 -0
  107. package/dist/email/senders.d.ts.map +1 -0
  108. package/dist/email/senders.js +232 -0
  109. package/dist/email/senders.js.map +1 -0
  110. package/dist/email/templates/base-layout.d.ts +7 -0
  111. package/dist/email/templates/base-layout.d.ts.map +1 -0
  112. package/dist/email/templates/base-layout.js +69 -0
  113. package/dist/email/templates/base-layout.js.map +1 -0
  114. package/dist/email/templates/index.d.ts +11 -0
  115. package/dist/email/templates/index.d.ts.map +1 -0
  116. package/dist/email/templates/index.js +17 -0
  117. package/dist/email/templates/index.js.map +1 -0
  118. package/dist/email/templates/password-reset.d.ts +7 -0
  119. package/dist/email/templates/password-reset.d.ts.map +1 -0
  120. package/dist/email/templates/password-reset.js +59 -0
  121. package/dist/email/templates/password-reset.js.map +1 -0
  122. package/dist/email/templates/payment-failed.d.ts +8 -0
  123. package/dist/email/templates/payment-failed.d.ts.map +1 -0
  124. package/dist/email/templates/payment-failed.js +62 -0
  125. package/dist/email/templates/payment-failed.js.map +1 -0
  126. package/dist/email/templates/quota-warning.d.ts +11 -0
  127. package/dist/email/templates/quota-warning.d.ts.map +1 -0
  128. package/dist/email/templates/quota-warning.js +82 -0
  129. package/dist/email/templates/quota-warning.js.map +1 -0
  130. package/dist/email/templates/subscription-confirmed.d.ts +9 -0
  131. package/dist/email/templates/subscription-confirmed.d.ts.map +1 -0
  132. package/dist/email/templates/subscription-confirmed.js +72 -0
  133. package/dist/email/templates/subscription-confirmed.js.map +1 -0
  134. package/dist/email/templates/trial-expiry.d.ts +9 -0
  135. package/dist/email/templates/trial-expiry.d.ts.map +1 -0
  136. package/dist/email/templates/trial-expiry.js +86 -0
  137. package/dist/email/templates/trial-expiry.js.map +1 -0
  138. package/dist/email/templates/trial-warning.d.ts +11 -0
  139. package/dist/email/templates/trial-warning.d.ts.map +1 -0
  140. package/dist/email/templates/trial-warning.js +70 -0
  141. package/dist/email/templates/trial-warning.js.map +1 -0
  142. package/dist/email/templates/verify-email.d.ts +7 -0
  143. package/dist/email/templates/verify-email.d.ts.map +1 -0
  144. package/dist/email/templates/verify-email.js +59 -0
  145. package/dist/email/templates/verify-email.js.map +1 -0
  146. package/dist/email/templates/welcome.d.ts +7 -0
  147. package/dist/email/templates/welcome.d.ts.map +1 -0
  148. package/dist/email/templates/welcome.js +51 -0
  149. package/dist/email/templates/welcome.js.map +1 -0
  150. package/dist/email/templates/workspace-invitation.d.ts +10 -0
  151. package/dist/email/templates/workspace-invitation.d.ts.map +1 -0
  152. package/dist/email/templates/workspace-invitation.js +79 -0
  153. package/dist/email/templates/workspace-invitation.js.map +1 -0
  154. package/dist/env.d.ts +21 -0
  155. package/dist/env.d.ts.map +1 -0
  156. package/dist/env.js +129 -0
  157. package/dist/env.js.map +1 -0
  158. package/dist/identity/audit.d.ts +39 -0
  159. package/dist/identity/audit.d.ts.map +1 -0
  160. package/dist/identity/audit.js +51 -0
  161. package/dist/identity/audit.js.map +1 -0
  162. package/dist/identity/errors.d.ts +32 -0
  163. package/dist/identity/errors.d.ts.map +1 -0
  164. package/dist/identity/errors.js +25 -0
  165. package/dist/identity/errors.js.map +1 -0
  166. package/dist/identity/index.d.ts +16 -0
  167. package/dist/identity/index.d.ts.map +1 -0
  168. package/dist/identity/index.js +15 -0
  169. package/dist/identity/index.js.map +1 -0
  170. package/dist/identity/service.d.ts +70 -0
  171. package/dist/identity/service.d.ts.map +1 -0
  172. package/dist/identity/service.js +179 -0
  173. package/dist/identity/service.js.map +1 -0
  174. package/dist/identity/types.d.ts +27 -0
  175. package/dist/identity/types.d.ts.map +1 -0
  176. package/dist/identity/types.js +5 -0
  177. package/dist/identity/types.js.map +1 -0
  178. package/dist/index.d.ts +3 -0
  179. package/dist/index.d.ts.map +1 -0
  180. package/dist/index.js +11 -0
  181. package/dist/index.js.map +1 -0
  182. package/dist/logger.d.ts +50 -0
  183. package/dist/logger.d.ts.map +1 -0
  184. package/dist/logger.js +183 -0
  185. package/dist/logger.js.map +1 -0
  186. package/dist/notifications/index.d.ts +86 -0
  187. package/dist/notifications/index.d.ts.map +1 -0
  188. package/dist/notifications/index.js +112 -0
  189. package/dist/notifications/index.js.map +1 -0
  190. package/dist/notifications/triggers.d.ts +68 -0
  191. package/dist/notifications/triggers.d.ts.map +1 -0
  192. package/dist/notifications/triggers.js +145 -0
  193. package/dist/notifications/triggers.js.map +1 -0
  194. package/dist/notifications/types.d.ts +19 -0
  195. package/dist/notifications/types.d.ts.map +1 -0
  196. package/dist/notifications/types.js +11 -0
  197. package/dist/notifications/types.js.map +1 -0
  198. package/package.json +101 -0
  199. package/src/db/migrations/0000_sharp_night_nurse.sql +52 -0
  200. package/src/db/migrations/0001_hesitant_vapor.sql +40 -0
  201. package/src/db/migrations/0002_numerous_lady_vermin.sql +235 -0
  202. package/src/db/migrations/0003_mighty_jean_grey.sql +37 -0
  203. package/src/db/migrations/0004_cynical_grandmaster.sql +2 -0
  204. package/src/db/migrations/0005_careful_switch.sql +8 -0
  205. package/src/db/migrations/0006_tense_blue_marvel.sql +16 -0
  206. package/src/db/migrations/0007_next_squadron_sinister.sql +1 -0
  207. package/src/db/migrations/0008_powerful_scream.sql +39 -0
  208. package/src/db/migrations/0009_sad_ink.sql +1 -0
  209. package/src/db/migrations/0010_shocking_omega_flight.sql +2 -0
  210. package/src/db/migrations/0011_ambiguous_otto_octavius.sql +151 -0
  211. package/src/db/migrations/0011_hnsw_vector_index.sql +17 -0
  212. package/src/db/migrations/0012_user_profiles.sql +30 -0
  213. package/src/db/migrations/0013_trending_seasonal_columns.sql +9 -0
  214. package/src/db/migrations/0014_add_product_type_to_agents.sql +6 -0
  215. package/src/db/migrations/0015_new_v1_tables.sql +149 -0
  216. package/src/db/migrations/0016_document_types.sql +30 -0
  217. package/src/db/migrations/0017_document_metadata.sql +2 -0
  218. package/src/db/migrations/0018_identity_graph.sql +200 -0
  219. package/src/db/migrations/0019_db_driven_prompts.sql +20 -0
  220. package/src/db/migrations/0020_pending_extractions.sql +35 -0
  221. package/src/db/migrations/0021_rag_documents.sql +39 -0
  222. package/src/db/migrations/0022_user_quotas_usage_jsonb.sql +70 -0
  223. package/src/db/migrations/0023_user_facts_user_scoped_unique.sql +17 -0
  224. package/src/db/migrations/0024_user_memories_hnsw.sql +23 -0
  225. package/src/db/migrations/0025_audit_trigger_errcode.sql +21 -0
  226. package/src/db/migrations/0026_user_profile_snapshots_composite_pk.sql +17 -0
  227. package/src/db/migrations/0027_billing_settings_mnt_columns.sql +54 -0
  228. package/src/db/migrations/0028_trial_credits_normalized_email.sql +37 -0
  229. package/src/db/migrations/0029_usage_records_conversation_idx.sql +13 -0
  230. package/src/db/migrations/0030_pending_extractions_composite_idx.sql +11 -0
  231. package/src/db/migrations/0031_rag_documents_hnsw.sql +16 -0
  232. package/src/db/migrations/0032_rate_limit_unique_idx.sql +16 -0
  233. package/src/db/migrations/0033_pending_extractions_partial_idx.sql +18 -0
  234. package/src/db/migrations/0034_rate_limit_count.sql +9 -0
  235. package/src/db/migrations/0035_credit_reservations.sql +24 -0
  236. package/src/db/migrations/0036_executions_audit_jobs.sql +96 -0
  237. package/src/db/migrations/0037_rate_limit_minute_bucket.sql +46 -0
  238. package/src/db/migrations/0038_user_quotas_generic_usage.sql +25 -0
  239. package/src/db/migrations/0039_platform_admin_impersonation.sql +27 -0
  240. package/src/db/migrations/0040_ee_audit_chain.sql +23 -0
  241. package/src/db/migrations/README.md +57 -0
  242. package/src/db/migrations/meta/0000_snapshot.json +348 -0
  243. package/src/db/migrations/meta/0001_snapshot.json +631 -0
  244. package/src/db/migrations/meta/0002_snapshot.json +2269 -0
  245. package/src/db/migrations/meta/0003_snapshot.json +2488 -0
  246. package/src/db/migrations/meta/0004_snapshot.json +2500 -0
  247. package/src/db/migrations/meta/0005_snapshot.json +2548 -0
  248. package/src/db/migrations/meta/0006_snapshot.json +2650 -0
  249. package/src/db/migrations/meta/0007_snapshot.json +2657 -0
  250. package/src/db/migrations/meta/0008_snapshot.json +2719 -0
  251. package/src/db/migrations/meta/0009_snapshot.json +2726 -0
  252. package/src/db/migrations/meta/0010_snapshot.json +2739 -0
  253. package/src/db/migrations/meta/0011_snapshot.json +3886 -0
  254. package/src/db/migrations/meta/_journal.json +300 -0
@@ -0,0 +1,2719 @@
1
+ {
2
+ "id": "0c83d0d8-06c4-4a5f-996c-7a72ce55c8fc",
3
+ "prevId": "fdd1a6da-d0ea-4a0d-8656-124fc5c8f32e",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.agents": {
8
+ "name": "agents",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "name": {
18
+ "name": "name",
19
+ "type": "jsonb",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "description": {
24
+ "name": "description",
25
+ "type": "jsonb",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "system_prompt_key": {
30
+ "name": "system_prompt_key",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "icon": {
36
+ "name": "icon",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "default_model": {
42
+ "name": "default_model",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": true
46
+ },
47
+ "max_steps": {
48
+ "name": "max_steps",
49
+ "type": "integer",
50
+ "primaryKey": false,
51
+ "notNull": true
52
+ },
53
+ "context_window_size": {
54
+ "name": "context_window_size",
55
+ "type": "integer",
56
+ "primaryKey": false,
57
+ "notNull": true
58
+ },
59
+ "tools": {
60
+ "name": "tools",
61
+ "type": "jsonb",
62
+ "primaryKey": false,
63
+ "notNull": true,
64
+ "default": "'[]'::jsonb"
65
+ },
66
+ "base_path": {
67
+ "name": "base_path",
68
+ "type": "text",
69
+ "primaryKey": false,
70
+ "notNull": true
71
+ },
72
+ "is_active": {
73
+ "name": "is_active",
74
+ "type": "boolean",
75
+ "primaryKey": false,
76
+ "notNull": true,
77
+ "default": true
78
+ },
79
+ "suggestions": {
80
+ "name": "suggestions",
81
+ "type": "jsonb",
82
+ "primaryKey": false,
83
+ "notNull": true,
84
+ "default": "'[]'::jsonb"
85
+ },
86
+ "is_system": {
87
+ "name": "is_system",
88
+ "type": "boolean",
89
+ "primaryKey": false,
90
+ "notNull": true,
91
+ "default": true
92
+ },
93
+ "created_at": {
94
+ "name": "created_at",
95
+ "type": "timestamp",
96
+ "primaryKey": false,
97
+ "notNull": true,
98
+ "default": "now()"
99
+ },
100
+ "updated_at": {
101
+ "name": "updated_at",
102
+ "type": "timestamp",
103
+ "primaryKey": false,
104
+ "notNull": true,
105
+ "default": "now()"
106
+ }
107
+ },
108
+ "indexes": {},
109
+ "foreignKeys": {},
110
+ "compositePrimaryKeys": {},
111
+ "uniqueConstraints": {},
112
+ "policies": {},
113
+ "checkConstraints": {},
114
+ "isRLSEnabled": false
115
+ },
116
+ "public.conversations": {
117
+ "name": "conversations",
118
+ "schema": "",
119
+ "columns": {
120
+ "id": {
121
+ "name": "id",
122
+ "type": "text",
123
+ "primaryKey": true,
124
+ "notNull": true
125
+ },
126
+ "workspace_id": {
127
+ "name": "workspace_id",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": true
131
+ },
132
+ "user_id": {
133
+ "name": "user_id",
134
+ "type": "text",
135
+ "primaryKey": false,
136
+ "notNull": true
137
+ },
138
+ "agent_id": {
139
+ "name": "agent_id",
140
+ "type": "text",
141
+ "primaryKey": false,
142
+ "notNull": true
143
+ },
144
+ "title": {
145
+ "name": "title",
146
+ "type": "text",
147
+ "primaryKey": false,
148
+ "notNull": false
149
+ },
150
+ "model_id": {
151
+ "name": "model_id",
152
+ "type": "text",
153
+ "primaryKey": false,
154
+ "notNull": false
155
+ },
156
+ "visibility": {
157
+ "name": "visibility",
158
+ "type": "text",
159
+ "primaryKey": false,
160
+ "notNull": true,
161
+ "default": "'private'"
162
+ },
163
+ "metadata": {
164
+ "name": "metadata",
165
+ "type": "text",
166
+ "primaryKey": false,
167
+ "notNull": false
168
+ },
169
+ "created_at": {
170
+ "name": "created_at",
171
+ "type": "timestamp",
172
+ "primaryKey": false,
173
+ "notNull": true,
174
+ "default": "now()"
175
+ },
176
+ "updated_at": {
177
+ "name": "updated_at",
178
+ "type": "timestamp",
179
+ "primaryKey": false,
180
+ "notNull": true,
181
+ "default": "now()"
182
+ }
183
+ },
184
+ "indexes": {
185
+ "conversations_workspace_id_idx": {
186
+ "name": "conversations_workspace_id_idx",
187
+ "columns": [
188
+ {
189
+ "expression": "workspace_id",
190
+ "isExpression": false,
191
+ "asc": true,
192
+ "nulls": "last"
193
+ }
194
+ ],
195
+ "isUnique": false,
196
+ "concurrently": false,
197
+ "method": "btree",
198
+ "with": {}
199
+ },
200
+ "conversations_user_id_idx": {
201
+ "name": "conversations_user_id_idx",
202
+ "columns": [
203
+ {
204
+ "expression": "user_id",
205
+ "isExpression": false,
206
+ "asc": true,
207
+ "nulls": "last"
208
+ }
209
+ ],
210
+ "isUnique": false,
211
+ "concurrently": false,
212
+ "method": "btree",
213
+ "with": {}
214
+ },
215
+ "conversations_workspace_updated_idx": {
216
+ "name": "conversations_workspace_updated_idx",
217
+ "columns": [
218
+ {
219
+ "expression": "workspace_id",
220
+ "isExpression": false,
221
+ "asc": true,
222
+ "nulls": "last"
223
+ },
224
+ {
225
+ "expression": "updated_at",
226
+ "isExpression": false,
227
+ "asc": true,
228
+ "nulls": "last"
229
+ }
230
+ ],
231
+ "isUnique": false,
232
+ "concurrently": false,
233
+ "method": "btree",
234
+ "with": {}
235
+ }
236
+ },
237
+ "foreignKeys": {
238
+ "conversations_workspace_id_organization_id_fk": {
239
+ "name": "conversations_workspace_id_organization_id_fk",
240
+ "tableFrom": "conversations",
241
+ "tableTo": "organization",
242
+ "columnsFrom": ["workspace_id"],
243
+ "columnsTo": ["id"],
244
+ "onDelete": "cascade",
245
+ "onUpdate": "no action"
246
+ },
247
+ "conversations_user_id_users_id_fk": {
248
+ "name": "conversations_user_id_users_id_fk",
249
+ "tableFrom": "conversations",
250
+ "tableTo": "users",
251
+ "columnsFrom": ["user_id"],
252
+ "columnsTo": ["id"],
253
+ "onDelete": "cascade",
254
+ "onUpdate": "no action"
255
+ }
256
+ },
257
+ "compositePrimaryKeys": {},
258
+ "uniqueConstraints": {},
259
+ "policies": {},
260
+ "checkConstraints": {},
261
+ "isRLSEnabled": false
262
+ },
263
+ "public.documents": {
264
+ "name": "documents",
265
+ "schema": "",
266
+ "columns": {
267
+ "id": {
268
+ "name": "id",
269
+ "type": "text",
270
+ "primaryKey": false,
271
+ "notNull": true
272
+ },
273
+ "created_at": {
274
+ "name": "created_at",
275
+ "type": "timestamp",
276
+ "primaryKey": false,
277
+ "notNull": true,
278
+ "default": "now()"
279
+ },
280
+ "title": {
281
+ "name": "title",
282
+ "type": "text",
283
+ "primaryKey": false,
284
+ "notNull": true
285
+ },
286
+ "content": {
287
+ "name": "content",
288
+ "type": "text",
289
+ "primaryKey": false,
290
+ "notNull": false
291
+ },
292
+ "kind": {
293
+ "name": "kind",
294
+ "type": "text",
295
+ "primaryKey": false,
296
+ "notNull": true,
297
+ "default": "'text'"
298
+ },
299
+ "user_id": {
300
+ "name": "user_id",
301
+ "type": "text",
302
+ "primaryKey": false,
303
+ "notNull": true
304
+ },
305
+ "workspace_id": {
306
+ "name": "workspace_id",
307
+ "type": "text",
308
+ "primaryKey": false,
309
+ "notNull": true
310
+ }
311
+ },
312
+ "indexes": {
313
+ "documents_workspace_id_idx": {
314
+ "name": "documents_workspace_id_idx",
315
+ "columns": [
316
+ {
317
+ "expression": "workspace_id",
318
+ "isExpression": false,
319
+ "asc": true,
320
+ "nulls": "last"
321
+ }
322
+ ],
323
+ "isUnique": false,
324
+ "concurrently": false,
325
+ "method": "btree",
326
+ "with": {}
327
+ }
328
+ },
329
+ "foreignKeys": {
330
+ "documents_user_id_users_id_fk": {
331
+ "name": "documents_user_id_users_id_fk",
332
+ "tableFrom": "documents",
333
+ "tableTo": "users",
334
+ "columnsFrom": ["user_id"],
335
+ "columnsTo": ["id"],
336
+ "onDelete": "cascade",
337
+ "onUpdate": "no action"
338
+ },
339
+ "documents_workspace_id_organization_id_fk": {
340
+ "name": "documents_workspace_id_organization_id_fk",
341
+ "tableFrom": "documents",
342
+ "tableTo": "organization",
343
+ "columnsFrom": ["workspace_id"],
344
+ "columnsTo": ["id"],
345
+ "onDelete": "cascade",
346
+ "onUpdate": "no action"
347
+ }
348
+ },
349
+ "compositePrimaryKeys": {
350
+ "documents_id_created_at_pk": {
351
+ "name": "documents_id_created_at_pk",
352
+ "columns": ["id", "created_at"]
353
+ }
354
+ },
355
+ "uniqueConstraints": {},
356
+ "policies": {},
357
+ "checkConstraints": {},
358
+ "isRLSEnabled": false
359
+ },
360
+ "public.knowledge_chunks": {
361
+ "name": "knowledge_chunks",
362
+ "schema": "",
363
+ "columns": {
364
+ "id": {
365
+ "name": "id",
366
+ "type": "text",
367
+ "primaryKey": true,
368
+ "notNull": true
369
+ },
370
+ "document_id": {
371
+ "name": "document_id",
372
+ "type": "text",
373
+ "primaryKey": false,
374
+ "notNull": true
375
+ },
376
+ "workspace_id": {
377
+ "name": "workspace_id",
378
+ "type": "text",
379
+ "primaryKey": false,
380
+ "notNull": true
381
+ },
382
+ "content": {
383
+ "name": "content",
384
+ "type": "text",
385
+ "primaryKey": false,
386
+ "notNull": true
387
+ },
388
+ "embedding": {
389
+ "name": "embedding",
390
+ "type": "vector(1536)",
391
+ "primaryKey": false,
392
+ "notNull": false
393
+ },
394
+ "metadata": {
395
+ "name": "metadata",
396
+ "type": "text",
397
+ "primaryKey": false,
398
+ "notNull": false
399
+ },
400
+ "chunk_index": {
401
+ "name": "chunk_index",
402
+ "type": "integer",
403
+ "primaryKey": false,
404
+ "notNull": true
405
+ },
406
+ "created_at": {
407
+ "name": "created_at",
408
+ "type": "timestamp",
409
+ "primaryKey": false,
410
+ "notNull": true,
411
+ "default": "now()"
412
+ }
413
+ },
414
+ "indexes": {
415
+ "knowledge_chunks_document_id_idx": {
416
+ "name": "knowledge_chunks_document_id_idx",
417
+ "columns": [
418
+ {
419
+ "expression": "document_id",
420
+ "isExpression": false,
421
+ "asc": true,
422
+ "nulls": "last"
423
+ }
424
+ ],
425
+ "isUnique": false,
426
+ "concurrently": false,
427
+ "method": "btree",
428
+ "with": {}
429
+ },
430
+ "knowledge_chunks_workspace_id_idx": {
431
+ "name": "knowledge_chunks_workspace_id_idx",
432
+ "columns": [
433
+ {
434
+ "expression": "workspace_id",
435
+ "isExpression": false,
436
+ "asc": true,
437
+ "nulls": "last"
438
+ }
439
+ ],
440
+ "isUnique": false,
441
+ "concurrently": false,
442
+ "method": "btree",
443
+ "with": {}
444
+ }
445
+ },
446
+ "foreignKeys": {
447
+ "knowledge_chunks_document_id_knowledge_documents_id_fk": {
448
+ "name": "knowledge_chunks_document_id_knowledge_documents_id_fk",
449
+ "tableFrom": "knowledge_chunks",
450
+ "tableTo": "knowledge_documents",
451
+ "columnsFrom": ["document_id"],
452
+ "columnsTo": ["id"],
453
+ "onDelete": "cascade",
454
+ "onUpdate": "no action"
455
+ },
456
+ "knowledge_chunks_workspace_id_organization_id_fk": {
457
+ "name": "knowledge_chunks_workspace_id_organization_id_fk",
458
+ "tableFrom": "knowledge_chunks",
459
+ "tableTo": "organization",
460
+ "columnsFrom": ["workspace_id"],
461
+ "columnsTo": ["id"],
462
+ "onDelete": "cascade",
463
+ "onUpdate": "no action"
464
+ }
465
+ },
466
+ "compositePrimaryKeys": {},
467
+ "uniqueConstraints": {},
468
+ "policies": {},
469
+ "checkConstraints": {},
470
+ "isRLSEnabled": false
471
+ },
472
+ "public.knowledge_documents": {
473
+ "name": "knowledge_documents",
474
+ "schema": "",
475
+ "columns": {
476
+ "id": {
477
+ "name": "id",
478
+ "type": "text",
479
+ "primaryKey": true,
480
+ "notNull": true
481
+ },
482
+ "workspace_id": {
483
+ "name": "workspace_id",
484
+ "type": "text",
485
+ "primaryKey": false,
486
+ "notNull": true
487
+ },
488
+ "filename": {
489
+ "name": "filename",
490
+ "type": "text",
491
+ "primaryKey": false,
492
+ "notNull": true
493
+ },
494
+ "mime_type": {
495
+ "name": "mime_type",
496
+ "type": "text",
497
+ "primaryKey": false,
498
+ "notNull": true
499
+ },
500
+ "size_bytes": {
501
+ "name": "size_bytes",
502
+ "type": "integer",
503
+ "primaryKey": false,
504
+ "notNull": false
505
+ },
506
+ "chunk_count": {
507
+ "name": "chunk_count",
508
+ "type": "integer",
509
+ "primaryKey": false,
510
+ "notNull": false,
511
+ "default": 0
512
+ },
513
+ "status": {
514
+ "name": "status",
515
+ "type": "text",
516
+ "primaryKey": false,
517
+ "notNull": true,
518
+ "default": "'processing'"
519
+ },
520
+ "product": {
521
+ "name": "product",
522
+ "type": "text",
523
+ "primaryKey": false,
524
+ "notNull": false
525
+ },
526
+ "metadata": {
527
+ "name": "metadata",
528
+ "type": "text",
529
+ "primaryKey": false,
530
+ "notNull": false
531
+ },
532
+ "created_at": {
533
+ "name": "created_at",
534
+ "type": "timestamp",
535
+ "primaryKey": false,
536
+ "notNull": true,
537
+ "default": "now()"
538
+ }
539
+ },
540
+ "indexes": {
541
+ "knowledge_documents_workspace_id_idx": {
542
+ "name": "knowledge_documents_workspace_id_idx",
543
+ "columns": [
544
+ {
545
+ "expression": "workspace_id",
546
+ "isExpression": false,
547
+ "asc": true,
548
+ "nulls": "last"
549
+ }
550
+ ],
551
+ "isUnique": false,
552
+ "concurrently": false,
553
+ "method": "btree",
554
+ "with": {}
555
+ }
556
+ },
557
+ "foreignKeys": {
558
+ "knowledge_documents_workspace_id_organization_id_fk": {
559
+ "name": "knowledge_documents_workspace_id_organization_id_fk",
560
+ "tableFrom": "knowledge_documents",
561
+ "tableTo": "organization",
562
+ "columnsFrom": ["workspace_id"],
563
+ "columnsTo": ["id"],
564
+ "onDelete": "cascade",
565
+ "onUpdate": "no action"
566
+ }
567
+ },
568
+ "compositePrimaryKeys": {},
569
+ "uniqueConstraints": {},
570
+ "policies": {},
571
+ "checkConstraints": {},
572
+ "isRLSEnabled": false
573
+ },
574
+ "public.messages": {
575
+ "name": "messages",
576
+ "schema": "",
577
+ "columns": {
578
+ "id": {
579
+ "name": "id",
580
+ "type": "text",
581
+ "primaryKey": true,
582
+ "notNull": true
583
+ },
584
+ "conversation_id": {
585
+ "name": "conversation_id",
586
+ "type": "text",
587
+ "primaryKey": false,
588
+ "notNull": true
589
+ },
590
+ "role": {
591
+ "name": "role",
592
+ "type": "text",
593
+ "primaryKey": false,
594
+ "notNull": true
595
+ },
596
+ "content": {
597
+ "name": "content",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": false
601
+ },
602
+ "parts": {
603
+ "name": "parts",
604
+ "type": "text",
605
+ "primaryKey": false,
606
+ "notNull": true
607
+ },
608
+ "attachments": {
609
+ "name": "attachments",
610
+ "type": "text",
611
+ "primaryKey": false,
612
+ "notNull": false
613
+ },
614
+ "tool_invocations": {
615
+ "name": "tool_invocations",
616
+ "type": "text",
617
+ "primaryKey": false,
618
+ "notNull": false
619
+ },
620
+ "token_count": {
621
+ "name": "token_count",
622
+ "type": "integer",
623
+ "primaryKey": false,
624
+ "notNull": false
625
+ },
626
+ "created_at": {
627
+ "name": "created_at",
628
+ "type": "timestamp",
629
+ "primaryKey": false,
630
+ "notNull": true,
631
+ "default": "now()"
632
+ }
633
+ },
634
+ "indexes": {
635
+ "messages_conversation_id_idx": {
636
+ "name": "messages_conversation_id_idx",
637
+ "columns": [
638
+ {
639
+ "expression": "conversation_id",
640
+ "isExpression": false,
641
+ "asc": true,
642
+ "nulls": "last"
643
+ }
644
+ ],
645
+ "isUnique": false,
646
+ "concurrently": false,
647
+ "method": "btree",
648
+ "with": {}
649
+ },
650
+ "messages_conversation_created_idx": {
651
+ "name": "messages_conversation_created_idx",
652
+ "columns": [
653
+ {
654
+ "expression": "conversation_id",
655
+ "isExpression": false,
656
+ "asc": true,
657
+ "nulls": "last"
658
+ },
659
+ {
660
+ "expression": "created_at",
661
+ "isExpression": false,
662
+ "asc": true,
663
+ "nulls": "last"
664
+ }
665
+ ],
666
+ "isUnique": false,
667
+ "concurrently": false,
668
+ "method": "btree",
669
+ "with": {}
670
+ }
671
+ },
672
+ "foreignKeys": {
673
+ "messages_conversation_id_conversations_id_fk": {
674
+ "name": "messages_conversation_id_conversations_id_fk",
675
+ "tableFrom": "messages",
676
+ "tableTo": "conversations",
677
+ "columnsFrom": ["conversation_id"],
678
+ "columnsTo": ["id"],
679
+ "onDelete": "cascade",
680
+ "onUpdate": "no action"
681
+ }
682
+ },
683
+ "compositePrimaryKeys": {},
684
+ "uniqueConstraints": {},
685
+ "policies": {},
686
+ "checkConstraints": {},
687
+ "isRLSEnabled": false
688
+ },
689
+ "public.suggestions": {
690
+ "name": "suggestions",
691
+ "schema": "",
692
+ "columns": {
693
+ "id": {
694
+ "name": "id",
695
+ "type": "text",
696
+ "primaryKey": true,
697
+ "notNull": true
698
+ },
699
+ "document_id": {
700
+ "name": "document_id",
701
+ "type": "text",
702
+ "primaryKey": false,
703
+ "notNull": true
704
+ },
705
+ "document_created_at": {
706
+ "name": "document_created_at",
707
+ "type": "timestamp",
708
+ "primaryKey": false,
709
+ "notNull": true
710
+ },
711
+ "original_text": {
712
+ "name": "original_text",
713
+ "type": "text",
714
+ "primaryKey": false,
715
+ "notNull": true
716
+ },
717
+ "suggested_text": {
718
+ "name": "suggested_text",
719
+ "type": "text",
720
+ "primaryKey": false,
721
+ "notNull": true
722
+ },
723
+ "description": {
724
+ "name": "description",
725
+ "type": "text",
726
+ "primaryKey": false,
727
+ "notNull": false
728
+ },
729
+ "is_resolved": {
730
+ "name": "is_resolved",
731
+ "type": "boolean",
732
+ "primaryKey": false,
733
+ "notNull": true,
734
+ "default": false
735
+ },
736
+ "user_id": {
737
+ "name": "user_id",
738
+ "type": "text",
739
+ "primaryKey": false,
740
+ "notNull": true
741
+ },
742
+ "workspace_id": {
743
+ "name": "workspace_id",
744
+ "type": "text",
745
+ "primaryKey": false,
746
+ "notNull": true
747
+ },
748
+ "created_at": {
749
+ "name": "created_at",
750
+ "type": "timestamp",
751
+ "primaryKey": false,
752
+ "notNull": true,
753
+ "default": "now()"
754
+ }
755
+ },
756
+ "indexes": {
757
+ "suggestions_workspace_id_idx": {
758
+ "name": "suggestions_workspace_id_idx",
759
+ "columns": [
760
+ {
761
+ "expression": "workspace_id",
762
+ "isExpression": false,
763
+ "asc": true,
764
+ "nulls": "last"
765
+ }
766
+ ],
767
+ "isUnique": false,
768
+ "concurrently": false,
769
+ "method": "btree",
770
+ "with": {}
771
+ }
772
+ },
773
+ "foreignKeys": {
774
+ "suggestions_user_id_users_id_fk": {
775
+ "name": "suggestions_user_id_users_id_fk",
776
+ "tableFrom": "suggestions",
777
+ "tableTo": "users",
778
+ "columnsFrom": ["user_id"],
779
+ "columnsTo": ["id"],
780
+ "onDelete": "cascade",
781
+ "onUpdate": "no action"
782
+ },
783
+ "suggestions_workspace_id_organization_id_fk": {
784
+ "name": "suggestions_workspace_id_organization_id_fk",
785
+ "tableFrom": "suggestions",
786
+ "tableTo": "organization",
787
+ "columnsFrom": ["workspace_id"],
788
+ "columnsTo": ["id"],
789
+ "onDelete": "cascade",
790
+ "onUpdate": "no action"
791
+ }
792
+ },
793
+ "compositePrimaryKeys": {},
794
+ "uniqueConstraints": {},
795
+ "policies": {},
796
+ "checkConstraints": {},
797
+ "isRLSEnabled": false
798
+ },
799
+ "public.votes": {
800
+ "name": "votes",
801
+ "schema": "",
802
+ "columns": {
803
+ "chat_id": {
804
+ "name": "chat_id",
805
+ "type": "text",
806
+ "primaryKey": false,
807
+ "notNull": true
808
+ },
809
+ "message_id": {
810
+ "name": "message_id",
811
+ "type": "text",
812
+ "primaryKey": false,
813
+ "notNull": true
814
+ },
815
+ "is_upvoted": {
816
+ "name": "is_upvoted",
817
+ "type": "boolean",
818
+ "primaryKey": false,
819
+ "notNull": true
820
+ }
821
+ },
822
+ "indexes": {},
823
+ "foreignKeys": {
824
+ "votes_chat_id_conversations_id_fk": {
825
+ "name": "votes_chat_id_conversations_id_fk",
826
+ "tableFrom": "votes",
827
+ "tableTo": "conversations",
828
+ "columnsFrom": ["chat_id"],
829
+ "columnsTo": ["id"],
830
+ "onDelete": "cascade",
831
+ "onUpdate": "no action"
832
+ },
833
+ "votes_message_id_messages_id_fk": {
834
+ "name": "votes_message_id_messages_id_fk",
835
+ "tableFrom": "votes",
836
+ "tableTo": "messages",
837
+ "columnsFrom": ["message_id"],
838
+ "columnsTo": ["id"],
839
+ "onDelete": "cascade",
840
+ "onUpdate": "no action"
841
+ }
842
+ },
843
+ "compositePrimaryKeys": {
844
+ "votes_chat_id_message_id_pk": {
845
+ "name": "votes_chat_id_message_id_pk",
846
+ "columns": ["chat_id", "message_id"]
847
+ }
848
+ },
849
+ "uniqueConstraints": {},
850
+ "policies": {},
851
+ "checkConstraints": {},
852
+ "isRLSEnabled": false
853
+ },
854
+ "public.accounts": {
855
+ "name": "accounts",
856
+ "schema": "",
857
+ "columns": {
858
+ "id": {
859
+ "name": "id",
860
+ "type": "text",
861
+ "primaryKey": true,
862
+ "notNull": true
863
+ },
864
+ "user_id": {
865
+ "name": "user_id",
866
+ "type": "text",
867
+ "primaryKey": false,
868
+ "notNull": true
869
+ },
870
+ "account_id": {
871
+ "name": "account_id",
872
+ "type": "text",
873
+ "primaryKey": false,
874
+ "notNull": true
875
+ },
876
+ "provider_id": {
877
+ "name": "provider_id",
878
+ "type": "text",
879
+ "primaryKey": false,
880
+ "notNull": true
881
+ },
882
+ "access_token": {
883
+ "name": "access_token",
884
+ "type": "text",
885
+ "primaryKey": false,
886
+ "notNull": false
887
+ },
888
+ "refresh_token": {
889
+ "name": "refresh_token",
890
+ "type": "text",
891
+ "primaryKey": false,
892
+ "notNull": false
893
+ },
894
+ "access_token_expires_at": {
895
+ "name": "access_token_expires_at",
896
+ "type": "timestamp",
897
+ "primaryKey": false,
898
+ "notNull": false
899
+ },
900
+ "refresh_token_expires_at": {
901
+ "name": "refresh_token_expires_at",
902
+ "type": "timestamp",
903
+ "primaryKey": false,
904
+ "notNull": false
905
+ },
906
+ "scope": {
907
+ "name": "scope",
908
+ "type": "text",
909
+ "primaryKey": false,
910
+ "notNull": false
911
+ },
912
+ "id_token": {
913
+ "name": "id_token",
914
+ "type": "text",
915
+ "primaryKey": false,
916
+ "notNull": false
917
+ },
918
+ "password": {
919
+ "name": "password",
920
+ "type": "text",
921
+ "primaryKey": false,
922
+ "notNull": false
923
+ },
924
+ "created_at": {
925
+ "name": "created_at",
926
+ "type": "timestamp",
927
+ "primaryKey": false,
928
+ "notNull": true,
929
+ "default": "now()"
930
+ },
931
+ "updated_at": {
932
+ "name": "updated_at",
933
+ "type": "timestamp",
934
+ "primaryKey": false,
935
+ "notNull": true,
936
+ "default": "now()"
937
+ }
938
+ },
939
+ "indexes": {
940
+ "accounts_user_id_idx": {
941
+ "name": "accounts_user_id_idx",
942
+ "columns": [
943
+ {
944
+ "expression": "user_id",
945
+ "isExpression": false,
946
+ "asc": true,
947
+ "nulls": "last"
948
+ }
949
+ ],
950
+ "isUnique": false,
951
+ "concurrently": false,
952
+ "method": "btree",
953
+ "with": {}
954
+ }
955
+ },
956
+ "foreignKeys": {
957
+ "accounts_user_id_users_id_fk": {
958
+ "name": "accounts_user_id_users_id_fk",
959
+ "tableFrom": "accounts",
960
+ "tableTo": "users",
961
+ "columnsFrom": ["user_id"],
962
+ "columnsTo": ["id"],
963
+ "onDelete": "cascade",
964
+ "onUpdate": "no action"
965
+ }
966
+ },
967
+ "compositePrimaryKeys": {},
968
+ "uniqueConstraints": {},
969
+ "policies": {},
970
+ "checkConstraints": {},
971
+ "isRLSEnabled": false
972
+ },
973
+ "public.invitation": {
974
+ "name": "invitation",
975
+ "schema": "",
976
+ "columns": {
977
+ "id": {
978
+ "name": "id",
979
+ "type": "text",
980
+ "primaryKey": true,
981
+ "notNull": true
982
+ },
983
+ "organization_id": {
984
+ "name": "organization_id",
985
+ "type": "text",
986
+ "primaryKey": false,
987
+ "notNull": true
988
+ },
989
+ "email": {
990
+ "name": "email",
991
+ "type": "text",
992
+ "primaryKey": false,
993
+ "notNull": true
994
+ },
995
+ "role": {
996
+ "name": "role",
997
+ "type": "text",
998
+ "primaryKey": false,
999
+ "notNull": true
1000
+ },
1001
+ "status": {
1002
+ "name": "status",
1003
+ "type": "text",
1004
+ "primaryKey": false,
1005
+ "notNull": true
1006
+ },
1007
+ "expires_at": {
1008
+ "name": "expires_at",
1009
+ "type": "timestamp",
1010
+ "primaryKey": false,
1011
+ "notNull": true
1012
+ },
1013
+ "inviter_id": {
1014
+ "name": "inviter_id",
1015
+ "type": "text",
1016
+ "primaryKey": false,
1017
+ "notNull": true
1018
+ },
1019
+ "created_at": {
1020
+ "name": "created_at",
1021
+ "type": "timestamp",
1022
+ "primaryKey": false,
1023
+ "notNull": true,
1024
+ "default": "now()"
1025
+ },
1026
+ "updated_at": {
1027
+ "name": "updated_at",
1028
+ "type": "timestamp",
1029
+ "primaryKey": false,
1030
+ "notNull": true,
1031
+ "default": "now()"
1032
+ }
1033
+ },
1034
+ "indexes": {
1035
+ "invitation_organization_id_idx": {
1036
+ "name": "invitation_organization_id_idx",
1037
+ "columns": [
1038
+ {
1039
+ "expression": "organization_id",
1040
+ "isExpression": false,
1041
+ "asc": true,
1042
+ "nulls": "last"
1043
+ }
1044
+ ],
1045
+ "isUnique": false,
1046
+ "concurrently": false,
1047
+ "method": "btree",
1048
+ "with": {}
1049
+ },
1050
+ "invitation_email_idx": {
1051
+ "name": "invitation_email_idx",
1052
+ "columns": [
1053
+ {
1054
+ "expression": "email",
1055
+ "isExpression": false,
1056
+ "asc": true,
1057
+ "nulls": "last"
1058
+ }
1059
+ ],
1060
+ "isUnique": false,
1061
+ "concurrently": false,
1062
+ "method": "btree",
1063
+ "with": {}
1064
+ }
1065
+ },
1066
+ "foreignKeys": {
1067
+ "invitation_organization_id_organization_id_fk": {
1068
+ "name": "invitation_organization_id_organization_id_fk",
1069
+ "tableFrom": "invitation",
1070
+ "tableTo": "organization",
1071
+ "columnsFrom": ["organization_id"],
1072
+ "columnsTo": ["id"],
1073
+ "onDelete": "cascade",
1074
+ "onUpdate": "no action"
1075
+ },
1076
+ "invitation_inviter_id_users_id_fk": {
1077
+ "name": "invitation_inviter_id_users_id_fk",
1078
+ "tableFrom": "invitation",
1079
+ "tableTo": "users",
1080
+ "columnsFrom": ["inviter_id"],
1081
+ "columnsTo": ["id"],
1082
+ "onDelete": "no action",
1083
+ "onUpdate": "no action"
1084
+ }
1085
+ },
1086
+ "compositePrimaryKeys": {},
1087
+ "uniqueConstraints": {},
1088
+ "policies": {},
1089
+ "checkConstraints": {},
1090
+ "isRLSEnabled": false
1091
+ },
1092
+ "public.member": {
1093
+ "name": "member",
1094
+ "schema": "",
1095
+ "columns": {
1096
+ "id": {
1097
+ "name": "id",
1098
+ "type": "text",
1099
+ "primaryKey": true,
1100
+ "notNull": true
1101
+ },
1102
+ "organization_id": {
1103
+ "name": "organization_id",
1104
+ "type": "text",
1105
+ "primaryKey": false,
1106
+ "notNull": true
1107
+ },
1108
+ "user_id": {
1109
+ "name": "user_id",
1110
+ "type": "text",
1111
+ "primaryKey": false,
1112
+ "notNull": true
1113
+ },
1114
+ "role": {
1115
+ "name": "role",
1116
+ "type": "text",
1117
+ "primaryKey": false,
1118
+ "notNull": true
1119
+ },
1120
+ "created_at": {
1121
+ "name": "created_at",
1122
+ "type": "timestamp",
1123
+ "primaryKey": false,
1124
+ "notNull": true,
1125
+ "default": "now()"
1126
+ },
1127
+ "updated_at": {
1128
+ "name": "updated_at",
1129
+ "type": "timestamp",
1130
+ "primaryKey": false,
1131
+ "notNull": true,
1132
+ "default": "now()"
1133
+ }
1134
+ },
1135
+ "indexes": {
1136
+ "member_organization_id_idx": {
1137
+ "name": "member_organization_id_idx",
1138
+ "columns": [
1139
+ {
1140
+ "expression": "organization_id",
1141
+ "isExpression": false,
1142
+ "asc": true,
1143
+ "nulls": "last"
1144
+ }
1145
+ ],
1146
+ "isUnique": false,
1147
+ "concurrently": false,
1148
+ "method": "btree",
1149
+ "with": {}
1150
+ },
1151
+ "member_user_id_idx": {
1152
+ "name": "member_user_id_idx",
1153
+ "columns": [
1154
+ {
1155
+ "expression": "user_id",
1156
+ "isExpression": false,
1157
+ "asc": true,
1158
+ "nulls": "last"
1159
+ }
1160
+ ],
1161
+ "isUnique": false,
1162
+ "concurrently": false,
1163
+ "method": "btree",
1164
+ "with": {}
1165
+ }
1166
+ },
1167
+ "foreignKeys": {
1168
+ "member_organization_id_organization_id_fk": {
1169
+ "name": "member_organization_id_organization_id_fk",
1170
+ "tableFrom": "member",
1171
+ "tableTo": "organization",
1172
+ "columnsFrom": ["organization_id"],
1173
+ "columnsTo": ["id"],
1174
+ "onDelete": "cascade",
1175
+ "onUpdate": "no action"
1176
+ },
1177
+ "member_user_id_users_id_fk": {
1178
+ "name": "member_user_id_users_id_fk",
1179
+ "tableFrom": "member",
1180
+ "tableTo": "users",
1181
+ "columnsFrom": ["user_id"],
1182
+ "columnsTo": ["id"],
1183
+ "onDelete": "cascade",
1184
+ "onUpdate": "no action"
1185
+ }
1186
+ },
1187
+ "compositePrimaryKeys": {},
1188
+ "uniqueConstraints": {},
1189
+ "policies": {},
1190
+ "checkConstraints": {},
1191
+ "isRLSEnabled": false
1192
+ },
1193
+ "public.organization": {
1194
+ "name": "organization",
1195
+ "schema": "",
1196
+ "columns": {
1197
+ "id": {
1198
+ "name": "id",
1199
+ "type": "text",
1200
+ "primaryKey": true,
1201
+ "notNull": true
1202
+ },
1203
+ "name": {
1204
+ "name": "name",
1205
+ "type": "text",
1206
+ "primaryKey": false,
1207
+ "notNull": true
1208
+ },
1209
+ "slug": {
1210
+ "name": "slug",
1211
+ "type": "text",
1212
+ "primaryKey": false,
1213
+ "notNull": false
1214
+ },
1215
+ "logo": {
1216
+ "name": "logo",
1217
+ "type": "text",
1218
+ "primaryKey": false,
1219
+ "notNull": false
1220
+ },
1221
+ "metadata": {
1222
+ "name": "metadata",
1223
+ "type": "text",
1224
+ "primaryKey": false,
1225
+ "notNull": false
1226
+ },
1227
+ "created_at": {
1228
+ "name": "created_at",
1229
+ "type": "timestamp",
1230
+ "primaryKey": false,
1231
+ "notNull": true,
1232
+ "default": "now()"
1233
+ },
1234
+ "updated_at": {
1235
+ "name": "updated_at",
1236
+ "type": "timestamp",
1237
+ "primaryKey": false,
1238
+ "notNull": true,
1239
+ "default": "now()"
1240
+ }
1241
+ },
1242
+ "indexes": {},
1243
+ "foreignKeys": {},
1244
+ "compositePrimaryKeys": {},
1245
+ "uniqueConstraints": {
1246
+ "organization_slug_unique": {
1247
+ "name": "organization_slug_unique",
1248
+ "nullsNotDistinct": false,
1249
+ "columns": ["slug"]
1250
+ }
1251
+ },
1252
+ "policies": {},
1253
+ "checkConstraints": {},
1254
+ "isRLSEnabled": false
1255
+ },
1256
+ "public.sessions": {
1257
+ "name": "sessions",
1258
+ "schema": "",
1259
+ "columns": {
1260
+ "id": {
1261
+ "name": "id",
1262
+ "type": "text",
1263
+ "primaryKey": true,
1264
+ "notNull": true
1265
+ },
1266
+ "user_id": {
1267
+ "name": "user_id",
1268
+ "type": "text",
1269
+ "primaryKey": false,
1270
+ "notNull": true
1271
+ },
1272
+ "token": {
1273
+ "name": "token",
1274
+ "type": "text",
1275
+ "primaryKey": false,
1276
+ "notNull": true
1277
+ },
1278
+ "expires_at": {
1279
+ "name": "expires_at",
1280
+ "type": "timestamp",
1281
+ "primaryKey": false,
1282
+ "notNull": true
1283
+ },
1284
+ "ip_address": {
1285
+ "name": "ip_address",
1286
+ "type": "text",
1287
+ "primaryKey": false,
1288
+ "notNull": false
1289
+ },
1290
+ "user_agent": {
1291
+ "name": "user_agent",
1292
+ "type": "text",
1293
+ "primaryKey": false,
1294
+ "notNull": false
1295
+ },
1296
+ "created_at": {
1297
+ "name": "created_at",
1298
+ "type": "timestamp",
1299
+ "primaryKey": false,
1300
+ "notNull": true,
1301
+ "default": "now()"
1302
+ },
1303
+ "updated_at": {
1304
+ "name": "updated_at",
1305
+ "type": "timestamp",
1306
+ "primaryKey": false,
1307
+ "notNull": true,
1308
+ "default": "now()"
1309
+ }
1310
+ },
1311
+ "indexes": {
1312
+ "sessions_user_id_idx": {
1313
+ "name": "sessions_user_id_idx",
1314
+ "columns": [
1315
+ {
1316
+ "expression": "user_id",
1317
+ "isExpression": false,
1318
+ "asc": true,
1319
+ "nulls": "last"
1320
+ }
1321
+ ],
1322
+ "isUnique": false,
1323
+ "concurrently": false,
1324
+ "method": "btree",
1325
+ "with": {}
1326
+ }
1327
+ },
1328
+ "foreignKeys": {
1329
+ "sessions_user_id_users_id_fk": {
1330
+ "name": "sessions_user_id_users_id_fk",
1331
+ "tableFrom": "sessions",
1332
+ "tableTo": "users",
1333
+ "columnsFrom": ["user_id"],
1334
+ "columnsTo": ["id"],
1335
+ "onDelete": "cascade",
1336
+ "onUpdate": "no action"
1337
+ }
1338
+ },
1339
+ "compositePrimaryKeys": {},
1340
+ "uniqueConstraints": {
1341
+ "sessions_token_unique": {
1342
+ "name": "sessions_token_unique",
1343
+ "nullsNotDistinct": false,
1344
+ "columns": ["token"]
1345
+ }
1346
+ },
1347
+ "policies": {},
1348
+ "checkConstraints": {},
1349
+ "isRLSEnabled": false
1350
+ },
1351
+ "public.users": {
1352
+ "name": "users",
1353
+ "schema": "",
1354
+ "columns": {
1355
+ "id": {
1356
+ "name": "id",
1357
+ "type": "text",
1358
+ "primaryKey": true,
1359
+ "notNull": true
1360
+ },
1361
+ "name": {
1362
+ "name": "name",
1363
+ "type": "text",
1364
+ "primaryKey": false,
1365
+ "notNull": true
1366
+ },
1367
+ "email": {
1368
+ "name": "email",
1369
+ "type": "text",
1370
+ "primaryKey": false,
1371
+ "notNull": true
1372
+ },
1373
+ "email_verified": {
1374
+ "name": "email_verified",
1375
+ "type": "boolean",
1376
+ "primaryKey": false,
1377
+ "notNull": true,
1378
+ "default": false
1379
+ },
1380
+ "image": {
1381
+ "name": "image",
1382
+ "type": "text",
1383
+ "primaryKey": false,
1384
+ "notNull": false
1385
+ },
1386
+ "deleted_at": {
1387
+ "name": "deleted_at",
1388
+ "type": "timestamp",
1389
+ "primaryKey": false,
1390
+ "notNull": false
1391
+ },
1392
+ "created_at": {
1393
+ "name": "created_at",
1394
+ "type": "timestamp",
1395
+ "primaryKey": false,
1396
+ "notNull": true,
1397
+ "default": "now()"
1398
+ },
1399
+ "updated_at": {
1400
+ "name": "updated_at",
1401
+ "type": "timestamp",
1402
+ "primaryKey": false,
1403
+ "notNull": true,
1404
+ "default": "now()"
1405
+ },
1406
+ "onboarding_completed": {
1407
+ "name": "onboarding_completed",
1408
+ "type": "boolean",
1409
+ "primaryKey": false,
1410
+ "notNull": true,
1411
+ "default": false
1412
+ },
1413
+ "onboarding_step": {
1414
+ "name": "onboarding_step",
1415
+ "type": "text",
1416
+ "primaryKey": false,
1417
+ "notNull": false
1418
+ },
1419
+ "preferred_language": {
1420
+ "name": "preferred_language",
1421
+ "type": "text",
1422
+ "primaryKey": false,
1423
+ "notNull": true,
1424
+ "default": "'en'"
1425
+ }
1426
+ },
1427
+ "indexes": {},
1428
+ "foreignKeys": {},
1429
+ "compositePrimaryKeys": {},
1430
+ "uniqueConstraints": {
1431
+ "users_email_unique": {
1432
+ "name": "users_email_unique",
1433
+ "nullsNotDistinct": false,
1434
+ "columns": ["email"]
1435
+ }
1436
+ },
1437
+ "policies": {},
1438
+ "checkConstraints": {},
1439
+ "isRLSEnabled": false
1440
+ },
1441
+ "public.verifications": {
1442
+ "name": "verifications",
1443
+ "schema": "",
1444
+ "columns": {
1445
+ "id": {
1446
+ "name": "id",
1447
+ "type": "text",
1448
+ "primaryKey": true,
1449
+ "notNull": true
1450
+ },
1451
+ "identifier": {
1452
+ "name": "identifier",
1453
+ "type": "text",
1454
+ "primaryKey": false,
1455
+ "notNull": true
1456
+ },
1457
+ "value": {
1458
+ "name": "value",
1459
+ "type": "text",
1460
+ "primaryKey": false,
1461
+ "notNull": true
1462
+ },
1463
+ "expires_at": {
1464
+ "name": "expires_at",
1465
+ "type": "timestamp",
1466
+ "primaryKey": false,
1467
+ "notNull": true
1468
+ },
1469
+ "created_at": {
1470
+ "name": "created_at",
1471
+ "type": "timestamp",
1472
+ "primaryKey": false,
1473
+ "notNull": true,
1474
+ "default": "now()"
1475
+ },
1476
+ "updated_at": {
1477
+ "name": "updated_at",
1478
+ "type": "timestamp",
1479
+ "primaryKey": false,
1480
+ "notNull": true,
1481
+ "default": "now()"
1482
+ }
1483
+ },
1484
+ "indexes": {},
1485
+ "foreignKeys": {},
1486
+ "compositePrimaryKeys": {},
1487
+ "uniqueConstraints": {},
1488
+ "policies": {},
1489
+ "checkConstraints": {},
1490
+ "isRLSEnabled": false
1491
+ },
1492
+ "public.credit_balances": {
1493
+ "name": "credit_balances",
1494
+ "schema": "",
1495
+ "columns": {
1496
+ "id": {
1497
+ "name": "id",
1498
+ "type": "text",
1499
+ "primaryKey": true,
1500
+ "notNull": true
1501
+ },
1502
+ "workspace_id": {
1503
+ "name": "workspace_id",
1504
+ "type": "text",
1505
+ "primaryKey": false,
1506
+ "notNull": true
1507
+ },
1508
+ "balance": {
1509
+ "name": "balance",
1510
+ "type": "integer",
1511
+ "primaryKey": false,
1512
+ "notNull": true,
1513
+ "default": 0
1514
+ },
1515
+ "total_purchased": {
1516
+ "name": "total_purchased",
1517
+ "type": "integer",
1518
+ "primaryKey": false,
1519
+ "notNull": true,
1520
+ "default": 0
1521
+ },
1522
+ "total_used": {
1523
+ "name": "total_used",
1524
+ "type": "integer",
1525
+ "primaryKey": false,
1526
+ "notNull": true,
1527
+ "default": 0
1528
+ },
1529
+ "updated_at": {
1530
+ "name": "updated_at",
1531
+ "type": "timestamp",
1532
+ "primaryKey": false,
1533
+ "notNull": true,
1534
+ "default": "now()"
1535
+ }
1536
+ },
1537
+ "indexes": {},
1538
+ "foreignKeys": {
1539
+ "credit_balances_workspace_id_organization_id_fk": {
1540
+ "name": "credit_balances_workspace_id_organization_id_fk",
1541
+ "tableFrom": "credit_balances",
1542
+ "tableTo": "organization",
1543
+ "columnsFrom": ["workspace_id"],
1544
+ "columnsTo": ["id"],
1545
+ "onDelete": "cascade",
1546
+ "onUpdate": "no action"
1547
+ }
1548
+ },
1549
+ "compositePrimaryKeys": {},
1550
+ "uniqueConstraints": {
1551
+ "credit_balances_workspace_id_unique": {
1552
+ "name": "credit_balances_workspace_id_unique",
1553
+ "nullsNotDistinct": false,
1554
+ "columns": ["workspace_id"]
1555
+ }
1556
+ },
1557
+ "policies": {},
1558
+ "checkConstraints": {},
1559
+ "isRLSEnabled": false
1560
+ },
1561
+ "public.credit_purchases": {
1562
+ "name": "credit_purchases",
1563
+ "schema": "",
1564
+ "columns": {
1565
+ "id": {
1566
+ "name": "id",
1567
+ "type": "text",
1568
+ "primaryKey": true,
1569
+ "notNull": true
1570
+ },
1571
+ "workspace_id": {
1572
+ "name": "workspace_id",
1573
+ "type": "text",
1574
+ "primaryKey": false,
1575
+ "notNull": true
1576
+ },
1577
+ "amount": {
1578
+ "name": "amount",
1579
+ "type": "integer",
1580
+ "primaryKey": false,
1581
+ "notNull": true
1582
+ },
1583
+ "credits": {
1584
+ "name": "credits",
1585
+ "type": "integer",
1586
+ "primaryKey": false,
1587
+ "notNull": true
1588
+ },
1589
+ "stripe_payment_intent_id": {
1590
+ "name": "stripe_payment_intent_id",
1591
+ "type": "text",
1592
+ "primaryKey": false,
1593
+ "notNull": false
1594
+ },
1595
+ "stripe_checkout_session_id": {
1596
+ "name": "stripe_checkout_session_id",
1597
+ "type": "text",
1598
+ "primaryKey": false,
1599
+ "notNull": false
1600
+ },
1601
+ "status": {
1602
+ "name": "status",
1603
+ "type": "text",
1604
+ "primaryKey": false,
1605
+ "notNull": true,
1606
+ "default": "'pending'"
1607
+ },
1608
+ "created_at": {
1609
+ "name": "created_at",
1610
+ "type": "timestamp",
1611
+ "primaryKey": false,
1612
+ "notNull": true,
1613
+ "default": "now()"
1614
+ }
1615
+ },
1616
+ "indexes": {
1617
+ "credit_purchases_workspace_id_idx": {
1618
+ "name": "credit_purchases_workspace_id_idx",
1619
+ "columns": [
1620
+ {
1621
+ "expression": "workspace_id",
1622
+ "isExpression": false,
1623
+ "asc": true,
1624
+ "nulls": "last"
1625
+ }
1626
+ ],
1627
+ "isUnique": false,
1628
+ "concurrently": false,
1629
+ "method": "btree",
1630
+ "with": {}
1631
+ }
1632
+ },
1633
+ "foreignKeys": {
1634
+ "credit_purchases_workspace_id_organization_id_fk": {
1635
+ "name": "credit_purchases_workspace_id_organization_id_fk",
1636
+ "tableFrom": "credit_purchases",
1637
+ "tableTo": "organization",
1638
+ "columnsFrom": ["workspace_id"],
1639
+ "columnsTo": ["id"],
1640
+ "onDelete": "cascade",
1641
+ "onUpdate": "no action"
1642
+ }
1643
+ },
1644
+ "compositePrimaryKeys": {},
1645
+ "uniqueConstraints": {},
1646
+ "policies": {},
1647
+ "checkConstraints": {},
1648
+ "isRLSEnabled": false
1649
+ },
1650
+ "public.finance_events": {
1651
+ "name": "finance_events",
1652
+ "schema": "",
1653
+ "columns": {
1654
+ "id": {
1655
+ "name": "id",
1656
+ "type": "text",
1657
+ "primaryKey": true,
1658
+ "notNull": true
1659
+ },
1660
+ "workspace_id": {
1661
+ "name": "workspace_id",
1662
+ "type": "text",
1663
+ "primaryKey": false,
1664
+ "notNull": false
1665
+ },
1666
+ "stripe_event_id": {
1667
+ "name": "stripe_event_id",
1668
+ "type": "text",
1669
+ "primaryKey": false,
1670
+ "notNull": true
1671
+ },
1672
+ "type": {
1673
+ "name": "type",
1674
+ "type": "text",
1675
+ "primaryKey": false,
1676
+ "notNull": true
1677
+ },
1678
+ "amount": {
1679
+ "name": "amount",
1680
+ "type": "integer",
1681
+ "primaryKey": false,
1682
+ "notNull": false
1683
+ },
1684
+ "currency": {
1685
+ "name": "currency",
1686
+ "type": "text",
1687
+ "primaryKey": false,
1688
+ "notNull": false,
1689
+ "default": "'usd'"
1690
+ },
1691
+ "metadata": {
1692
+ "name": "metadata",
1693
+ "type": "text",
1694
+ "primaryKey": false,
1695
+ "notNull": false
1696
+ },
1697
+ "processed_at": {
1698
+ "name": "processed_at",
1699
+ "type": "timestamp",
1700
+ "primaryKey": false,
1701
+ "notNull": false
1702
+ },
1703
+ "created_at": {
1704
+ "name": "created_at",
1705
+ "type": "timestamp",
1706
+ "primaryKey": false,
1707
+ "notNull": true,
1708
+ "default": "now()"
1709
+ }
1710
+ },
1711
+ "indexes": {},
1712
+ "foreignKeys": {
1713
+ "finance_events_workspace_id_organization_id_fk": {
1714
+ "name": "finance_events_workspace_id_organization_id_fk",
1715
+ "tableFrom": "finance_events",
1716
+ "tableTo": "organization",
1717
+ "columnsFrom": ["workspace_id"],
1718
+ "columnsTo": ["id"],
1719
+ "onDelete": "no action",
1720
+ "onUpdate": "no action"
1721
+ }
1722
+ },
1723
+ "compositePrimaryKeys": {},
1724
+ "uniqueConstraints": {
1725
+ "finance_events_stripe_event_id_unique": {
1726
+ "name": "finance_events_stripe_event_id_unique",
1727
+ "nullsNotDistinct": false,
1728
+ "columns": ["stripe_event_id"]
1729
+ }
1730
+ },
1731
+ "policies": {},
1732
+ "checkConstraints": {},
1733
+ "isRLSEnabled": false
1734
+ },
1735
+ "public.plans": {
1736
+ "name": "plans",
1737
+ "schema": "",
1738
+ "columns": {
1739
+ "id": {
1740
+ "name": "id",
1741
+ "type": "text",
1742
+ "primaryKey": true,
1743
+ "notNull": true
1744
+ },
1745
+ "name": {
1746
+ "name": "name",
1747
+ "type": "text",
1748
+ "primaryKey": false,
1749
+ "notNull": true
1750
+ },
1751
+ "slug": {
1752
+ "name": "slug",
1753
+ "type": "text",
1754
+ "primaryKey": false,
1755
+ "notNull": true
1756
+ },
1757
+ "description": {
1758
+ "name": "description",
1759
+ "type": "text",
1760
+ "primaryKey": false,
1761
+ "notNull": false
1762
+ },
1763
+ "price_monthly": {
1764
+ "name": "price_monthly",
1765
+ "type": "integer",
1766
+ "primaryKey": false,
1767
+ "notNull": true
1768
+ },
1769
+ "price_yearly": {
1770
+ "name": "price_yearly",
1771
+ "type": "integer",
1772
+ "primaryKey": false,
1773
+ "notNull": true
1774
+ },
1775
+ "stripe_price_id_monthly": {
1776
+ "name": "stripe_price_id_monthly",
1777
+ "type": "text",
1778
+ "primaryKey": false,
1779
+ "notNull": false
1780
+ },
1781
+ "stripe_price_id_yearly": {
1782
+ "name": "stripe_price_id_yearly",
1783
+ "type": "text",
1784
+ "primaryKey": false,
1785
+ "notNull": false
1786
+ },
1787
+ "features": {
1788
+ "name": "features",
1789
+ "type": "text",
1790
+ "primaryKey": false,
1791
+ "notNull": true
1792
+ },
1793
+ "limits": {
1794
+ "name": "limits",
1795
+ "type": "text",
1796
+ "primaryKey": false,
1797
+ "notNull": true
1798
+ },
1799
+ "is_active": {
1800
+ "name": "is_active",
1801
+ "type": "boolean",
1802
+ "primaryKey": false,
1803
+ "notNull": true,
1804
+ "default": true
1805
+ },
1806
+ "sort_order": {
1807
+ "name": "sort_order",
1808
+ "type": "integer",
1809
+ "primaryKey": false,
1810
+ "notNull": true,
1811
+ "default": 0
1812
+ },
1813
+ "created_at": {
1814
+ "name": "created_at",
1815
+ "type": "timestamp",
1816
+ "primaryKey": false,
1817
+ "notNull": true,
1818
+ "default": "now()"
1819
+ },
1820
+ "updated_at": {
1821
+ "name": "updated_at",
1822
+ "type": "timestamp",
1823
+ "primaryKey": false,
1824
+ "notNull": true,
1825
+ "default": "now()"
1826
+ }
1827
+ },
1828
+ "indexes": {},
1829
+ "foreignKeys": {},
1830
+ "compositePrimaryKeys": {},
1831
+ "uniqueConstraints": {
1832
+ "plans_slug_unique": {
1833
+ "name": "plans_slug_unique",
1834
+ "nullsNotDistinct": false,
1835
+ "columns": ["slug"]
1836
+ }
1837
+ },
1838
+ "policies": {},
1839
+ "checkConstraints": {},
1840
+ "isRLSEnabled": false
1841
+ },
1842
+ "public.subscriptions": {
1843
+ "name": "subscriptions",
1844
+ "schema": "",
1845
+ "columns": {
1846
+ "id": {
1847
+ "name": "id",
1848
+ "type": "text",
1849
+ "primaryKey": true,
1850
+ "notNull": true
1851
+ },
1852
+ "workspace_id": {
1853
+ "name": "workspace_id",
1854
+ "type": "text",
1855
+ "primaryKey": false,
1856
+ "notNull": true
1857
+ },
1858
+ "plan_id": {
1859
+ "name": "plan_id",
1860
+ "type": "text",
1861
+ "primaryKey": false,
1862
+ "notNull": true
1863
+ },
1864
+ "stripe_customer_id": {
1865
+ "name": "stripe_customer_id",
1866
+ "type": "text",
1867
+ "primaryKey": false,
1868
+ "notNull": false
1869
+ },
1870
+ "stripe_subscription_id": {
1871
+ "name": "stripe_subscription_id",
1872
+ "type": "text",
1873
+ "primaryKey": false,
1874
+ "notNull": false
1875
+ },
1876
+ "status": {
1877
+ "name": "status",
1878
+ "type": "text",
1879
+ "primaryKey": false,
1880
+ "notNull": true,
1881
+ "default": "'active'"
1882
+ },
1883
+ "billing_mode": {
1884
+ "name": "billing_mode",
1885
+ "type": "text",
1886
+ "primaryKey": false,
1887
+ "notNull": true,
1888
+ "default": "'subscription'"
1889
+ },
1890
+ "current_period_start": {
1891
+ "name": "current_period_start",
1892
+ "type": "timestamp",
1893
+ "primaryKey": false,
1894
+ "notNull": false
1895
+ },
1896
+ "current_period_end": {
1897
+ "name": "current_period_end",
1898
+ "type": "timestamp",
1899
+ "primaryKey": false,
1900
+ "notNull": false
1901
+ },
1902
+ "cancel_at_period_end": {
1903
+ "name": "cancel_at_period_end",
1904
+ "type": "boolean",
1905
+ "primaryKey": false,
1906
+ "notNull": true,
1907
+ "default": false
1908
+ },
1909
+ "created_at": {
1910
+ "name": "created_at",
1911
+ "type": "timestamp",
1912
+ "primaryKey": false,
1913
+ "notNull": true,
1914
+ "default": "now()"
1915
+ },
1916
+ "updated_at": {
1917
+ "name": "updated_at",
1918
+ "type": "timestamp",
1919
+ "primaryKey": false,
1920
+ "notNull": true,
1921
+ "default": "now()"
1922
+ }
1923
+ },
1924
+ "indexes": {
1925
+ "subscriptions_workspace_id_idx": {
1926
+ "name": "subscriptions_workspace_id_idx",
1927
+ "columns": [
1928
+ {
1929
+ "expression": "workspace_id",
1930
+ "isExpression": false,
1931
+ "asc": true,
1932
+ "nulls": "last"
1933
+ }
1934
+ ],
1935
+ "isUnique": false,
1936
+ "concurrently": false,
1937
+ "method": "btree",
1938
+ "with": {}
1939
+ }
1940
+ },
1941
+ "foreignKeys": {
1942
+ "subscriptions_workspace_id_organization_id_fk": {
1943
+ "name": "subscriptions_workspace_id_organization_id_fk",
1944
+ "tableFrom": "subscriptions",
1945
+ "tableTo": "organization",
1946
+ "columnsFrom": ["workspace_id"],
1947
+ "columnsTo": ["id"],
1948
+ "onDelete": "cascade",
1949
+ "onUpdate": "no action"
1950
+ },
1951
+ "subscriptions_plan_id_plans_id_fk": {
1952
+ "name": "subscriptions_plan_id_plans_id_fk",
1953
+ "tableFrom": "subscriptions",
1954
+ "tableTo": "plans",
1955
+ "columnsFrom": ["plan_id"],
1956
+ "columnsTo": ["id"],
1957
+ "onDelete": "restrict",
1958
+ "onUpdate": "no action"
1959
+ }
1960
+ },
1961
+ "compositePrimaryKeys": {},
1962
+ "uniqueConstraints": {
1963
+ "subscriptions_stripe_subscription_id_unique": {
1964
+ "name": "subscriptions_stripe_subscription_id_unique",
1965
+ "nullsNotDistinct": false,
1966
+ "columns": ["stripe_subscription_id"]
1967
+ },
1968
+ "subscriptions_workspace_id_unique": {
1969
+ "name": "subscriptions_workspace_id_unique",
1970
+ "nullsNotDistinct": false,
1971
+ "columns": ["workspace_id"]
1972
+ }
1973
+ },
1974
+ "policies": {},
1975
+ "checkConstraints": {},
1976
+ "isRLSEnabled": false
1977
+ },
1978
+ "public.feature_flags": {
1979
+ "name": "feature_flags",
1980
+ "schema": "",
1981
+ "columns": {
1982
+ "id": {
1983
+ "name": "id",
1984
+ "type": "text",
1985
+ "primaryKey": true,
1986
+ "notNull": true
1987
+ },
1988
+ "name": {
1989
+ "name": "name",
1990
+ "type": "text",
1991
+ "primaryKey": false,
1992
+ "notNull": true
1993
+ },
1994
+ "description": {
1995
+ "name": "description",
1996
+ "type": "text",
1997
+ "primaryKey": false,
1998
+ "notNull": false
1999
+ },
2000
+ "enabled_plans": {
2001
+ "name": "enabled_plans",
2002
+ "type": "text",
2003
+ "primaryKey": false,
2004
+ "notNull": true
2005
+ },
2006
+ "is_active": {
2007
+ "name": "is_active",
2008
+ "type": "boolean",
2009
+ "primaryKey": false,
2010
+ "notNull": true,
2011
+ "default": true
2012
+ },
2013
+ "created_at": {
2014
+ "name": "created_at",
2015
+ "type": "timestamp",
2016
+ "primaryKey": false,
2017
+ "notNull": true,
2018
+ "default": "now()"
2019
+ },
2020
+ "updated_at": {
2021
+ "name": "updated_at",
2022
+ "type": "timestamp",
2023
+ "primaryKey": false,
2024
+ "notNull": true,
2025
+ "default": "now()"
2026
+ }
2027
+ },
2028
+ "indexes": {},
2029
+ "foreignKeys": {},
2030
+ "compositePrimaryKeys": {},
2031
+ "uniqueConstraints": {
2032
+ "feature_flags_name_unique": {
2033
+ "name": "feature_flags_name_unique",
2034
+ "nullsNotDistinct": false,
2035
+ "columns": ["name"]
2036
+ }
2037
+ },
2038
+ "policies": {},
2039
+ "checkConstraints": {},
2040
+ "isRLSEnabled": false
2041
+ },
2042
+ "public.monthly_usage": {
2043
+ "name": "monthly_usage",
2044
+ "schema": "",
2045
+ "columns": {
2046
+ "id": {
2047
+ "name": "id",
2048
+ "type": "text",
2049
+ "primaryKey": true,
2050
+ "notNull": true
2051
+ },
2052
+ "workspace_id": {
2053
+ "name": "workspace_id",
2054
+ "type": "text",
2055
+ "primaryKey": false,
2056
+ "notNull": true
2057
+ },
2058
+ "period_start": {
2059
+ "name": "period_start",
2060
+ "type": "timestamp",
2061
+ "primaryKey": false,
2062
+ "notNull": true
2063
+ },
2064
+ "period_end": {
2065
+ "name": "period_end",
2066
+ "type": "timestamp",
2067
+ "primaryKey": false,
2068
+ "notNull": true
2069
+ },
2070
+ "tokens_used": {
2071
+ "name": "tokens_used",
2072
+ "type": "integer",
2073
+ "primaryKey": false,
2074
+ "notNull": true,
2075
+ "default": 0
2076
+ },
2077
+ "request_count": {
2078
+ "name": "request_count",
2079
+ "type": "integer",
2080
+ "primaryKey": false,
2081
+ "notNull": true,
2082
+ "default": 0
2083
+ },
2084
+ "updated_at": {
2085
+ "name": "updated_at",
2086
+ "type": "timestamp",
2087
+ "primaryKey": false,
2088
+ "notNull": true,
2089
+ "default": "now()"
2090
+ }
2091
+ },
2092
+ "indexes": {
2093
+ "monthly_usage_workspace_id_idx": {
2094
+ "name": "monthly_usage_workspace_id_idx",
2095
+ "columns": [
2096
+ {
2097
+ "expression": "workspace_id",
2098
+ "isExpression": false,
2099
+ "asc": true,
2100
+ "nulls": "last"
2101
+ }
2102
+ ],
2103
+ "isUnique": false,
2104
+ "concurrently": false,
2105
+ "method": "btree",
2106
+ "with": {}
2107
+ }
2108
+ },
2109
+ "foreignKeys": {
2110
+ "monthly_usage_workspace_id_organization_id_fk": {
2111
+ "name": "monthly_usage_workspace_id_organization_id_fk",
2112
+ "tableFrom": "monthly_usage",
2113
+ "tableTo": "organization",
2114
+ "columnsFrom": ["workspace_id"],
2115
+ "columnsTo": ["id"],
2116
+ "onDelete": "cascade",
2117
+ "onUpdate": "no action"
2118
+ }
2119
+ },
2120
+ "compositePrimaryKeys": {},
2121
+ "uniqueConstraints": {
2122
+ "monthly_usage_workspace_period_unique": {
2123
+ "name": "monthly_usage_workspace_period_unique",
2124
+ "nullsNotDistinct": false,
2125
+ "columns": ["workspace_id", "period_start"]
2126
+ }
2127
+ },
2128
+ "policies": {},
2129
+ "checkConstraints": {},
2130
+ "isRLSEnabled": false
2131
+ },
2132
+ "public.notification_history": {
2133
+ "name": "notification_history",
2134
+ "schema": "",
2135
+ "columns": {
2136
+ "id": {
2137
+ "name": "id",
2138
+ "type": "text",
2139
+ "primaryKey": true,
2140
+ "notNull": true
2141
+ },
2142
+ "workspace_id": {
2143
+ "name": "workspace_id",
2144
+ "type": "text",
2145
+ "primaryKey": false,
2146
+ "notNull": true
2147
+ },
2148
+ "type": {
2149
+ "name": "type",
2150
+ "type": "text",
2151
+ "primaryKey": false,
2152
+ "notNull": true
2153
+ },
2154
+ "period_key": {
2155
+ "name": "period_key",
2156
+ "type": "text",
2157
+ "primaryKey": false,
2158
+ "notNull": true
2159
+ },
2160
+ "sent_at": {
2161
+ "name": "sent_at",
2162
+ "type": "timestamp",
2163
+ "primaryKey": false,
2164
+ "notNull": true,
2165
+ "default": "now()"
2166
+ },
2167
+ "channel": {
2168
+ "name": "channel",
2169
+ "type": "text",
2170
+ "primaryKey": false,
2171
+ "notNull": true,
2172
+ "default": "'console'"
2173
+ },
2174
+ "metadata": {
2175
+ "name": "metadata",
2176
+ "type": "text",
2177
+ "primaryKey": false,
2178
+ "notNull": false
2179
+ }
2180
+ },
2181
+ "indexes": {
2182
+ "notification_history_workspace_id_idx": {
2183
+ "name": "notification_history_workspace_id_idx",
2184
+ "columns": [
2185
+ {
2186
+ "expression": "workspace_id",
2187
+ "isExpression": false,
2188
+ "asc": true,
2189
+ "nulls": "last"
2190
+ }
2191
+ ],
2192
+ "isUnique": false,
2193
+ "concurrently": false,
2194
+ "method": "btree",
2195
+ "with": {}
2196
+ }
2197
+ },
2198
+ "foreignKeys": {
2199
+ "notification_history_workspace_id_organization_id_fk": {
2200
+ "name": "notification_history_workspace_id_organization_id_fk",
2201
+ "tableFrom": "notification_history",
2202
+ "tableTo": "organization",
2203
+ "columnsFrom": ["workspace_id"],
2204
+ "columnsTo": ["id"],
2205
+ "onDelete": "cascade",
2206
+ "onUpdate": "no action"
2207
+ }
2208
+ },
2209
+ "compositePrimaryKeys": {},
2210
+ "uniqueConstraints": {
2211
+ "notification_history_dedup_unique": {
2212
+ "name": "notification_history_dedup_unique",
2213
+ "nullsNotDistinct": false,
2214
+ "columns": ["workspace_id", "type", "period_key"]
2215
+ }
2216
+ },
2217
+ "policies": {},
2218
+ "checkConstraints": {},
2219
+ "isRLSEnabled": false
2220
+ },
2221
+ "public.rate_limit_entries": {
2222
+ "name": "rate_limit_entries",
2223
+ "schema": "",
2224
+ "columns": {
2225
+ "id": {
2226
+ "name": "id",
2227
+ "type": "text",
2228
+ "primaryKey": true,
2229
+ "notNull": true
2230
+ },
2231
+ "workspace_id": {
2232
+ "name": "workspace_id",
2233
+ "type": "text",
2234
+ "primaryKey": false,
2235
+ "notNull": true
2236
+ },
2237
+ "endpoint": {
2238
+ "name": "endpoint",
2239
+ "type": "text",
2240
+ "primaryKey": false,
2241
+ "notNull": true,
2242
+ "default": "'chat'"
2243
+ },
2244
+ "requested_at": {
2245
+ "name": "requested_at",
2246
+ "type": "timestamp",
2247
+ "primaryKey": false,
2248
+ "notNull": true,
2249
+ "default": "now()"
2250
+ }
2251
+ },
2252
+ "indexes": {
2253
+ "rate_limit_entries_window_idx": {
2254
+ "name": "rate_limit_entries_window_idx",
2255
+ "columns": [
2256
+ {
2257
+ "expression": "workspace_id",
2258
+ "isExpression": false,
2259
+ "asc": true,
2260
+ "nulls": "last"
2261
+ },
2262
+ {
2263
+ "expression": "endpoint",
2264
+ "isExpression": false,
2265
+ "asc": true,
2266
+ "nulls": "last"
2267
+ },
2268
+ {
2269
+ "expression": "requested_at",
2270
+ "isExpression": false,
2271
+ "asc": true,
2272
+ "nulls": "last"
2273
+ }
2274
+ ],
2275
+ "isUnique": false,
2276
+ "concurrently": false,
2277
+ "method": "btree",
2278
+ "with": {}
2279
+ }
2280
+ },
2281
+ "foreignKeys": {
2282
+ "rate_limit_entries_workspace_id_organization_id_fk": {
2283
+ "name": "rate_limit_entries_workspace_id_organization_id_fk",
2284
+ "tableFrom": "rate_limit_entries",
2285
+ "tableTo": "organization",
2286
+ "columnsFrom": ["workspace_id"],
2287
+ "columnsTo": ["id"],
2288
+ "onDelete": "cascade",
2289
+ "onUpdate": "no action"
2290
+ }
2291
+ },
2292
+ "compositePrimaryKeys": {},
2293
+ "uniqueConstraints": {},
2294
+ "policies": {},
2295
+ "checkConstraints": {},
2296
+ "isRLSEnabled": false
2297
+ },
2298
+ "public.trial_credits": {
2299
+ "name": "trial_credits",
2300
+ "schema": "",
2301
+ "columns": {
2302
+ "id": {
2303
+ "name": "id",
2304
+ "type": "text",
2305
+ "primaryKey": true,
2306
+ "notNull": true
2307
+ },
2308
+ "workspace_id": {
2309
+ "name": "workspace_id",
2310
+ "type": "text",
2311
+ "primaryKey": false,
2312
+ "notNull": true
2313
+ },
2314
+ "initial_credits": {
2315
+ "name": "initial_credits",
2316
+ "type": "integer",
2317
+ "primaryKey": false,
2318
+ "notNull": true,
2319
+ "default": 100000
2320
+ },
2321
+ "credits_used": {
2322
+ "name": "credits_used",
2323
+ "type": "integer",
2324
+ "primaryKey": false,
2325
+ "notNull": true,
2326
+ "default": 0
2327
+ },
2328
+ "credits_remaining": {
2329
+ "name": "credits_remaining",
2330
+ "type": "integer",
2331
+ "primaryKey": false,
2332
+ "notNull": true,
2333
+ "default": 100000
2334
+ },
2335
+ "status": {
2336
+ "name": "status",
2337
+ "type": "text",
2338
+ "primaryKey": false,
2339
+ "notNull": true,
2340
+ "default": "'active'"
2341
+ },
2342
+ "provisioned_at": {
2343
+ "name": "provisioned_at",
2344
+ "type": "timestamp",
2345
+ "primaryKey": false,
2346
+ "notNull": true,
2347
+ "default": "now()"
2348
+ },
2349
+ "trial_end_date": {
2350
+ "name": "trial_end_date",
2351
+ "type": "timestamp",
2352
+ "primaryKey": false,
2353
+ "notNull": false
2354
+ },
2355
+ "depleted_at": {
2356
+ "name": "depleted_at",
2357
+ "type": "timestamp",
2358
+ "primaryKey": false,
2359
+ "notNull": false
2360
+ },
2361
+ "converted_at": {
2362
+ "name": "converted_at",
2363
+ "type": "timestamp",
2364
+ "primaryKey": false,
2365
+ "notNull": false
2366
+ },
2367
+ "created_by_ip": {
2368
+ "name": "created_by_ip",
2369
+ "type": "text",
2370
+ "primaryKey": false,
2371
+ "notNull": false
2372
+ },
2373
+ "created_by_email": {
2374
+ "name": "created_by_email",
2375
+ "type": "text",
2376
+ "primaryKey": false,
2377
+ "notNull": false
2378
+ }
2379
+ },
2380
+ "indexes": {
2381
+ "trial_credits_expiry_idx": {
2382
+ "name": "trial_credits_expiry_idx",
2383
+ "columns": [
2384
+ {
2385
+ "expression": "status",
2386
+ "isExpression": false,
2387
+ "asc": true,
2388
+ "nulls": "last"
2389
+ },
2390
+ {
2391
+ "expression": "trial_end_date",
2392
+ "isExpression": false,
2393
+ "asc": true,
2394
+ "nulls": "last"
2395
+ }
2396
+ ],
2397
+ "isUnique": false,
2398
+ "concurrently": false,
2399
+ "method": "btree",
2400
+ "with": {}
2401
+ }
2402
+ },
2403
+ "foreignKeys": {
2404
+ "trial_credits_workspace_id_organization_id_fk": {
2405
+ "name": "trial_credits_workspace_id_organization_id_fk",
2406
+ "tableFrom": "trial_credits",
2407
+ "tableTo": "organization",
2408
+ "columnsFrom": ["workspace_id"],
2409
+ "columnsTo": ["id"],
2410
+ "onDelete": "cascade",
2411
+ "onUpdate": "no action"
2412
+ }
2413
+ },
2414
+ "compositePrimaryKeys": {},
2415
+ "uniqueConstraints": {
2416
+ "trial_credits_workspace_id_unique": {
2417
+ "name": "trial_credits_workspace_id_unique",
2418
+ "nullsNotDistinct": false,
2419
+ "columns": ["workspace_id"]
2420
+ }
2421
+ },
2422
+ "policies": {},
2423
+ "checkConstraints": {},
2424
+ "isRLSEnabled": false
2425
+ },
2426
+ "public.usage_records": {
2427
+ "name": "usage_records",
2428
+ "schema": "",
2429
+ "columns": {
2430
+ "id": {
2431
+ "name": "id",
2432
+ "type": "text",
2433
+ "primaryKey": true,
2434
+ "notNull": true
2435
+ },
2436
+ "workspace_id": {
2437
+ "name": "workspace_id",
2438
+ "type": "text",
2439
+ "primaryKey": false,
2440
+ "notNull": true
2441
+ },
2442
+ "user_id": {
2443
+ "name": "user_id",
2444
+ "type": "text",
2445
+ "primaryKey": false,
2446
+ "notNull": true
2447
+ },
2448
+ "type": {
2449
+ "name": "type",
2450
+ "type": "text",
2451
+ "primaryKey": false,
2452
+ "notNull": true
2453
+ },
2454
+ "model": {
2455
+ "name": "model",
2456
+ "type": "text",
2457
+ "primaryKey": false,
2458
+ "notNull": false
2459
+ },
2460
+ "agent": {
2461
+ "name": "agent",
2462
+ "type": "text",
2463
+ "primaryKey": false,
2464
+ "notNull": false
2465
+ },
2466
+ "input_tokens": {
2467
+ "name": "input_tokens",
2468
+ "type": "integer",
2469
+ "primaryKey": false,
2470
+ "notNull": true,
2471
+ "default": 0
2472
+ },
2473
+ "output_tokens": {
2474
+ "name": "output_tokens",
2475
+ "type": "integer",
2476
+ "primaryKey": false,
2477
+ "notNull": true,
2478
+ "default": 0
2479
+ },
2480
+ "total_tokens": {
2481
+ "name": "total_tokens",
2482
+ "type": "integer",
2483
+ "primaryKey": false,
2484
+ "notNull": true,
2485
+ "default": 0
2486
+ },
2487
+ "metadata": {
2488
+ "name": "metadata",
2489
+ "type": "text",
2490
+ "primaryKey": false,
2491
+ "notNull": false
2492
+ },
2493
+ "recorded_at": {
2494
+ "name": "recorded_at",
2495
+ "type": "timestamp",
2496
+ "primaryKey": false,
2497
+ "notNull": true,
2498
+ "default": "now()"
2499
+ }
2500
+ },
2501
+ "indexes": {
2502
+ "usage_records_workspace_id_idx": {
2503
+ "name": "usage_records_workspace_id_idx",
2504
+ "columns": [
2505
+ {
2506
+ "expression": "workspace_id",
2507
+ "isExpression": false,
2508
+ "asc": true,
2509
+ "nulls": "last"
2510
+ }
2511
+ ],
2512
+ "isUnique": false,
2513
+ "concurrently": false,
2514
+ "method": "btree",
2515
+ "with": {}
2516
+ },
2517
+ "usage_records_workspace_recorded_at_idx": {
2518
+ "name": "usage_records_workspace_recorded_at_idx",
2519
+ "columns": [
2520
+ {
2521
+ "expression": "workspace_id",
2522
+ "isExpression": false,
2523
+ "asc": true,
2524
+ "nulls": "last"
2525
+ },
2526
+ {
2527
+ "expression": "recorded_at",
2528
+ "isExpression": false,
2529
+ "asc": true,
2530
+ "nulls": "last"
2531
+ }
2532
+ ],
2533
+ "isUnique": false,
2534
+ "concurrently": false,
2535
+ "method": "btree",
2536
+ "with": {}
2537
+ },
2538
+ "usage_records_workspace_type_idx": {
2539
+ "name": "usage_records_workspace_type_idx",
2540
+ "columns": [
2541
+ {
2542
+ "expression": "workspace_id",
2543
+ "isExpression": false,
2544
+ "asc": true,
2545
+ "nulls": "last"
2546
+ },
2547
+ {
2548
+ "expression": "type",
2549
+ "isExpression": false,
2550
+ "asc": true,
2551
+ "nulls": "last"
2552
+ }
2553
+ ],
2554
+ "isUnique": false,
2555
+ "concurrently": false,
2556
+ "method": "btree",
2557
+ "with": {}
2558
+ }
2559
+ },
2560
+ "foreignKeys": {
2561
+ "usage_records_workspace_id_organization_id_fk": {
2562
+ "name": "usage_records_workspace_id_organization_id_fk",
2563
+ "tableFrom": "usage_records",
2564
+ "tableTo": "organization",
2565
+ "columnsFrom": ["workspace_id"],
2566
+ "columnsTo": ["id"],
2567
+ "onDelete": "cascade",
2568
+ "onUpdate": "no action"
2569
+ },
2570
+ "usage_records_user_id_users_id_fk": {
2571
+ "name": "usage_records_user_id_users_id_fk",
2572
+ "tableFrom": "usage_records",
2573
+ "tableTo": "users",
2574
+ "columnsFrom": ["user_id"],
2575
+ "columnsTo": ["id"],
2576
+ "onDelete": "cascade",
2577
+ "onUpdate": "no action"
2578
+ }
2579
+ },
2580
+ "compositePrimaryKeys": {},
2581
+ "uniqueConstraints": {},
2582
+ "policies": {},
2583
+ "checkConstraints": {},
2584
+ "isRLSEnabled": false
2585
+ },
2586
+ "public.notifications": {
2587
+ "name": "notifications",
2588
+ "schema": "",
2589
+ "columns": {
2590
+ "id": {
2591
+ "name": "id",
2592
+ "type": "text",
2593
+ "primaryKey": true,
2594
+ "notNull": true
2595
+ },
2596
+ "user_id": {
2597
+ "name": "user_id",
2598
+ "type": "text",
2599
+ "primaryKey": false,
2600
+ "notNull": true
2601
+ },
2602
+ "workspace_id": {
2603
+ "name": "workspace_id",
2604
+ "type": "text",
2605
+ "primaryKey": false,
2606
+ "notNull": false
2607
+ },
2608
+ "type": {
2609
+ "name": "type",
2610
+ "type": "text",
2611
+ "primaryKey": false,
2612
+ "notNull": true
2613
+ },
2614
+ "title": {
2615
+ "name": "title",
2616
+ "type": "text",
2617
+ "primaryKey": false,
2618
+ "notNull": true
2619
+ },
2620
+ "message": {
2621
+ "name": "message",
2622
+ "type": "text",
2623
+ "primaryKey": false,
2624
+ "notNull": true
2625
+ },
2626
+ "is_read": {
2627
+ "name": "is_read",
2628
+ "type": "boolean",
2629
+ "primaryKey": false,
2630
+ "notNull": true,
2631
+ "default": false
2632
+ },
2633
+ "metadata": {
2634
+ "name": "metadata",
2635
+ "type": "text",
2636
+ "primaryKey": false,
2637
+ "notNull": false
2638
+ },
2639
+ "created_at": {
2640
+ "name": "created_at",
2641
+ "type": "timestamp",
2642
+ "primaryKey": false,
2643
+ "notNull": true,
2644
+ "default": "now()"
2645
+ }
2646
+ },
2647
+ "indexes": {
2648
+ "notifications_user_id_idx": {
2649
+ "name": "notifications_user_id_idx",
2650
+ "columns": [
2651
+ {
2652
+ "expression": "user_id",
2653
+ "isExpression": false,
2654
+ "asc": true,
2655
+ "nulls": "last"
2656
+ }
2657
+ ],
2658
+ "isUnique": false,
2659
+ "concurrently": false,
2660
+ "method": "btree",
2661
+ "with": {}
2662
+ },
2663
+ "notifications_user_id_is_read_idx": {
2664
+ "name": "notifications_user_id_is_read_idx",
2665
+ "columns": [
2666
+ {
2667
+ "expression": "user_id",
2668
+ "isExpression": false,
2669
+ "asc": true,
2670
+ "nulls": "last"
2671
+ },
2672
+ {
2673
+ "expression": "is_read",
2674
+ "isExpression": false,
2675
+ "asc": true,
2676
+ "nulls": "last"
2677
+ }
2678
+ ],
2679
+ "isUnique": false,
2680
+ "concurrently": false,
2681
+ "method": "btree",
2682
+ "with": {}
2683
+ },
2684
+ "notifications_created_at_idx": {
2685
+ "name": "notifications_created_at_idx",
2686
+ "columns": [
2687
+ {
2688
+ "expression": "created_at",
2689
+ "isExpression": false,
2690
+ "asc": true,
2691
+ "nulls": "last"
2692
+ }
2693
+ ],
2694
+ "isUnique": false,
2695
+ "concurrently": false,
2696
+ "method": "btree",
2697
+ "with": {}
2698
+ }
2699
+ },
2700
+ "foreignKeys": {},
2701
+ "compositePrimaryKeys": {},
2702
+ "uniqueConstraints": {},
2703
+ "policies": {},
2704
+ "checkConstraints": {},
2705
+ "isRLSEnabled": false
2706
+ }
2707
+ },
2708
+ "enums": {},
2709
+ "schemas": {},
2710
+ "sequences": {},
2711
+ "roles": {},
2712
+ "policies": {},
2713
+ "views": {},
2714
+ "_meta": {
2715
+ "columns": {},
2716
+ "schemas": {},
2717
+ "tables": {}
2718
+ }
2719
+ }