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