@bevel-software/platform-core-backend 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/dist/core/create-core-server.d.ts.map +1 -1
  2. package/dist/core/create-core-server.js +12 -1
  3. package/dist/core/create-core-server.js.map +1 -1
  4. package/dist/core/create-core-services.d.ts +22 -0
  5. package/dist/core/create-core-services.d.ts.map +1 -1
  6. package/dist/core/create-core-services.js +34 -1
  7. package/dist/core/create-core-services.js.map +1 -1
  8. package/dist/index.d.ts +2 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +4 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/modules/access/access-control.interface.d.ts +54 -28
  13. package/dist/modules/access/access-control.interface.d.ts.map +1 -1
  14. package/dist/modules/access/access-control.service.d.ts +129 -14
  15. package/dist/modules/access/access-control.service.d.ts.map +1 -1
  16. package/dist/modules/access/access-control.service.js +435 -66
  17. package/dist/modules/access/access-control.service.js.map +1 -1
  18. package/dist/modules/access/access-declarations.d.ts.map +1 -1
  19. package/dist/modules/access/access-declarations.js +5 -3
  20. package/dist/modules/access/access-declarations.js.map +1 -1
  21. package/dist/modules/access/access-mutation.service.d.ts +39 -6
  22. package/dist/modules/access/access-mutation.service.d.ts.map +1 -1
  23. package/dist/modules/access/access-mutation.service.js +78 -18
  24. package/dist/modules/access/access-mutation.service.js.map +1 -1
  25. package/dist/modules/access/access-splice.d.ts +31 -4
  26. package/dist/modules/access/access-splice.d.ts.map +1 -1
  27. package/dist/modules/access/access-splice.js +40 -16
  28. package/dist/modules/access/access-splice.js.map +1 -1
  29. package/dist/modules/access/access.routes.d.ts.map +1 -1
  30. package/dist/modules/access/access.routes.js +204 -82
  31. package/dist/modules/access/access.routes.js.map +1 -1
  32. package/dist/modules/access/admin-locked-commit.d.ts +134 -0
  33. package/dist/modules/access/admin-locked-commit.d.ts.map +1 -0
  34. package/dist/modules/access/admin-locked-commit.js +277 -0
  35. package/dist/modules/access/admin-locked-commit.js.map +1 -0
  36. package/dist/modules/access/admin-route-helpers.d.ts +32 -0
  37. package/dist/modules/access/admin-route-helpers.d.ts.map +1 -0
  38. package/dist/modules/access/admin-route-helpers.js +44 -0
  39. package/dist/modules/access/admin-route-helpers.js.map +1 -0
  40. package/dist/modules/access/capability-registry.d.ts +41 -0
  41. package/dist/modules/access/capability-registry.d.ts.map +1 -0
  42. package/dist/modules/access/capability-registry.js +46 -0
  43. package/dist/modules/access/capability-registry.js.map +1 -0
  44. package/dist/modules/access/directory-sync-bot.d.ts +13 -0
  45. package/dist/modules/access/directory-sync-bot.d.ts.map +1 -0
  46. package/dist/modules/access/directory-sync-bot.js +64 -0
  47. package/dist/modules/access/directory-sync-bot.js.map +1 -0
  48. package/dist/modules/access/group-files.d.ts +83 -0
  49. package/dist/modules/access/group-files.d.ts.map +1 -0
  50. package/dist/modules/access/group-files.js +167 -0
  51. package/dist/modules/access/group-files.js.map +1 -0
  52. package/dist/modules/access/groups-admin.routes.d.ts +19 -0
  53. package/dist/modules/access/groups-admin.routes.d.ts.map +1 -0
  54. package/dist/modules/access/groups-admin.routes.js +98 -0
  55. package/dist/modules/access/groups-admin.routes.js.map +1 -0
  56. package/dist/modules/access/groups-admin.service.d.ts +166 -0
  57. package/dist/modules/access/groups-admin.service.d.ts.map +1 -0
  58. package/dist/modules/access/groups-admin.service.js +442 -0
  59. package/dist/modules/access/groups-admin.service.js.map +1 -0
  60. package/dist/modules/access/groups-edit.d.ts +58 -0
  61. package/dist/modules/access/groups-edit.d.ts.map +1 -0
  62. package/dist/modules/access/groups-edit.js +162 -0
  63. package/dist/modules/access/groups-edit.js.map +1 -0
  64. package/dist/modules/access/reference-scan.d.ts +141 -0
  65. package/dist/modules/access/reference-scan.d.ts.map +1 -0
  66. package/dist/modules/access/reference-scan.js +440 -0
  67. package/dist/modules/access/reference-scan.js.map +1 -0
  68. package/dist/modules/access/roles-admin.service.d.ts +88 -119
  69. package/dist/modules/access/roles-admin.service.d.ts.map +1 -1
  70. package/dist/modules/access/roles-admin.service.js +230 -384
  71. package/dist/modules/access/roles-admin.service.js.map +1 -1
  72. package/dist/modules/access/roles-edit.d.ts +51 -25
  73. package/dist/modules/access/roles-edit.d.ts.map +1 -1
  74. package/dist/modules/access/roles-edit.js +133 -59
  75. package/dist/modules/access/roles-edit.js.map +1 -1
  76. package/dist/modules/access/synced-groups-committer.d.ts +28 -0
  77. package/dist/modules/access/synced-groups-committer.d.ts.map +1 -0
  78. package/dist/modules/access/synced-groups-committer.js +139 -0
  79. package/dist/modules/access/synced-groups-committer.js.map +1 -0
  80. package/dist/modules/access/synced-groups-writer.d.ts +78 -0
  81. package/dist/modules/access/synced-groups-writer.d.ts.map +1 -0
  82. package/dist/modules/access/synced-groups-writer.js +219 -0
  83. package/dist/modules/access/synced-groups-writer.js.map +1 -0
  84. package/dist/modules/database/core-schema.d.ts +17 -0
  85. package/dist/modules/database/core-schema.d.ts.map +1 -1
  86. package/dist/modules/database/core-schema.js +9 -0
  87. package/dist/modules/database/core-schema.js.map +1 -1
  88. package/dist/modules/mcp/mcp-auth.middleware.d.ts +13 -2
  89. package/dist/modules/mcp/mcp-auth.middleware.d.ts.map +1 -1
  90. package/dist/modules/mcp/mcp-auth.middleware.js +61 -2
  91. package/dist/modules/mcp/mcp-auth.middleware.js.map +1 -1
  92. package/dist/modules/mcp/mcp.routes.d.ts +9 -3
  93. package/dist/modules/mcp/mcp.routes.d.ts.map +1 -1
  94. package/dist/modules/mcp/mcp.routes.js +126 -2
  95. package/dist/modules/mcp/mcp.routes.js.map +1 -1
  96. package/dist/modules/mcp/mcp.service.d.ts +14 -0
  97. package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
  98. package/dist/modules/mcp/mcp.service.js +6 -1
  99. package/dist/modules/mcp/mcp.service.js.map +1 -1
  100. package/dist/modules/workflow/file-lock.service.d.ts +11 -1
  101. package/dist/modules/workflow/file-lock.service.d.ts.map +1 -1
  102. package/dist/modules/workflow/file-lock.service.js +15 -1
  103. package/dist/modules/workflow/file-lock.service.js.map +1 -1
  104. package/dist/modules/workflow/git/git.service.d.ts +34 -11
  105. package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
  106. package/dist/modules/workflow/git/git.service.js +165 -37
  107. package/dist/modules/workflow/git/git.service.js.map +1 -1
  108. package/dist/modules/workflow/locking-filesystem.d.ts +4 -0
  109. package/dist/modules/workflow/locking-filesystem.d.ts.map +1 -1
  110. package/dist/modules/workflow/locking-filesystem.js +181 -28
  111. package/dist/modules/workflow/locking-filesystem.js.map +1 -1
  112. package/dist/modules/workflow/pending-commits.service.d.ts +10 -0
  113. package/dist/modules/workflow/pending-commits.service.d.ts.map +1 -1
  114. package/dist/modules/workflow/pending-commits.service.js +19 -1
  115. package/dist/modules/workflow/pending-commits.service.js.map +1 -1
  116. package/dist/modules/workflow/workflow.service.d.ts +17 -2
  117. package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
  118. package/dist/modules/workflow/workflow.service.js +113 -19
  119. package/dist/modules/workflow/workflow.service.js.map +1 -1
  120. package/kb-template/AGENTS.md +4 -1
  121. package/migrations/0004_file_lock_mode.sql +2 -0
  122. package/migrations/meta/0004_snapshot.json +1564 -0
  123. package/migrations/meta/_journal.json +7 -0
  124. package/package.json +3 -3
  125. package/src/core/create-core-server.ts +13 -0
  126. package/src/core/create-core-services.ts +68 -0
  127. package/src/index.ts +10 -0
  128. package/src/modules/access/__tests__/access-control.service.test.ts +9 -3
  129. package/src/modules/access/__tests__/access-groups.test.ts +427 -0
  130. package/src/modules/access/__tests__/access-mutation.service.test.ts +171 -5
  131. package/src/modules/access/__tests__/access-splice.test.ts +65 -0
  132. package/src/modules/access/__tests__/access.routes.group-grant.test.ts +337 -0
  133. package/src/modules/access/__tests__/access.routes.revoke.test.ts +48 -0
  134. package/src/modules/access/__tests__/admin-locked-commit.test.ts +221 -0
  135. package/src/modules/access/__tests__/admin-route-helpers.test.ts +61 -0
  136. package/src/modules/access/__tests__/directory-sync-bot.test.ts +106 -0
  137. package/src/modules/access/__tests__/grant-sources.test.ts +67 -0
  138. package/src/modules/access/__tests__/groups-admin.service.test.ts +440 -0
  139. package/src/modules/access/__tests__/reference-scan.test.ts +288 -0
  140. package/src/modules/access/__tests__/roles-admin.service.test.ts +161 -83
  141. package/src/modules/access/__tests__/roles-capabilities.test.ts +325 -0
  142. package/src/modules/access/__tests__/roles-edit.test.ts +104 -28
  143. package/src/modules/access/__tests__/roles.routes.test.ts +63 -40
  144. package/src/modules/access/__tests__/synced-groups-committer.test.ts +238 -0
  145. package/src/modules/access/__tests__/synced-groups-writer.test.ts +249 -0
  146. package/src/modules/access/access-control.interface.ts +66 -32
  147. package/src/modules/access/access-control.service.ts +536 -73
  148. package/src/modules/access/access-declarations.ts +5 -2
  149. package/src/modules/access/access-mutation.service.ts +88 -14
  150. package/src/modules/access/access-splice.ts +55 -17
  151. package/src/modules/access/access.routes.ts +227 -93
  152. package/src/modules/access/admin-locked-commit.ts +331 -0
  153. package/src/modules/access/admin-route-helpers.ts +55 -0
  154. package/src/modules/access/capability-registry.ts +74 -0
  155. package/src/modules/access/directory-sync-bot.ts +76 -0
  156. package/src/modules/access/group-files.ts +212 -0
  157. package/src/modules/access/groups-admin.routes.ts +113 -0
  158. package/src/modules/access/groups-admin.service.ts +551 -0
  159. package/src/modules/access/groups-edit.ts +187 -0
  160. package/src/modules/access/reference-scan.ts +513 -0
  161. package/src/modules/access/roles-admin.service.ts +290 -418
  162. package/src/modules/access/roles-edit.ts +134 -61
  163. package/src/modules/access/synced-groups-committer.ts +177 -0
  164. package/src/modules/access/synced-groups-writer.ts +303 -0
  165. package/src/modules/database/core-schema.ts +9 -0
  166. package/src/modules/mcp/__tests__/mcp-auth.middleware.test.ts +116 -0
  167. package/src/modules/mcp/__tests__/mcp.e2e.test.ts +3 -1
  168. package/src/modules/mcp/__tests__/mcp.routes.delete.test.ts +6 -1
  169. package/src/modules/mcp/__tests__/mcp.routes.local-token.test.ts +301 -0
  170. package/src/modules/mcp/mcp-auth.middleware.ts +61 -1
  171. package/src/modules/mcp/mcp.routes.ts +137 -2
  172. package/src/modules/mcp/mcp.service.ts +6 -1
  173. package/src/modules/workflow/__tests__/locking-filesystem.test.ts +336 -0
  174. package/src/modules/workflow/__tests__/preserve-roles-yaml.test.ts +1 -1
  175. package/src/modules/workflow/__tests__/workflow.service.commitFileWhileLocked.test.ts +32 -0
  176. package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +13 -2
  177. package/src/modules/workflow/__tests__/workflow.service.releaseLock.test.ts +139 -1
  178. package/src/modules/workflow/file-lock.service.ts +15 -0
  179. package/src/modules/workflow/git/__tests__/git.service.accessGating.test.ts +0 -1
  180. package/src/modules/workflow/git/__tests__/git.service.commitChanges.test.ts +132 -0
  181. package/src/modules/workflow/git/__tests__/git.service.deleteBranch.test.ts +0 -1
  182. package/src/modules/workflow/git/__tests__/pull-request.service.test.ts +0 -1
  183. package/src/modules/workflow/git/git.service.ts +174 -35
  184. package/src/modules/workflow/locking-filesystem.ts +188 -26
  185. package/src/modules/workflow/pending-commits.service.ts +27 -1
  186. package/src/modules/workflow/review-workflow/__tests__/approval-states.test.ts +0 -1
  187. package/src/modules/workflow/review-workflow/__tests__/cancel-pr.test.ts +0 -1
  188. package/src/modules/workflow/workflow.service.ts +140 -20
@@ -0,0 +1,1564 @@
1
+ {
2
+ "id": "16b22a96-7e97-4951-afd7-6bd2dcfd8ec7",
3
+ "prevId": "9ac966ba-2390-4f9b-994c-09311912fa51",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.change_requests": {
8
+ "name": "change_requests",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "number": {
19
+ "name": "number",
20
+ "type": "integer",
21
+ "primaryKey": false,
22
+ "notNull": true,
23
+ "identity": {
24
+ "type": "always",
25
+ "name": "change_requests_number_seq",
26
+ "schema": "public",
27
+ "increment": "1",
28
+ "startWith": "1",
29
+ "minValue": "1",
30
+ "maxValue": "2147483647",
31
+ "cache": "1",
32
+ "cycle": false
33
+ }
34
+ },
35
+ "source_branch": {
36
+ "name": "source_branch",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "target_branch": {
42
+ "name": "target_branch",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": true
46
+ },
47
+ "title": {
48
+ "name": "title",
49
+ "type": "text",
50
+ "primaryKey": false,
51
+ "notNull": true
52
+ },
53
+ "body": {
54
+ "name": "body",
55
+ "type": "text",
56
+ "primaryKey": false,
57
+ "notNull": true,
58
+ "default": "''"
59
+ },
60
+ "author_email": {
61
+ "name": "author_email",
62
+ "type": "text",
63
+ "primaryKey": false,
64
+ "notNull": true
65
+ },
66
+ "author_name": {
67
+ "name": "author_name",
68
+ "type": "text",
69
+ "primaryKey": false,
70
+ "notNull": true
71
+ },
72
+ "state": {
73
+ "name": "state",
74
+ "type": "text",
75
+ "primaryKey": false,
76
+ "notNull": true,
77
+ "default": "'open'"
78
+ },
79
+ "merged_sha": {
80
+ "name": "merged_sha",
81
+ "type": "text",
82
+ "primaryKey": false,
83
+ "notNull": false
84
+ },
85
+ "created_at": {
86
+ "name": "created_at",
87
+ "type": "timestamp",
88
+ "primaryKey": false,
89
+ "notNull": true,
90
+ "default": "now()"
91
+ },
92
+ "updated_at": {
93
+ "name": "updated_at",
94
+ "type": "timestamp",
95
+ "primaryKey": false,
96
+ "notNull": false
97
+ },
98
+ "closed_at": {
99
+ "name": "closed_at",
100
+ "type": "timestamp",
101
+ "primaryKey": false,
102
+ "notNull": false
103
+ }
104
+ },
105
+ "indexes": {
106
+ "change_requests_number_unq": {
107
+ "name": "change_requests_number_unq",
108
+ "columns": [
109
+ {
110
+ "expression": "number",
111
+ "isExpression": false,
112
+ "asc": true,
113
+ "nulls": "last"
114
+ }
115
+ ],
116
+ "isUnique": true,
117
+ "concurrently": false,
118
+ "method": "btree",
119
+ "with": {}
120
+ },
121
+ "change_requests_open_pair_unq": {
122
+ "name": "change_requests_open_pair_unq",
123
+ "columns": [
124
+ {
125
+ "expression": "source_branch",
126
+ "isExpression": false,
127
+ "asc": true,
128
+ "nulls": "last"
129
+ },
130
+ {
131
+ "expression": "target_branch",
132
+ "isExpression": false,
133
+ "asc": true,
134
+ "nulls": "last"
135
+ }
136
+ ],
137
+ "isUnique": true,
138
+ "where": "\"change_requests\".\"state\" = 'open'",
139
+ "concurrently": false,
140
+ "method": "btree",
141
+ "with": {}
142
+ },
143
+ "change_requests_by_state": {
144
+ "name": "change_requests_by_state",
145
+ "columns": [
146
+ {
147
+ "expression": "state",
148
+ "isExpression": false,
149
+ "asc": true,
150
+ "nulls": "last"
151
+ }
152
+ ],
153
+ "isUnique": false,
154
+ "concurrently": false,
155
+ "method": "btree",
156
+ "with": {}
157
+ }
158
+ },
159
+ "foreignKeys": {},
160
+ "compositePrimaryKeys": {},
161
+ "uniqueConstraints": {},
162
+ "policies": {},
163
+ "checkConstraints": {
164
+ "change_requests_state_check": {
165
+ "name": "change_requests_state_check",
166
+ "value": "\"change_requests\".\"state\" IN ('open', 'merged', 'closed')"
167
+ }
168
+ },
169
+ "isRLSEnabled": false
170
+ },
171
+ "public.deployment_settings": {
172
+ "name": "deployment_settings",
173
+ "schema": "",
174
+ "columns": {
175
+ "key": {
176
+ "name": "key",
177
+ "type": "text",
178
+ "primaryKey": true,
179
+ "notNull": true
180
+ },
181
+ "value": {
182
+ "name": "value",
183
+ "type": "text",
184
+ "primaryKey": false,
185
+ "notNull": true
186
+ },
187
+ "encrypted": {
188
+ "name": "encrypted",
189
+ "type": "boolean",
190
+ "primaryKey": false,
191
+ "notNull": true,
192
+ "default": false
193
+ },
194
+ "updated_by": {
195
+ "name": "updated_by",
196
+ "type": "uuid",
197
+ "primaryKey": false,
198
+ "notNull": false
199
+ },
200
+ "updated_at": {
201
+ "name": "updated_at",
202
+ "type": "timestamp",
203
+ "primaryKey": false,
204
+ "notNull": true,
205
+ "default": "now()"
206
+ }
207
+ },
208
+ "indexes": {},
209
+ "foreignKeys": {
210
+ "deployment_settings_updated_by_users_id_fk": {
211
+ "name": "deployment_settings_updated_by_users_id_fk",
212
+ "tableFrom": "deployment_settings",
213
+ "tableTo": "users",
214
+ "columnsFrom": [
215
+ "updated_by"
216
+ ],
217
+ "columnsTo": [
218
+ "id"
219
+ ],
220
+ "onDelete": "set null",
221
+ "onUpdate": "no action"
222
+ }
223
+ },
224
+ "compositePrimaryKeys": {},
225
+ "uniqueConstraints": {},
226
+ "policies": {},
227
+ "checkConstraints": {},
228
+ "isRLSEnabled": false
229
+ },
230
+ "public.api_tokens": {
231
+ "name": "api_tokens",
232
+ "schema": "",
233
+ "columns": {
234
+ "id": {
235
+ "name": "id",
236
+ "type": "uuid",
237
+ "primaryKey": true,
238
+ "notNull": true,
239
+ "default": "gen_random_uuid()"
240
+ },
241
+ "user_id": {
242
+ "name": "user_id",
243
+ "type": "uuid",
244
+ "primaryKey": false,
245
+ "notNull": true
246
+ },
247
+ "token_hash": {
248
+ "name": "token_hash",
249
+ "type": "text",
250
+ "primaryKey": false,
251
+ "notNull": true
252
+ },
253
+ "label": {
254
+ "name": "label",
255
+ "type": "text",
256
+ "primaryKey": false,
257
+ "notNull": true
258
+ },
259
+ "created_at": {
260
+ "name": "created_at",
261
+ "type": "timestamp",
262
+ "primaryKey": false,
263
+ "notNull": true,
264
+ "default": "now()"
265
+ },
266
+ "last_used_at": {
267
+ "name": "last_used_at",
268
+ "type": "timestamp",
269
+ "primaryKey": false,
270
+ "notNull": false
271
+ },
272
+ "revoked_at": {
273
+ "name": "revoked_at",
274
+ "type": "timestamp",
275
+ "primaryKey": false,
276
+ "notNull": false
277
+ }
278
+ },
279
+ "indexes": {
280
+ "api_tokens_by_user": {
281
+ "name": "api_tokens_by_user",
282
+ "columns": [
283
+ {
284
+ "expression": "user_id",
285
+ "isExpression": false,
286
+ "asc": true,
287
+ "nulls": "last"
288
+ }
289
+ ],
290
+ "isUnique": false,
291
+ "concurrently": false,
292
+ "method": "btree",
293
+ "with": {}
294
+ }
295
+ },
296
+ "foreignKeys": {
297
+ "api_tokens_user_id_users_id_fk": {
298
+ "name": "api_tokens_user_id_users_id_fk",
299
+ "tableFrom": "api_tokens",
300
+ "tableTo": "users",
301
+ "columnsFrom": [
302
+ "user_id"
303
+ ],
304
+ "columnsTo": [
305
+ "id"
306
+ ],
307
+ "onDelete": "no action",
308
+ "onUpdate": "no action"
309
+ }
310
+ },
311
+ "compositePrimaryKeys": {},
312
+ "uniqueConstraints": {
313
+ "api_tokens_token_hash_unique": {
314
+ "name": "api_tokens_token_hash_unique",
315
+ "nullsNotDistinct": false,
316
+ "columns": [
317
+ "token_hash"
318
+ ]
319
+ }
320
+ },
321
+ "policies": {},
322
+ "checkConstraints": {},
323
+ "isRLSEnabled": false
324
+ },
325
+ "public.file_locks": {
326
+ "name": "file_locks",
327
+ "schema": "",
328
+ "columns": {
329
+ "workspace_id": {
330
+ "name": "workspace_id",
331
+ "type": "text",
332
+ "primaryKey": false,
333
+ "notNull": true
334
+ },
335
+ "branch": {
336
+ "name": "branch",
337
+ "type": "text",
338
+ "primaryKey": false,
339
+ "notNull": true
340
+ },
341
+ "path": {
342
+ "name": "path",
343
+ "type": "text",
344
+ "primaryKey": false,
345
+ "notNull": true
346
+ },
347
+ "holder_user_id": {
348
+ "name": "holder_user_id",
349
+ "type": "uuid",
350
+ "primaryKey": false,
351
+ "notNull": true
352
+ },
353
+ "holder_name": {
354
+ "name": "holder_name",
355
+ "type": "text",
356
+ "primaryKey": false,
357
+ "notNull": true
358
+ },
359
+ "mode": {
360
+ "name": "mode",
361
+ "type": "text",
362
+ "primaryKey": false,
363
+ "notNull": true,
364
+ "default": "'edit'"
365
+ },
366
+ "acquired_at": {
367
+ "name": "acquired_at",
368
+ "type": "timestamp",
369
+ "primaryKey": false,
370
+ "notNull": true,
371
+ "default": "now()"
372
+ },
373
+ "last_heartbeat_at": {
374
+ "name": "last_heartbeat_at",
375
+ "type": "timestamp",
376
+ "primaryKey": false,
377
+ "notNull": true,
378
+ "default": "now()"
379
+ },
380
+ "expires_at": {
381
+ "name": "expires_at",
382
+ "type": "timestamp",
383
+ "primaryKey": false,
384
+ "notNull": true
385
+ }
386
+ },
387
+ "indexes": {
388
+ "file_locks_by_expiry": {
389
+ "name": "file_locks_by_expiry",
390
+ "columns": [
391
+ {
392
+ "expression": "expires_at",
393
+ "isExpression": false,
394
+ "asc": true,
395
+ "nulls": "last"
396
+ }
397
+ ],
398
+ "isUnique": false,
399
+ "concurrently": false,
400
+ "method": "btree",
401
+ "with": {}
402
+ },
403
+ "file_locks_by_holder": {
404
+ "name": "file_locks_by_holder",
405
+ "columns": [
406
+ {
407
+ "expression": "holder_user_id",
408
+ "isExpression": false,
409
+ "asc": true,
410
+ "nulls": "last"
411
+ }
412
+ ],
413
+ "isUnique": false,
414
+ "concurrently": false,
415
+ "method": "btree",
416
+ "with": {}
417
+ }
418
+ },
419
+ "foreignKeys": {
420
+ "file_locks_holder_user_id_users_id_fk": {
421
+ "name": "file_locks_holder_user_id_users_id_fk",
422
+ "tableFrom": "file_locks",
423
+ "tableTo": "users",
424
+ "columnsFrom": [
425
+ "holder_user_id"
426
+ ],
427
+ "columnsTo": [
428
+ "id"
429
+ ],
430
+ "onDelete": "no action",
431
+ "onUpdate": "no action"
432
+ }
433
+ },
434
+ "compositePrimaryKeys": {
435
+ "file_locks_workspace_id_branch_path_pk": {
436
+ "name": "file_locks_workspace_id_branch_path_pk",
437
+ "columns": [
438
+ "workspace_id",
439
+ "branch",
440
+ "path"
441
+ ]
442
+ }
443
+ },
444
+ "uniqueConstraints": {},
445
+ "policies": {},
446
+ "checkConstraints": {
447
+ "file_locks_mode": {
448
+ "name": "file_locks_mode",
449
+ "value": "\"file_locks\".\"mode\" IN ('edit', 'coordination')"
450
+ }
451
+ },
452
+ "isRLSEnabled": false
453
+ },
454
+ "public.oauth_auth_codes": {
455
+ "name": "oauth_auth_codes",
456
+ "schema": "",
457
+ "columns": {
458
+ "id": {
459
+ "name": "id",
460
+ "type": "uuid",
461
+ "primaryKey": true,
462
+ "notNull": true,
463
+ "default": "gen_random_uuid()"
464
+ },
465
+ "code_hash": {
466
+ "name": "code_hash",
467
+ "type": "text",
468
+ "primaryKey": false,
469
+ "notNull": true
470
+ },
471
+ "client_id": {
472
+ "name": "client_id",
473
+ "type": "text",
474
+ "primaryKey": false,
475
+ "notNull": true
476
+ },
477
+ "user_id": {
478
+ "name": "user_id",
479
+ "type": "uuid",
480
+ "primaryKey": false,
481
+ "notNull": true
482
+ },
483
+ "redirect_uri": {
484
+ "name": "redirect_uri",
485
+ "type": "text",
486
+ "primaryKey": false,
487
+ "notNull": true
488
+ },
489
+ "code_challenge": {
490
+ "name": "code_challenge",
491
+ "type": "text",
492
+ "primaryKey": false,
493
+ "notNull": true
494
+ },
495
+ "scope": {
496
+ "name": "scope",
497
+ "type": "text",
498
+ "primaryKey": false,
499
+ "notNull": false
500
+ },
501
+ "resource": {
502
+ "name": "resource",
503
+ "type": "text",
504
+ "primaryKey": false,
505
+ "notNull": false
506
+ },
507
+ "expires_at": {
508
+ "name": "expires_at",
509
+ "type": "timestamp",
510
+ "primaryKey": false,
511
+ "notNull": true
512
+ },
513
+ "consumed_at": {
514
+ "name": "consumed_at",
515
+ "type": "timestamp",
516
+ "primaryKey": false,
517
+ "notNull": false
518
+ },
519
+ "created_at": {
520
+ "name": "created_at",
521
+ "type": "timestamp",
522
+ "primaryKey": false,
523
+ "notNull": true,
524
+ "default": "now()"
525
+ }
526
+ },
527
+ "indexes": {
528
+ "oauth_auth_codes_by_expiry": {
529
+ "name": "oauth_auth_codes_by_expiry",
530
+ "columns": [
531
+ {
532
+ "expression": "expires_at",
533
+ "isExpression": false,
534
+ "asc": true,
535
+ "nulls": "last"
536
+ }
537
+ ],
538
+ "isUnique": false,
539
+ "concurrently": false,
540
+ "method": "btree",
541
+ "with": {}
542
+ }
543
+ },
544
+ "foreignKeys": {
545
+ "oauth_auth_codes_client_id_oauth_clients_client_id_fk": {
546
+ "name": "oauth_auth_codes_client_id_oauth_clients_client_id_fk",
547
+ "tableFrom": "oauth_auth_codes",
548
+ "tableTo": "oauth_clients",
549
+ "columnsFrom": [
550
+ "client_id"
551
+ ],
552
+ "columnsTo": [
553
+ "client_id"
554
+ ],
555
+ "onDelete": "no action",
556
+ "onUpdate": "no action"
557
+ },
558
+ "oauth_auth_codes_user_id_users_id_fk": {
559
+ "name": "oauth_auth_codes_user_id_users_id_fk",
560
+ "tableFrom": "oauth_auth_codes",
561
+ "tableTo": "users",
562
+ "columnsFrom": [
563
+ "user_id"
564
+ ],
565
+ "columnsTo": [
566
+ "id"
567
+ ],
568
+ "onDelete": "no action",
569
+ "onUpdate": "no action"
570
+ }
571
+ },
572
+ "compositePrimaryKeys": {},
573
+ "uniqueConstraints": {
574
+ "oauth_auth_codes_code_hash_unique": {
575
+ "name": "oauth_auth_codes_code_hash_unique",
576
+ "nullsNotDistinct": false,
577
+ "columns": [
578
+ "code_hash"
579
+ ]
580
+ }
581
+ },
582
+ "policies": {},
583
+ "checkConstraints": {},
584
+ "isRLSEnabled": false
585
+ },
586
+ "public.oauth_clients": {
587
+ "name": "oauth_clients",
588
+ "schema": "",
589
+ "columns": {
590
+ "client_id": {
591
+ "name": "client_id",
592
+ "type": "text",
593
+ "primaryKey": true,
594
+ "notNull": true
595
+ },
596
+ "client_secret_encrypted": {
597
+ "name": "client_secret_encrypted",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": false
601
+ },
602
+ "client_secret_expires_at": {
603
+ "name": "client_secret_expires_at",
604
+ "type": "timestamp",
605
+ "primaryKey": false,
606
+ "notNull": false
607
+ },
608
+ "redirect_uris": {
609
+ "name": "redirect_uris",
610
+ "type": "jsonb",
611
+ "primaryKey": false,
612
+ "notNull": true,
613
+ "default": "'[]'::jsonb"
614
+ },
615
+ "token_endpoint_auth_method": {
616
+ "name": "token_endpoint_auth_method",
617
+ "type": "text",
618
+ "primaryKey": false,
619
+ "notNull": true,
620
+ "default": "'none'"
621
+ },
622
+ "client_name": {
623
+ "name": "client_name",
624
+ "type": "text",
625
+ "primaryKey": false,
626
+ "notNull": false
627
+ },
628
+ "metadata": {
629
+ "name": "metadata",
630
+ "type": "jsonb",
631
+ "primaryKey": false,
632
+ "notNull": true,
633
+ "default": "'{}'::jsonb"
634
+ },
635
+ "created_at": {
636
+ "name": "created_at",
637
+ "type": "timestamp",
638
+ "primaryKey": false,
639
+ "notNull": true,
640
+ "default": "now()"
641
+ }
642
+ },
643
+ "indexes": {},
644
+ "foreignKeys": {},
645
+ "compositePrimaryKeys": {},
646
+ "uniqueConstraints": {},
647
+ "policies": {},
648
+ "checkConstraints": {},
649
+ "isRLSEnabled": false
650
+ },
651
+ "public.oauth_tokens": {
652
+ "name": "oauth_tokens",
653
+ "schema": "",
654
+ "columns": {
655
+ "id": {
656
+ "name": "id",
657
+ "type": "uuid",
658
+ "primaryKey": true,
659
+ "notNull": true,
660
+ "default": "gen_random_uuid()"
661
+ },
662
+ "access_token_hash": {
663
+ "name": "access_token_hash",
664
+ "type": "text",
665
+ "primaryKey": false,
666
+ "notNull": true
667
+ },
668
+ "refresh_token_hash": {
669
+ "name": "refresh_token_hash",
670
+ "type": "text",
671
+ "primaryKey": false,
672
+ "notNull": false
673
+ },
674
+ "client_id": {
675
+ "name": "client_id",
676
+ "type": "text",
677
+ "primaryKey": false,
678
+ "notNull": true
679
+ },
680
+ "user_id": {
681
+ "name": "user_id",
682
+ "type": "uuid",
683
+ "primaryKey": false,
684
+ "notNull": true
685
+ },
686
+ "scope": {
687
+ "name": "scope",
688
+ "type": "text",
689
+ "primaryKey": false,
690
+ "notNull": false
691
+ },
692
+ "resource": {
693
+ "name": "resource",
694
+ "type": "text",
695
+ "primaryKey": false,
696
+ "notNull": false
697
+ },
698
+ "expires_at": {
699
+ "name": "expires_at",
700
+ "type": "timestamp",
701
+ "primaryKey": false,
702
+ "notNull": true
703
+ },
704
+ "refresh_expires_at": {
705
+ "name": "refresh_expires_at",
706
+ "type": "timestamp",
707
+ "primaryKey": false,
708
+ "notNull": false
709
+ },
710
+ "revoked_at": {
711
+ "name": "revoked_at",
712
+ "type": "timestamp",
713
+ "primaryKey": false,
714
+ "notNull": false
715
+ },
716
+ "last_used_at": {
717
+ "name": "last_used_at",
718
+ "type": "timestamp",
719
+ "primaryKey": false,
720
+ "notNull": false
721
+ },
722
+ "created_at": {
723
+ "name": "created_at",
724
+ "type": "timestamp",
725
+ "primaryKey": false,
726
+ "notNull": true,
727
+ "default": "now()"
728
+ }
729
+ },
730
+ "indexes": {
731
+ "oauth_tokens_by_user": {
732
+ "name": "oauth_tokens_by_user",
733
+ "columns": [
734
+ {
735
+ "expression": "user_id",
736
+ "isExpression": false,
737
+ "asc": true,
738
+ "nulls": "last"
739
+ }
740
+ ],
741
+ "isUnique": false,
742
+ "concurrently": false,
743
+ "method": "btree",
744
+ "with": {}
745
+ },
746
+ "oauth_tokens_by_expiry": {
747
+ "name": "oauth_tokens_by_expiry",
748
+ "columns": [
749
+ {
750
+ "expression": "expires_at",
751
+ "isExpression": false,
752
+ "asc": true,
753
+ "nulls": "last"
754
+ }
755
+ ],
756
+ "isUnique": false,
757
+ "concurrently": false,
758
+ "method": "btree",
759
+ "with": {}
760
+ }
761
+ },
762
+ "foreignKeys": {
763
+ "oauth_tokens_client_id_oauth_clients_client_id_fk": {
764
+ "name": "oauth_tokens_client_id_oauth_clients_client_id_fk",
765
+ "tableFrom": "oauth_tokens",
766
+ "tableTo": "oauth_clients",
767
+ "columnsFrom": [
768
+ "client_id"
769
+ ],
770
+ "columnsTo": [
771
+ "client_id"
772
+ ],
773
+ "onDelete": "no action",
774
+ "onUpdate": "no action"
775
+ },
776
+ "oauth_tokens_user_id_users_id_fk": {
777
+ "name": "oauth_tokens_user_id_users_id_fk",
778
+ "tableFrom": "oauth_tokens",
779
+ "tableTo": "users",
780
+ "columnsFrom": [
781
+ "user_id"
782
+ ],
783
+ "columnsTo": [
784
+ "id"
785
+ ],
786
+ "onDelete": "no action",
787
+ "onUpdate": "no action"
788
+ }
789
+ },
790
+ "compositePrimaryKeys": {},
791
+ "uniqueConstraints": {
792
+ "oauth_tokens_access_token_hash_unique": {
793
+ "name": "oauth_tokens_access_token_hash_unique",
794
+ "nullsNotDistinct": false,
795
+ "columns": [
796
+ "access_token_hash"
797
+ ]
798
+ },
799
+ "oauth_tokens_refresh_token_hash_unique": {
800
+ "name": "oauth_tokens_refresh_token_hash_unique",
801
+ "nullsNotDistinct": false,
802
+ "columns": [
803
+ "refresh_token_hash"
804
+ ]
805
+ }
806
+ },
807
+ "policies": {},
808
+ "checkConstraints": {},
809
+ "isRLSEnabled": false
810
+ },
811
+ "public.pending_commits": {
812
+ "name": "pending_commits",
813
+ "schema": "",
814
+ "columns": {
815
+ "id": {
816
+ "name": "id",
817
+ "type": "uuid",
818
+ "primaryKey": true,
819
+ "notNull": true,
820
+ "default": "gen_random_uuid()"
821
+ },
822
+ "workspace_id": {
823
+ "name": "workspace_id",
824
+ "type": "text",
825
+ "primaryKey": false,
826
+ "notNull": true
827
+ },
828
+ "branch": {
829
+ "name": "branch",
830
+ "type": "text",
831
+ "primaryKey": false,
832
+ "notNull": true
833
+ },
834
+ "path": {
835
+ "name": "path",
836
+ "type": "text",
837
+ "primaryKey": false,
838
+ "notNull": true
839
+ },
840
+ "author_email": {
841
+ "name": "author_email",
842
+ "type": "text",
843
+ "primaryKey": false,
844
+ "notNull": true
845
+ },
846
+ "author_name": {
847
+ "name": "author_name",
848
+ "type": "text",
849
+ "primaryKey": false,
850
+ "notNull": true
851
+ },
852
+ "queued_at": {
853
+ "name": "queued_at",
854
+ "type": "timestamp",
855
+ "primaryKey": false,
856
+ "notNull": true,
857
+ "default": "now()"
858
+ },
859
+ "status": {
860
+ "name": "status",
861
+ "type": "text",
862
+ "primaryKey": false,
863
+ "notNull": true,
864
+ "default": "'pending'"
865
+ },
866
+ "attempts": {
867
+ "name": "attempts",
868
+ "type": "integer",
869
+ "primaryKey": false,
870
+ "notNull": true,
871
+ "default": 0
872
+ },
873
+ "recovery_agent_runs": {
874
+ "name": "recovery_agent_runs",
875
+ "type": "integer",
876
+ "primaryKey": false,
877
+ "notNull": true,
878
+ "default": 0
879
+ },
880
+ "last_attempted_at": {
881
+ "name": "last_attempted_at",
882
+ "type": "timestamp",
883
+ "primaryKey": false,
884
+ "notNull": false
885
+ },
886
+ "last_error": {
887
+ "name": "last_error",
888
+ "type": "text",
889
+ "primaryKey": false,
890
+ "notNull": false
891
+ }
892
+ },
893
+ "indexes": {
894
+ "pending_commits_by_workspace_queued": {
895
+ "name": "pending_commits_by_workspace_queued",
896
+ "columns": [
897
+ {
898
+ "expression": "workspace_id",
899
+ "isExpression": false,
900
+ "asc": true,
901
+ "nulls": "last"
902
+ },
903
+ {
904
+ "expression": "queued_at",
905
+ "isExpression": false,
906
+ "asc": true,
907
+ "nulls": "last"
908
+ }
909
+ ],
910
+ "isUnique": false,
911
+ "concurrently": false,
912
+ "method": "btree",
913
+ "with": {}
914
+ },
915
+ "pending_commits_by_status": {
916
+ "name": "pending_commits_by_status",
917
+ "columns": [
918
+ {
919
+ "expression": "status",
920
+ "isExpression": false,
921
+ "asc": true,
922
+ "nulls": "last"
923
+ },
924
+ {
925
+ "expression": "last_attempted_at",
926
+ "isExpression": false,
927
+ "asc": true,
928
+ "nulls": "last"
929
+ }
930
+ ],
931
+ "isUnique": false,
932
+ "concurrently": false,
933
+ "method": "btree",
934
+ "with": {}
935
+ },
936
+ "pending_commits_by_status_only": {
937
+ "name": "pending_commits_by_status_only",
938
+ "columns": [
939
+ {
940
+ "expression": "status",
941
+ "isExpression": false,
942
+ "asc": true,
943
+ "nulls": "last"
944
+ }
945
+ ],
946
+ "isUnique": false,
947
+ "concurrently": false,
948
+ "method": "btree",
949
+ "with": {}
950
+ }
951
+ },
952
+ "foreignKeys": {},
953
+ "compositePrimaryKeys": {},
954
+ "uniqueConstraints": {},
955
+ "policies": {},
956
+ "checkConstraints": {
957
+ "pending_commits_status": {
958
+ "name": "pending_commits_status",
959
+ "value": "\"pending_commits\".\"status\" IN ('pending', 'running', 'needs_attention')"
960
+ }
961
+ },
962
+ "isRLSEnabled": false
963
+ },
964
+ "public.pr_comments": {
965
+ "name": "pr_comments",
966
+ "schema": "",
967
+ "columns": {
968
+ "id": {
969
+ "name": "id",
970
+ "type": "uuid",
971
+ "primaryKey": true,
972
+ "notNull": true,
973
+ "default": "gen_random_uuid()"
974
+ },
975
+ "pr_number": {
976
+ "name": "pr_number",
977
+ "type": "integer",
978
+ "primaryKey": false,
979
+ "notNull": true
980
+ },
981
+ "author_email": {
982
+ "name": "author_email",
983
+ "type": "text",
984
+ "primaryKey": false,
985
+ "notNull": true
986
+ },
987
+ "author_name": {
988
+ "name": "author_name",
989
+ "type": "text",
990
+ "primaryKey": false,
991
+ "notNull": true
992
+ },
993
+ "path": {
994
+ "name": "path",
995
+ "type": "text",
996
+ "primaryKey": false,
997
+ "notNull": false
998
+ },
999
+ "line": {
1000
+ "name": "line",
1001
+ "type": "integer",
1002
+ "primaryKey": false,
1003
+ "notNull": false
1004
+ },
1005
+ "head_sha": {
1006
+ "name": "head_sha",
1007
+ "type": "text",
1008
+ "primaryKey": false,
1009
+ "notNull": true
1010
+ },
1011
+ "body": {
1012
+ "name": "body",
1013
+ "type": "text",
1014
+ "primaryKey": false,
1015
+ "notNull": true
1016
+ },
1017
+ "parent_id": {
1018
+ "name": "parent_id",
1019
+ "type": "uuid",
1020
+ "primaryKey": false,
1021
+ "notNull": false
1022
+ },
1023
+ "created_at": {
1024
+ "name": "created_at",
1025
+ "type": "timestamp",
1026
+ "primaryKey": false,
1027
+ "notNull": true,
1028
+ "default": "now()"
1029
+ },
1030
+ "updated_at": {
1031
+ "name": "updated_at",
1032
+ "type": "timestamp",
1033
+ "primaryKey": false,
1034
+ "notNull": false
1035
+ }
1036
+ },
1037
+ "indexes": {
1038
+ "pr_comments_by_pr": {
1039
+ "name": "pr_comments_by_pr",
1040
+ "columns": [
1041
+ {
1042
+ "expression": "pr_number",
1043
+ "isExpression": false,
1044
+ "asc": true,
1045
+ "nulls": "last"
1046
+ }
1047
+ ],
1048
+ "isUnique": false,
1049
+ "concurrently": false,
1050
+ "method": "btree",
1051
+ "with": {}
1052
+ },
1053
+ "pr_comments_by_thread": {
1054
+ "name": "pr_comments_by_thread",
1055
+ "columns": [
1056
+ {
1057
+ "expression": "pr_number",
1058
+ "isExpression": false,
1059
+ "asc": true,
1060
+ "nulls": "last"
1061
+ },
1062
+ {
1063
+ "expression": "path",
1064
+ "isExpression": false,
1065
+ "asc": true,
1066
+ "nulls": "last"
1067
+ },
1068
+ {
1069
+ "expression": "line",
1070
+ "isExpression": false,
1071
+ "asc": true,
1072
+ "nulls": "last"
1073
+ }
1074
+ ],
1075
+ "isUnique": false,
1076
+ "concurrently": false,
1077
+ "method": "btree",
1078
+ "with": {}
1079
+ }
1080
+ },
1081
+ "foreignKeys": {},
1082
+ "compositePrimaryKeys": {},
1083
+ "uniqueConstraints": {},
1084
+ "policies": {},
1085
+ "checkConstraints": {},
1086
+ "isRLSEnabled": false
1087
+ },
1088
+ "public.pr_file_approvals": {
1089
+ "name": "pr_file_approvals",
1090
+ "schema": "",
1091
+ "columns": {
1092
+ "id": {
1093
+ "name": "id",
1094
+ "type": "uuid",
1095
+ "primaryKey": true,
1096
+ "notNull": true,
1097
+ "default": "gen_random_uuid()"
1098
+ },
1099
+ "pr_number": {
1100
+ "name": "pr_number",
1101
+ "type": "integer",
1102
+ "primaryKey": false,
1103
+ "notNull": true
1104
+ },
1105
+ "path": {
1106
+ "name": "path",
1107
+ "type": "text",
1108
+ "primaryKey": false,
1109
+ "notNull": true
1110
+ },
1111
+ "approver_email": {
1112
+ "name": "approver_email",
1113
+ "type": "text",
1114
+ "primaryKey": false,
1115
+ "notNull": true
1116
+ },
1117
+ "approver_name": {
1118
+ "name": "approver_name",
1119
+ "type": "text",
1120
+ "primaryKey": false,
1121
+ "notNull": true
1122
+ },
1123
+ "head_sha": {
1124
+ "name": "head_sha",
1125
+ "type": "text",
1126
+ "primaryKey": false,
1127
+ "notNull": true
1128
+ },
1129
+ "approved_at": {
1130
+ "name": "approved_at",
1131
+ "type": "timestamp",
1132
+ "primaryKey": false,
1133
+ "notNull": true,
1134
+ "default": "now()"
1135
+ }
1136
+ },
1137
+ "indexes": {
1138
+ "pr_file_approvals_unq": {
1139
+ "name": "pr_file_approvals_unq",
1140
+ "columns": [
1141
+ {
1142
+ "expression": "pr_number",
1143
+ "isExpression": false,
1144
+ "asc": true,
1145
+ "nulls": "last"
1146
+ },
1147
+ {
1148
+ "expression": "path",
1149
+ "isExpression": false,
1150
+ "asc": true,
1151
+ "nulls": "last"
1152
+ },
1153
+ {
1154
+ "expression": "approver_email",
1155
+ "isExpression": false,
1156
+ "asc": true,
1157
+ "nulls": "last"
1158
+ },
1159
+ {
1160
+ "expression": "head_sha",
1161
+ "isExpression": false,
1162
+ "asc": true,
1163
+ "nulls": "last"
1164
+ }
1165
+ ],
1166
+ "isUnique": true,
1167
+ "concurrently": false,
1168
+ "method": "btree",
1169
+ "with": {}
1170
+ },
1171
+ "pr_file_approvals_by_pr": {
1172
+ "name": "pr_file_approvals_by_pr",
1173
+ "columns": [
1174
+ {
1175
+ "expression": "pr_number",
1176
+ "isExpression": false,
1177
+ "asc": true,
1178
+ "nulls": "last"
1179
+ }
1180
+ ],
1181
+ "isUnique": false,
1182
+ "concurrently": false,
1183
+ "method": "btree",
1184
+ "with": {}
1185
+ }
1186
+ },
1187
+ "foreignKeys": {},
1188
+ "compositePrimaryKeys": {},
1189
+ "uniqueConstraints": {},
1190
+ "policies": {},
1191
+ "checkConstraints": {},
1192
+ "isRLSEnabled": false
1193
+ },
1194
+ "public.pr_merge_log": {
1195
+ "name": "pr_merge_log",
1196
+ "schema": "",
1197
+ "columns": {
1198
+ "id": {
1199
+ "name": "id",
1200
+ "type": "uuid",
1201
+ "primaryKey": true,
1202
+ "notNull": true,
1203
+ "default": "gen_random_uuid()"
1204
+ },
1205
+ "pr_number": {
1206
+ "name": "pr_number",
1207
+ "type": "integer",
1208
+ "primaryKey": false,
1209
+ "notNull": true
1210
+ },
1211
+ "triggered_by_email": {
1212
+ "name": "triggered_by_email",
1213
+ "type": "text",
1214
+ "primaryKey": false,
1215
+ "notNull": true
1216
+ },
1217
+ "triggered_by_name": {
1218
+ "name": "triggered_by_name",
1219
+ "type": "text",
1220
+ "primaryKey": false,
1221
+ "notNull": true
1222
+ },
1223
+ "head_sha_at_merge": {
1224
+ "name": "head_sha_at_merge",
1225
+ "type": "text",
1226
+ "primaryKey": false,
1227
+ "notNull": true
1228
+ },
1229
+ "merge_method": {
1230
+ "name": "merge_method",
1231
+ "type": "text",
1232
+ "primaryKey": false,
1233
+ "notNull": true
1234
+ },
1235
+ "succeeded": {
1236
+ "name": "succeeded",
1237
+ "type": "boolean",
1238
+ "primaryKey": false,
1239
+ "notNull": true
1240
+ },
1241
+ "error": {
1242
+ "name": "error",
1243
+ "type": "text",
1244
+ "primaryKey": false,
1245
+ "notNull": false
1246
+ },
1247
+ "started_at": {
1248
+ "name": "started_at",
1249
+ "type": "timestamp",
1250
+ "primaryKey": false,
1251
+ "notNull": true,
1252
+ "default": "now()"
1253
+ },
1254
+ "completed_at": {
1255
+ "name": "completed_at",
1256
+ "type": "timestamp",
1257
+ "primaryKey": false,
1258
+ "notNull": false
1259
+ }
1260
+ },
1261
+ "indexes": {
1262
+ "pr_merge_log_by_pr": {
1263
+ "name": "pr_merge_log_by_pr",
1264
+ "columns": [
1265
+ {
1266
+ "expression": "pr_number",
1267
+ "isExpression": false,
1268
+ "asc": true,
1269
+ "nulls": "last"
1270
+ }
1271
+ ],
1272
+ "isUnique": false,
1273
+ "concurrently": false,
1274
+ "method": "btree",
1275
+ "with": {}
1276
+ }
1277
+ },
1278
+ "foreignKeys": {},
1279
+ "compositePrimaryKeys": {},
1280
+ "uniqueConstraints": {},
1281
+ "policies": {},
1282
+ "checkConstraints": {},
1283
+ "isRLSEnabled": false
1284
+ },
1285
+ "public.secrets": {
1286
+ "name": "secrets",
1287
+ "schema": "",
1288
+ "columns": {
1289
+ "id": {
1290
+ "name": "id",
1291
+ "type": "uuid",
1292
+ "primaryKey": true,
1293
+ "notNull": true,
1294
+ "default": "gen_random_uuid()"
1295
+ },
1296
+ "user_id": {
1297
+ "name": "user_id",
1298
+ "type": "uuid",
1299
+ "primaryKey": false,
1300
+ "notNull": false
1301
+ },
1302
+ "key": {
1303
+ "name": "key",
1304
+ "type": "text",
1305
+ "primaryKey": false,
1306
+ "notNull": true
1307
+ },
1308
+ "kind": {
1309
+ "name": "kind",
1310
+ "type": "text",
1311
+ "primaryKey": false,
1312
+ "notNull": true,
1313
+ "default": "'static'"
1314
+ },
1315
+ "label": {
1316
+ "name": "label",
1317
+ "type": "text",
1318
+ "primaryKey": false,
1319
+ "notNull": false
1320
+ },
1321
+ "value_encrypted": {
1322
+ "name": "value_encrypted",
1323
+ "type": "text",
1324
+ "primaryKey": false,
1325
+ "notNull": true
1326
+ },
1327
+ "oauth_meta": {
1328
+ "name": "oauth_meta",
1329
+ "type": "jsonb",
1330
+ "primaryKey": false,
1331
+ "notNull": false
1332
+ },
1333
+ "created_at": {
1334
+ "name": "created_at",
1335
+ "type": "timestamp",
1336
+ "primaryKey": false,
1337
+ "notNull": true,
1338
+ "default": "now()"
1339
+ },
1340
+ "updated_at": {
1341
+ "name": "updated_at",
1342
+ "type": "timestamp",
1343
+ "primaryKey": false,
1344
+ "notNull": true,
1345
+ "default": "now()"
1346
+ }
1347
+ },
1348
+ "indexes": {
1349
+ "secrets_by_user": {
1350
+ "name": "secrets_by_user",
1351
+ "columns": [
1352
+ {
1353
+ "expression": "user_id",
1354
+ "isExpression": false,
1355
+ "asc": true,
1356
+ "nulls": "last"
1357
+ }
1358
+ ],
1359
+ "isUnique": false,
1360
+ "concurrently": false,
1361
+ "method": "btree",
1362
+ "with": {}
1363
+ },
1364
+ "secrets_user_key_unq": {
1365
+ "name": "secrets_user_key_unq",
1366
+ "columns": [
1367
+ {
1368
+ "expression": "user_id",
1369
+ "isExpression": false,
1370
+ "asc": true,
1371
+ "nulls": "last"
1372
+ },
1373
+ {
1374
+ "expression": "key",
1375
+ "isExpression": false,
1376
+ "asc": true,
1377
+ "nulls": "last"
1378
+ }
1379
+ ],
1380
+ "isUnique": true,
1381
+ "concurrently": false,
1382
+ "method": "btree",
1383
+ "with": {}
1384
+ },
1385
+ "secrets_shared_key_unq": {
1386
+ "name": "secrets_shared_key_unq",
1387
+ "columns": [
1388
+ {
1389
+ "expression": "key",
1390
+ "isExpression": false,
1391
+ "asc": true,
1392
+ "nulls": "last"
1393
+ }
1394
+ ],
1395
+ "isUnique": true,
1396
+ "where": "\"secrets\".\"user_id\" is null",
1397
+ "concurrently": false,
1398
+ "method": "btree",
1399
+ "with": {}
1400
+ }
1401
+ },
1402
+ "foreignKeys": {
1403
+ "secrets_user_id_users_id_fk": {
1404
+ "name": "secrets_user_id_users_id_fk",
1405
+ "tableFrom": "secrets",
1406
+ "tableTo": "users",
1407
+ "columnsFrom": [
1408
+ "user_id"
1409
+ ],
1410
+ "columnsTo": [
1411
+ "id"
1412
+ ],
1413
+ "onDelete": "cascade",
1414
+ "onUpdate": "no action"
1415
+ }
1416
+ },
1417
+ "compositePrimaryKeys": {},
1418
+ "uniqueConstraints": {},
1419
+ "policies": {},
1420
+ "checkConstraints": {},
1421
+ "isRLSEnabled": false
1422
+ },
1423
+ "public.session_ontology_touches": {
1424
+ "name": "session_ontology_touches",
1425
+ "schema": "",
1426
+ "columns": {
1427
+ "session_id": {
1428
+ "name": "session_id",
1429
+ "type": "text",
1430
+ "primaryKey": false,
1431
+ "notNull": true
1432
+ },
1433
+ "ontology": {
1434
+ "name": "ontology",
1435
+ "type": "text",
1436
+ "primaryKey": false,
1437
+ "notNull": true
1438
+ },
1439
+ "touched_at": {
1440
+ "name": "touched_at",
1441
+ "type": "timestamp",
1442
+ "primaryKey": false,
1443
+ "notNull": true,
1444
+ "default": "now()"
1445
+ }
1446
+ },
1447
+ "indexes": {
1448
+ "session_ontology_touches_by_touched_at": {
1449
+ "name": "session_ontology_touches_by_touched_at",
1450
+ "columns": [
1451
+ {
1452
+ "expression": "touched_at",
1453
+ "isExpression": false,
1454
+ "asc": true,
1455
+ "nulls": "last"
1456
+ }
1457
+ ],
1458
+ "isUnique": false,
1459
+ "concurrently": false,
1460
+ "method": "btree",
1461
+ "with": {}
1462
+ }
1463
+ },
1464
+ "foreignKeys": {},
1465
+ "compositePrimaryKeys": {
1466
+ "session_ontology_touches_session_id_ontology_pk": {
1467
+ "name": "session_ontology_touches_session_id_ontology_pk",
1468
+ "columns": [
1469
+ "session_id",
1470
+ "ontology"
1471
+ ]
1472
+ }
1473
+ },
1474
+ "uniqueConstraints": {},
1475
+ "policies": {},
1476
+ "checkConstraints": {},
1477
+ "isRLSEnabled": false
1478
+ },
1479
+ "public.users": {
1480
+ "name": "users",
1481
+ "schema": "",
1482
+ "columns": {
1483
+ "id": {
1484
+ "name": "id",
1485
+ "type": "uuid",
1486
+ "primaryKey": true,
1487
+ "notNull": true,
1488
+ "default": "gen_random_uuid()"
1489
+ },
1490
+ "email": {
1491
+ "name": "email",
1492
+ "type": "text",
1493
+ "primaryKey": false,
1494
+ "notNull": true
1495
+ },
1496
+ "name": {
1497
+ "name": "name",
1498
+ "type": "text",
1499
+ "primaryKey": false,
1500
+ "notNull": true
1501
+ },
1502
+ "avatar_url": {
1503
+ "name": "avatar_url",
1504
+ "type": "text",
1505
+ "primaryKey": false,
1506
+ "notNull": false
1507
+ },
1508
+ "password_hash": {
1509
+ "name": "password_hash",
1510
+ "type": "text",
1511
+ "primaryKey": false,
1512
+ "notNull": false
1513
+ },
1514
+ "onboarding_done": {
1515
+ "name": "onboarding_done",
1516
+ "type": "boolean",
1517
+ "primaryKey": false,
1518
+ "notNull": true,
1519
+ "default": false
1520
+ },
1521
+ "created_at": {
1522
+ "name": "created_at",
1523
+ "type": "timestamp",
1524
+ "primaryKey": false,
1525
+ "notNull": true,
1526
+ "default": "now()"
1527
+ },
1528
+ "updated_at": {
1529
+ "name": "updated_at",
1530
+ "type": "timestamp",
1531
+ "primaryKey": false,
1532
+ "notNull": true,
1533
+ "default": "now()"
1534
+ }
1535
+ },
1536
+ "indexes": {},
1537
+ "foreignKeys": {},
1538
+ "compositePrimaryKeys": {},
1539
+ "uniqueConstraints": {
1540
+ "users_email_unique": {
1541
+ "name": "users_email_unique",
1542
+ "nullsNotDistinct": false,
1543
+ "columns": [
1544
+ "email"
1545
+ ]
1546
+ }
1547
+ },
1548
+ "policies": {},
1549
+ "checkConstraints": {},
1550
+ "isRLSEnabled": false
1551
+ }
1552
+ },
1553
+ "enums": {},
1554
+ "schemas": {},
1555
+ "sequences": {},
1556
+ "roles": {},
1557
+ "policies": {},
1558
+ "views": {},
1559
+ "_meta": {
1560
+ "columns": {},
1561
+ "schemas": {},
1562
+ "tables": {}
1563
+ }
1564
+ }