@taico/taico 0.3.4 → 0.4.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 (200) hide show
  1. package/README.md +2 -0
  2. package/dist/agent-runs/agent-run.entity.js +4 -4
  3. package/dist/agent-runs/agent-run.entity.js.map +1 -1
  4. package/dist/agents/agent-tool-permission-scope.entity.js +2 -2
  5. package/dist/agents/agent-tool-permission-scope.entity.js.map +1 -1
  6. package/dist/agents/agent-tool-permission.entity.js +2 -2
  7. package/dist/agents/agent-tool-permission.entity.js.map +1 -1
  8. package/dist/agents/agent.entity.js +3 -3
  9. package/dist/agents/agent.entity.js.map +1 -1
  10. package/dist/agents/agents.service.js +6 -4
  11. package/dist/agents/agents.service.js.map +1 -1
  12. package/dist/app-init/app-init.runner.js +11 -5
  13. package/dist/app-init/app-init.runner.js.map +1 -1
  14. package/dist/app.module.js +6 -60
  15. package/dist/app.module.js.map +1 -1
  16. package/dist/auth/crypto/jwks-key.entity.js +4 -4
  17. package/dist/auth/crypto/jwks-key.entity.js.map +1 -1
  18. package/dist/auth-journeys/entities/auth-journey.entity.js +3 -3
  19. package/dist/auth-journeys/entities/auth-journey.entity.js.map +1 -1
  20. package/dist/auth-journeys/entities/connection-authorization-flow.entity.js +3 -3
  21. package/dist/auth-journeys/entities/connection-authorization-flow.entity.js.map +1 -1
  22. package/dist/auth-journeys/entities/mcp-authorization-flow.entity.js +3 -3
  23. package/dist/auth-journeys/entities/mcp-authorization-flow.entity.js.map +1 -1
  24. package/dist/authorization-server/entities/issued-access-token.entity.js +4 -4
  25. package/dist/authorization-server/entities/issued-access-token.entity.js.map +1 -1
  26. package/dist/authorization-server/entities/mcp-refresh-token.entity.js +3 -3
  27. package/dist/authorization-server/entities/mcp-refresh-token.entity.js.map +1 -1
  28. package/dist/authorization-server/entities/refresh-token.entity.js +3 -3
  29. package/dist/authorization-server/entities/refresh-token.entity.js.map +1 -1
  30. package/dist/authorization-server/entities/registered-client.entity.js +3 -3
  31. package/dist/authorization-server/entities/registered-client.entity.js.map +1 -1
  32. package/dist/chat-providers/chat-provider.entity.js +3 -3
  33. package/dist/chat-providers/chat-provider.entity.js.map +1 -1
  34. package/dist/config/env.config.d.ts +2 -1
  35. package/dist/config/env.config.js +24 -2
  36. package/dist/config/env.config.js.map +1 -1
  37. package/dist/context/block.entity.js +3 -3
  38. package/dist/context/block.entity.js.map +1 -1
  39. package/dist/database/data-source.d.ts +4 -0
  40. package/dist/database/data-source.js +18 -0
  41. package/dist/database/data-source.js.map +1 -0
  42. package/dist/executions/active/active-task-execution.entity.js +5 -5
  43. package/dist/executions/active/active-task-execution.entity.js.map +1 -1
  44. package/dist/executions/history/task-execution-history.entity.js +5 -5
  45. package/dist/executions/history/task-execution-history.entity.js.map +1 -1
  46. package/dist/executions/queue/task-execution-queue.entity.js +3 -3
  47. package/dist/executions/queue/task-execution-queue.entity.js.map +1 -1
  48. package/dist/executions/staleness/stale-active-task-execution-pruner.service.js +5 -1
  49. package/dist/executions/staleness/stale-active-task-execution-pruner.service.js.map +1 -1
  50. package/dist/executions/stats/execution-stats.entity.js +2 -2
  51. package/dist/executions/stats/execution-stats.entity.js.map +1 -1
  52. package/dist/http/problem-details.filter.js +1 -0
  53. package/dist/http/problem-details.filter.js.map +1 -1
  54. package/dist/identity-provider/actor.entity.js +2 -2
  55. package/dist/identity-provider/actor.entity.js.map +1 -1
  56. package/dist/identity-provider/actor.service.js +6 -3
  57. package/dist/identity-provider/actor.service.js.map +1 -1
  58. package/dist/identity-provider/identity-provider.service.js +3 -4
  59. package/dist/identity-provider/identity-provider.service.js.map +1 -1
  60. package/dist/identity-provider/user.entity.js +3 -3
  61. package/dist/identity-provider/user.entity.js.map +1 -1
  62. package/dist/main.js +9 -5
  63. package/dist/main.js.map +1 -1
  64. package/dist/mcp-registry/entities/mcp-connection.entity.js +3 -3
  65. package/dist/mcp-registry/entities/mcp-connection.entity.js.map +1 -1
  66. package/dist/mcp-registry/entities/mcp-scope-mapping.entity.js +3 -3
  67. package/dist/mcp-registry/entities/mcp-scope-mapping.entity.js.map +1 -1
  68. package/dist/mcp-registry/entities/mcp-scope.entity.js +3 -3
  69. package/dist/mcp-registry/entities/mcp-scope.entity.js.map +1 -1
  70. package/dist/mcp-registry/entities/mcp-server.entity.js +3 -3
  71. package/dist/mcp-registry/entities/mcp-server.entity.js.map +1 -1
  72. package/dist/mcp-registry/mcp-registry.service.js +2 -2
  73. package/dist/mcp-registry/mcp-registry.service.js.map +1 -1
  74. package/dist/meta/meta.service.js +27 -7
  75. package/dist/meta/meta.service.js.map +1 -1
  76. package/dist/meta/project.entity.js +3 -3
  77. package/dist/meta/project.entity.js.map +1 -1
  78. package/dist/meta/tag-usage.entity.js +3 -3
  79. package/dist/meta/tag-usage.entity.js.map +1 -1
  80. package/dist/meta/tag.entity.js +4 -4
  81. package/dist/meta/tag.entity.js.map +1 -1
  82. package/dist/migrations/{1741100000000-AddTagUsageTable.d.ts → 1750000000000-PostgresBaseline.d.ts} +1 -1
  83. package/dist/migrations/1750000000000-PostgresBaseline.js +361 -0
  84. package/dist/migrations/1750000000000-PostgresBaseline.js.map +1 -0
  85. package/dist/public/assets/index-CPjOd3Sq.css +1 -0
  86. package/dist/public/assets/{index-DgWElsvp.js → index-DVNE_5Yh.js} +21 -21
  87. package/dist/public/index.html +2 -2
  88. package/dist/public/package.json +4 -4
  89. package/dist/scripts/migrate-sqlite-to-postgres.d.ts +1 -0
  90. package/dist/scripts/migrate-sqlite-to-postgres.js +376 -0
  91. package/dist/scripts/migrate-sqlite-to-postgres.js.map +1 -0
  92. package/dist/secrets/secret.entity.js +3 -3
  93. package/dist/secrets/secret.entity.js.map +1 -1
  94. package/dist/task-blueprints/scheduled-task.entity.js +5 -5
  95. package/dist/task-blueprints/scheduled-task.entity.js.map +1 -1
  96. package/dist/task-blueprints/task-blueprint.entity.js +3 -3
  97. package/dist/task-blueprints/task-blueprint.entity.js.map +1 -1
  98. package/dist/tasks/artefact.entity.js +3 -3
  99. package/dist/tasks/artefact.entity.js.map +1 -1
  100. package/dist/tasks/comment.entity.js +3 -3
  101. package/dist/tasks/comment.entity.js.map +1 -1
  102. package/dist/tasks/input-request.entity.js +3 -3
  103. package/dist/tasks/input-request.entity.js.map +1 -1
  104. package/dist/tasks/task.entity.js +3 -3
  105. package/dist/tasks/task.entity.js.map +1 -1
  106. package/dist/threads/backends/adk.backend.d.ts +0 -1
  107. package/dist/threads/backends/adk.backend.js +3 -14
  108. package/dist/threads/backends/adk.backend.js.map +1 -1
  109. package/dist/threads/thread-message.entity.js +1 -1
  110. package/dist/threads/thread-message.entity.js.map +1 -1
  111. package/dist/threads/thread.entity.js +3 -3
  112. package/dist/threads/thread.entity.js.map +1 -1
  113. package/dist/tsconfig.tsbuildinfo +1 -1
  114. package/dist/workers/worker.entity.js +3 -3
  115. package/dist/workers/worker.entity.js.map +1 -1
  116. package/package.json +13 -10
  117. package/dist/migrations/1700000000000-BaselineSchema.d.ts +0 -5
  118. package/dist/migrations/1700000000000-BaselineSchema.js +0 -480
  119. package/dist/migrations/1700000000000-BaselineSchema.js.map +0 -1
  120. package/dist/migrations/1700000000001-AlignConnectionAuthFlowColumns.d.ts +0 -6
  121. package/dist/migrations/1700000000001-AlignConnectionAuthFlowColumns.js +0 -46
  122. package/dist/migrations/1700000000001-AlignConnectionAuthFlowColumns.js.map +0 -1
  123. package/dist/migrations/1700000000002-UpdateAgentTypeConstraint.d.ts +0 -6
  124. package/dist/migrations/1700000000002-UpdateAgentTypeConstraint.js +0 -142
  125. package/dist/migrations/1700000000002-UpdateAgentTypeConstraint.js.map +0 -1
  126. package/dist/migrations/1739500000000-AddTaskBlueprintsAndScheduledTasks.d.ts +0 -5
  127. package/dist/migrations/1739500000000-AddTaskBlueprintsAndScheduledTasks.js +0 -60
  128. package/dist/migrations/1739500000000-AddTaskBlueprintsAndScheduledTasks.js.map +0 -1
  129. package/dist/migrations/1739750000000-RefactorThreadsForHeadlessConversations.d.ts +0 -6
  130. package/dist/migrations/1739750000000-RefactorThreadsForHeadlessConversations.js +0 -109
  131. package/dist/migrations/1739750000000-RefactorThreadsForHeadlessConversations.js.map +0 -1
  132. package/dist/migrations/1739844333000-RemoveRoleFromThreadMessage.d.ts +0 -6
  133. package/dist/migrations/1739844333000-RemoveRoleFromThreadMessage.js +0 -61
  134. package/dist/migrations/1739844333000-RemoveRoleFromThreadMessage.js.map +0 -1
  135. package/dist/migrations/1740000000000-AddSecretsTable.d.ts +0 -5
  136. package/dist/migrations/1740000000000-AddSecretsTable.js +0 -32
  137. package/dist/migrations/1740000000000-AddSecretsTable.js.map +0 -1
  138. package/dist/migrations/1740100000000-AddChatProvidersTable.d.ts +0 -5
  139. package/dist/migrations/1740100000000-AddChatProvidersTable.js +0 -32
  140. package/dist/migrations/1740100000000-AddChatProvidersTable.js.map +0 -1
  141. package/dist/migrations/1740500000000-AddMcpServerTransportConfig.d.ts +0 -5
  142. package/dist/migrations/1740500000000-AddMcpServerTransportConfig.js +0 -52
  143. package/dist/migrations/1740500000000-AddMcpServerTransportConfig.js.map +0 -1
  144. package/dist/migrations/1741000000000-AddChatSessionIdToThreads.d.ts +0 -6
  145. package/dist/migrations/1741000000000-AddChatSessionIdToThreads.js +0 -52
  146. package/dist/migrations/1741000000000-AddChatSessionIdToThreads.js.map +0 -1
  147. package/dist/migrations/1741100000000-AddTagUsageTable.js +0 -67
  148. package/dist/migrations/1741100000000-AddTagUsageTable.js.map +0 -1
  149. package/dist/migrations/1741200000000-McpServerProvidedIdPartialUniqueIndex.d.ts +0 -5
  150. package/dist/migrations/1741200000000-McpServerProvidedIdPartialUniqueIndex.js +0 -69
  151. package/dist/migrations/1741200000000-McpServerProvidedIdPartialUniqueIndex.js.map +0 -1
  152. package/dist/migrations/1741300000000-AddHasSeenWalkthroughToUsers.d.ts +0 -6
  153. package/dist/migrations/1741300000000-AddHasSeenWalkthroughToUsers.js +0 -43
  154. package/dist/migrations/1741300000000-AddHasSeenWalkthroughToUsers.js.map +0 -1
  155. package/dist/migrations/1741400000000-EnforceSingleThreadPerParentTask.d.ts +0 -5
  156. package/dist/migrations/1741400000000-EnforceSingleThreadPerParentTask.js +0 -76
  157. package/dist/migrations/1741400000000-EnforceSingleThreadPerParentTask.js.map +0 -1
  158. package/dist/migrations/1741500000000-AddExecutionPersistenceTables.d.ts +0 -5
  159. package/dist/migrations/1741500000000-AddExecutionPersistenceTables.js +0 -84
  160. package/dist/migrations/1741500000000-AddExecutionPersistenceTables.js.map +0 -1
  161. package/dist/migrations/1741600000000-AddTaskExecutionIdToAgentRuns.d.ts +0 -5
  162. package/dist/migrations/1741600000000-AddTaskExecutionIdToAgentRuns.js +0 -66
  163. package/dist/migrations/1741600000000-AddTaskExecutionIdToAgentRuns.js.map +0 -1
  164. package/dist/migrations/1741700000000-AddExecutionsV2Tables.d.ts +0 -5
  165. package/dist/migrations/1741700000000-AddExecutionsV2Tables.js +0 -103
  166. package/dist/migrations/1741700000000-AddExecutionsV2Tables.js.map +0 -1
  167. package/dist/migrations/1741800000000-AddLastHeartbeatAtToActiveExecutionsV2.d.ts +0 -5
  168. package/dist/migrations/1741800000000-AddLastHeartbeatAtToActiveExecutionsV2.js +0 -19
  169. package/dist/migrations/1741800000000-AddLastHeartbeatAtToActiveExecutionsV2.js.map +0 -1
  170. package/dist/migrations/1741900000000-AddErrorMessageToTaskExecutionHistoryV2.d.ts +0 -6
  171. package/dist/migrations/1741900000000-AddErrorMessageToTaskExecutionHistoryV2.js +0 -20
  172. package/dist/migrations/1741900000000-AddErrorMessageToTaskExecutionHistoryV2.js.map +0 -1
  173. package/dist/migrations/1742000000000-AddAgentToolPermissions.d.ts +0 -5
  174. package/dist/migrations/1742000000000-AddAgentToolPermissions.js +0 -44
  175. package/dist/migrations/1742000000000-AddAgentToolPermissions.js.map +0 -1
  176. package/dist/migrations/1742100000000-AddExecutionEnrichmentFieldsV2.d.ts +0 -6
  177. package/dist/migrations/1742100000000-AddExecutionEnrichmentFieldsV2.js +0 -44
  178. package/dist/migrations/1742100000000-AddExecutionEnrichmentFieldsV2.js.map +0 -1
  179. package/dist/migrations/1742200000000-RenameExecutionTables.d.ts +0 -5
  180. package/dist/migrations/1742200000000-RenameExecutionTables.js +0 -27
  181. package/dist/migrations/1742200000000-RenameExecutionTables.js.map +0 -1
  182. package/dist/migrations/1742300000000-AddWorkersTable.d.ts +0 -5
  183. package/dist/migrations/1742300000000-AddWorkersTable.js +0 -34
  184. package/dist/migrations/1742300000000-AddWorkersTable.js.map +0 -1
  185. package/dist/migrations/1742400000000-RenameHasSeenWalkthroughToOnboardingDisplayMode.d.ts +0 -6
  186. package/dist/migrations/1742400000000-RenameHasSeenWalkthroughToOnboardingDisplayMode.js +0 -78
  187. package/dist/migrations/1742400000000-RenameHasSeenWalkthroughToOnboardingDisplayMode.js.map +0 -1
  188. package/dist/migrations/1742500000000-AllowInterruptedExecutionErrorCode.d.ts +0 -7
  189. package/dist/migrations/1742500000000-AllowInterruptedExecutionErrorCode.js +0 -116
  190. package/dist/migrations/1742500000000-AllowInterruptedExecutionErrorCode.js.map +0 -1
  191. package/dist/migrations/1742600000000-AddExecutionStatsTable.d.ts +0 -5
  192. package/dist/migrations/1742600000000-AddExecutionStatsTable.js +0 -36
  193. package/dist/migrations/1742600000000-AddExecutionStatsTable.js.map +0 -1
  194. package/dist/migrations/1742700000000-AddWorkerVersionFields.d.ts +0 -5
  195. package/dist/migrations/1742700000000-AddWorkerVersionFields.js +0 -27
  196. package/dist/migrations/1742700000000-AddWorkerVersionFields.js.map +0 -1
  197. package/dist/migrations/1742800000000-RemovePlannerPlanTagTrigger.d.ts +0 -5
  198. package/dist/migrations/1742800000000-RemovePlannerPlanTagTrigger.js +0 -27
  199. package/dist/migrations/1742800000000-RemovePlannerPlanTagTrigger.js.map +0 -1
  200. package/dist/public/assets/index-BB0owFtW.css +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tag-usage.entity.js","sourceRoot":"","sources":["../../src/meta/tag-usage.entity.ts"],"names":[],"mapp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C7B,IAAA,eAAK,EAAC,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACtB,cAAc,CAsB1B"}
@@ -32,7 +32,7 @@ __decorate([
32
32
  __metadata("design:type", String)
33
33
  ], TagEntity.prototype, "id", void 0);
34
34
  __decorate([
35
- (0, typeorm_1.Column)({ type: 'text', unique: true, collation: 'NOCASE' }),
35
+ (0, typeorm_1.Column)({ type: 'text' }),
36
36
  __metadata("design:type", String)
37
37
  ], TagEntity.prototype, "name", void 0);
38
38
  __decorate([
@@ -60,15 +60,15 @@ __decorate([
60
60
  __metadata("design:type", Number)
61
61
  ], TagEntity.prototype, "rowVersion", void 0);
62
62
  __decorate([
63
- (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at' }),
63
+ (0, typeorm_1.CreateDateColumn)({ type: 'timestamptz', name: 'created_at' }),
64
64
  __metadata("design:type", Date)
65
65
  ], TagEntity.prototype, "createdAt", void 0);
66
66
  __decorate([
67
- (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at' }),
67
+ (0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz', name: 'updated_at' }),
68
68
  __metadata("design:type", Date)
69
69
  ], TagEntity.prototype, "updatedAt", void 0);
70
70
  __decorate([
71
- (0, typeorm_1.DeleteDateColumn)({ type: 'datetime', name: 'deleted_at', nullable: true }),
71
+ (0, typeorm_1.DeleteDateColumn)({ type: 'timestamptz', name: 'deleted_at', nullable: true }),
72
72
  __metadata("design:type", Object)
73
73
  ], TagEntity.prototype, "deletedAt", void 0);
74
74
  exports.TagEntity = TagEntity = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"tag.entity.js","sourceRoot":"","sources":["../../src/meta/tag.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCASiB;AACjB,sDAAkD;AAClD,0DAA8D;AAC9D,4DAAwD;AAGjD,IAAM,SAAS,GAAf,MAAM,SAAS;IAEpB,EAAE,CAAU;IA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B;AAK9B;IAHC,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,4BAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE;QACvD,QAAQ,EAAE,SAAS;KACpB,CAAC;;0CACuB;AAGzB;IADC,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;6CACnB;AAGpB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAClD,IAAI;4CAAC;AAGjB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAClD,IAAI;4CAAC;AAGjB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACtD;oBAjCb,SAAS;IADrB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;GACZ,SAAS,CAkCrB"}
@@ -1,5 +1,5 @@
1
1
  import { MigrationInterface, QueryRunner } from 'typeorm';
2
- export declare class AddTagUsageTable1741100000000 implements MigrationInterface {
2
+ export declare class PostgresBaseline1750000000000 implements MigrationInterface {
3
3
  name: string;
4
4
  up(queryRunner: QueryRunner): Promise<void>;
5
5
  down(queryRunner: QueryRunner): Promise<void>;
@@ -0,0 +1,361 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostgresBaseline1750000000000 = void 0;
4
+ class PostgresBaseline1750000000000 {
5
+ name = 'PostgresBaseline1750000000000';
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`CREATE EXTENSION IF NOT EXISTS "pgcrypto"`);
8
+ await queryRunner.query(`CREATE TABLE "registered_clients" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "client_id" text NOT NULL, "client_secret" text, "client_name" text NOT NULL, "redirect_uris" text NOT NULL, "grant_types" text NOT NULL, "token_endpoint_auth_method" text NOT NULL, "scopes" text, "contacts" text, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "UQ_0ef710851de2056ed5b213a7cc9" UNIQUE ("client_id"), CONSTRAINT "PK_e628d45dc972e2be3bdf54fbc68" PRIMARY KEY ("id"))`);
9
+ await queryRunner.query(`CREATE TABLE "workers" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "oauth_client_id" text NOT NULL, "last_seen_at" TIMESTAMP WITH TIME ZONE NOT NULL, "worker_version" text, "harnesses" text NOT NULL DEFAULT '[]', "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "UQ_504178c0ec7be818c522c0f01af" UNIQUE ("oauth_client_id"), CONSTRAINT "PK_e950c9aba3bd84a4f193058d838" PRIMARY KEY ("id"))`);
10
+ await queryRunner.query(`CREATE TABLE "users" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "email" character varying NOT NULL, "passwordHash" character varying NOT NULL, "actor_id" uuid NOT NULL, "isActive" boolean NOT NULL DEFAULT true, "role" character varying NOT NULL DEFAULT 'standard', "onboarding_display_mode" character varying NOT NULL DEFAULT 'FULL_PAGE', "rowVersion" integer NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, CONSTRAINT "UQ_97672ac88f789774dd47f7c8be3" UNIQUE ("email"), CONSTRAINT "UQ_0c17e643b069470055be07d69ed" UNIQUE ("actor_id"), CONSTRAINT "REL_0c17e643b069470055be07d69e" UNIQUE ("actor_id"), CONSTRAINT "PK_a3ffb1c0c8416b9fc6f907b7433" PRIMARY KEY ("id"))`);
11
+ await queryRunner.query(`CREATE TABLE "mcp_connections" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "serverId" uuid NOT NULL, "friendlyName" character varying(255) NOT NULL, "providedId" character varying(255), "clientId" character varying(500) NOT NULL, "clientSecret" text NOT NULL, "authorizeUrl" text NOT NULL, "tokenUrl" text NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, CONSTRAINT "UQ_da19f3d0d9d03f4918f7960b77a" UNIQUE ("providedId"), CONSTRAINT "PK_23993c4be057f50544ba18f0ff0" PRIMARY KEY ("id"))`);
12
+ await queryRunner.query(`CREATE TABLE "mcp_scope_mappings" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "scopeId" character varying(255) NOT NULL, "serverId" uuid NOT NULL, "connectionId" uuid NOT NULL, "downstreamScope" character varying(255) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, CONSTRAINT "uq_mcp_scope_mapping" UNIQUE ("scopeId", "serverId", "connectionId", "downstreamScope"), CONSTRAINT "PK_746ddbb6fc7524f4fa8048d908a" PRIMARY KEY ("id"))`);
13
+ await queryRunner.query(`CREATE TABLE "agent_tool_permission_scopes" ("agent_actor_id" uuid NOT NULL, "server_id" uuid NOT NULL, "scope_id" character varying(255) NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "PK_3b97ecdf578e899e593c8e07be2" PRIMARY KEY ("agent_actor_id", "server_id", "scope_id"))`);
14
+ await queryRunner.query(`CREATE TABLE "mcp_scopes" ("id" character varying(255) NOT NULL, "serverId" uuid NOT NULL, "description" text NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_acc013288973247a1f42288667a" PRIMARY KEY ("id", "serverId"))`);
15
+ await queryRunner.query(`CREATE TABLE "mcp_servers" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "providedId" character varying(255) NOT NULL, "name" character varying(255) NOT NULL, "description" text NOT NULL, "type" text NOT NULL DEFAULT 'http', "url" character varying(2048), "cmd" character varying(1024), "args" text, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_c781b3dc7cb2a5d19460b71914d" PRIMARY KEY ("id"))`);
16
+ await queryRunner.query(`CREATE TABLE "agent_tool_permissions" ("agent_actor_id" uuid NOT NULL, "server_id" uuid NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "PK_c00e63fb1c0daa87887f3b74ca6" PRIMARY KEY ("agent_actor_id", "server_id"))`);
17
+ await queryRunner.query(`CREATE TABLE "agents" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "actor_id" uuid NOT NULL, "type" text NOT NULL DEFAULT 'claude', "description" text, "system_prompt" text NOT NULL, "provider_id" text, "model_id" text, "status_triggers" text NOT NULL DEFAULT '', "tag_triggers" text NOT NULL DEFAULT '', "allowed_tools" text NOT NULL, "is_active" boolean NOT NULL DEFAULT true, "concurrency_limit" integer, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "UQ_2c4c2595e6f8699f2b26b5e7589" UNIQUE ("actor_id"), CONSTRAINT "REL_2c4c2595e6f8699f2b26b5e758" UNIQUE ("actor_id"), CONSTRAINT "PK_9c653f28ae19c5884d5baf6a1d9" PRIMARY KEY ("id"))`);
18
+ await queryRunner.query(`CREATE TABLE "actors" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "type" text NOT NULL, "slug" text NOT NULL, "display_name" text NOT NULL, "avatar_url" text, "introduction" text, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "UQ_d728e8d8a38480121d06532aabf" UNIQUE ("slug"), CONSTRAINT "PK_d8608598c2c4f907a78de2ae461" PRIMARY KEY ("id"))`);
19
+ await queryRunner.query(`CREATE TABLE "comments" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "commenter_actor_id" uuid, "content" text NOT NULL, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, "task_id" uuid, CONSTRAINT "PK_8bf68bc960f2b69e818bdb90dcb" PRIMARY KEY ("id"))`);
20
+ await queryRunner.query(`CREATE TABLE "artefacts" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "name" character varying NOT NULL, "link" text NOT NULL, "task_id" uuid NOT NULL, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_8cdd23eb9884b8122591613ca3e" PRIMARY KEY ("id"))`);
21
+ await queryRunner.query(`CREATE TABLE "task_input_requests" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "task_id" uuid NOT NULL, "asked_by_actor_id" uuid NOT NULL, "assigned_to_actor_id" uuid NOT NULL, "question" text NOT NULL, "answer" text, "resolved_at" TIMESTAMP WITH TIME ZONE, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "PK_a742e2160ec8f3f79f19c85caec" PRIMARY KEY ("id"))`);
22
+ await queryRunner.query(`CREATE TABLE "context_blocks" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "title" text NOT NULL, "content" text NOT NULL, "parent_id" uuid, "order" integer NOT NULL DEFAULT '0', "created_by_actor_id" uuid NOT NULL, "assignee_actor_id" uuid, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_5072b3dfa3d6102fb779b6c8175" PRIMARY KEY ("id"))`);
23
+ await queryRunner.query(`CREATE INDEX "IDX_a9ba3074228102f4d699f5364f" ON "context_blocks" ("parent_id", "order") `);
24
+ await queryRunner.query(`CREATE TABLE "tags" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "name" text NOT NULL, "color" text, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_e7dc17249a1148a1970748eda99" PRIMARY KEY ("id"))`);
25
+ await queryRunner.query(`CREATE TABLE "tasks" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "name" character varying NOT NULL, "description" text NOT NULL, "status" text NOT NULL DEFAULT 'NOT_STARTED', "assignee_actor_id" uuid, "session_id" text, "created_by_actor_id" uuid NOT NULL, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_8d12ff38fcc62aaba2cab748772" PRIMARY KEY ("id"))`);
26
+ await queryRunner.query(`CREATE TABLE "thread_messages" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "thread_id" uuid NOT NULL, "content" text NOT NULL, "created_by_actor_id" uuid NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "PK_362f852009f5fceefddab0fbe81" PRIMARY KEY ("id"))`);
27
+ await queryRunner.query(`CREATE TABLE "threads" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "title" text NOT NULL, "chat_session_id" text, "created_by_actor_id" uuid NOT NULL, "parent_task_id" uuid, "state_context_block_id" uuid NOT NULL, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_d8a74804c34fc3900502cd27275" PRIMARY KEY ("id"))`);
28
+ await queryRunner.query(`CREATE TABLE "task_blueprints" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "name" character varying NOT NULL, "description" text NOT NULL, "assignee_actor_id" uuid, "created_by_actor_id" uuid NOT NULL, "depends_on_ids" text, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_826f673c651065c6226821f549a" PRIMARY KEY ("id"))`);
29
+ await queryRunner.query(`CREATE TABLE "scheduled_tasks" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "task_blueprint_id" uuid NOT NULL, "cron_expression" text NOT NULL, "enabled" boolean NOT NULL DEFAULT true, "last_run_at" TIMESTAMP WITH TIME ZONE, "next_run_at" TIMESTAMP WITH TIME ZONE NOT NULL, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_abc9348e8ae95b59b11a982ea87" PRIMARY KEY ("id"))`);
30
+ await queryRunner.query(`CREATE INDEX "idx_scheduled_tasks_task_blueprint_id" ON "scheduled_tasks" ("task_blueprint_id") `);
31
+ await queryRunner.query(`CREATE INDEX "idx_scheduled_tasks_enabled_next_run_at" ON "scheduled_tasks" ("enabled", "next_run_at") `);
32
+ await queryRunner.query(`CREATE TABLE "secrets" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "name" text NOT NULL, "description" text, "encrypted_value" text NOT NULL, "created_by_actor_id" uuid NOT NULL, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_d4ff48ddba1883d4dc142b9c697" PRIMARY KEY ("id"))`);
33
+ await queryRunner.query(`CREATE TABLE "tag_usage" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "tag_id" uuid NOT NULL, "usage_count" integer NOT NULL DEFAULT '0', "last_used_at" TIMESTAMP WITH TIME ZONE, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "PK_d76511ebb1fe17ed68b75e7cc56" PRIMARY KEY ("id"))`);
34
+ await queryRunner.query(`CREATE UNIQUE INDEX "IDX_fc603902944def35770f762c0e" ON "tag_usage" ("tag_id") `);
35
+ await queryRunner.query(`CREATE TABLE "projects" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "tagId" uuid NOT NULL, "slug" text NOT NULL, "description" text, "repoUrl" text, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "UQ_30fa6513ff893536087fece24e4" UNIQUE ("tagId"), CONSTRAINT "UQ_96e045ab8b0271e5f5a91eae1ee" UNIQUE ("slug"), CONSTRAINT "REL_30fa6513ff893536087fece24e" UNIQUE ("tagId"), CONSTRAINT "PK_6271df0a7aed1d6c0691ce6ac50" PRIMARY KEY ("id"))`);
36
+ await queryRunner.query(`CREATE TABLE "chat_providers" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "name" text NOT NULL, "type" text NOT NULL, "secret_id" uuid, "is_active" boolean NOT NULL DEFAULT false, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_f48a8be4aa21d7499c54c5623a7" PRIMARY KEY ("id"))`);
37
+ await queryRunner.query(`CREATE TABLE "agent_runs" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "actor_id" uuid NOT NULL, "parent_task_id" uuid NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "started_at" TIMESTAMP WITH TIME ZONE, "ended_at" TIMESTAMP WITH TIME ZONE, "last_ping" TIMESTAMP WITH TIME ZONE, "task_execution_id" uuid, CONSTRAINT "PK_442f7e0ec4ae860cf17edc57825" PRIMARY KEY ("id"))`);
38
+ await queryRunner.query(`CREATE INDEX "idx_agent_runs_task_execution_id" ON "agent_runs" ("task_execution_id") `);
39
+ await queryRunner.query(`CREATE TABLE "execution_stats" ("execution_id" uuid NOT NULL, "harness" text, "provider_id" text, "model_id" text, "worker_version" text, "input_tokens" integer, "output_tokens" integer, "total_tokens" integer, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "PK_3d4279451cf767ec4ef4a7e4282" PRIMARY KEY ("execution_id"))`);
40
+ await queryRunner.query(`CREATE TABLE "task_execution_queue" ("task_id" uuid NOT NULL, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_e6293cc4ad257649be5e6f58598" PRIMARY KEY ("task_id"))`);
41
+ await queryRunner.query(`CREATE TABLE "task_execution_history" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "task_id" uuid NOT NULL, "claimed_at" TIMESTAMP WITH TIME ZONE NOT NULL, "transitioned_at" TIMESTAMP WITH TIME ZONE NOT NULL, "agent_actor_id" uuid NOT NULL, "worker_client_id" text NOT NULL, "runner_session_id" text, "tool_call_count" integer NOT NULL DEFAULT '0', "status" text NOT NULL, "error_code" text, "error_message" text, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_2504983ce9b30639fd85ae36623" PRIMARY KEY ("id"))`);
42
+ await queryRunner.query(`CREATE TABLE "active_task_executions" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "task_id" uuid NOT NULL, "claimed_at" TIMESTAMP WITH TIME ZONE NOT NULL, "task_status_before_claim" text NOT NULL, "task_tags_before_claim" text NOT NULL, "task_assignee_actor_id_before_claim" uuid, "agent_actor_id" uuid NOT NULL, "worker_client_id" text NOT NULL, "last_heartbeat_at" TIMESTAMP WITH TIME ZONE, "runner_session_id" text, "tool_call_count" integer NOT NULL DEFAULT '0', "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "UQ_ff4cf561fb305efc1fe12c52d7d" UNIQUE ("task_id"), CONSTRAINT "PK_6549be8f109c79998e5f0183d09" PRIMARY KEY ("id"))`);
43
+ await queryRunner.query(`CREATE TABLE "refresh_tokens" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "user_id" uuid NOT NULL, "token_hash" text NOT NULL, "expires_at" TIMESTAMP WITH TIME ZONE NOT NULL, "revoked_at" TIMESTAMP WITH TIME ZONE, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "PK_7d8bee0204106019488c4c50ffa" PRIMARY KEY ("id"))`);
44
+ await queryRunner.query(`CREATE TABLE "connection_authorization_flows" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "authorization_journey_id" uuid NOT NULL, "mcp_connection_id" uuid NOT NULL, "state" character varying(255), "authorization_code" character varying(500), "access_token" text, "refresh_token" text, "token_expires_at" TIMESTAMP WITH TIME ZONE, "status" character varying(50) NOT NULL DEFAULT 'pending', "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "PK_92f8522b1967d77a4363c3b946f" PRIMARY KEY ("id"))`);
45
+ await queryRunner.query(`CREATE TABLE "authorization_journeys" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "status" text NOT NULL DEFAULT 'not_started', "actor_id" uuid, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_6e1bfab15b537365041a9341fd1" PRIMARY KEY ("id"))`);
46
+ await queryRunner.query(`CREATE TABLE "mcp_authorization_flows" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "authorization_journey_id" uuid NOT NULL, "server_id" uuid NOT NULL, "client_id" uuid NOT NULL, "status" text NOT NULL DEFAULT 'CLIENT_NOT_REGISTERED', "code_challenge" text, "code_challenge_method" character varying(10), "state" text, "redirect_uri" text, "scopes" text, "resource" text, "authorization_code" text, "authorization_code_expires_at" TIMESTAMP WITH TIME ZONE, "authorization_code_used" boolean NOT NULL DEFAULT false, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "REL_e059c1afc29350cf077fec4c41" UNIQUE ("authorization_journey_id"), CONSTRAINT "REL_0bf6704cedff2e876c78f69239" UNIQUE ("client_id"), CONSTRAINT "PK_f777a205c2736591cbea8d00652" PRIMARY KEY ("id"))`);
47
+ await queryRunner.query(`CREATE TABLE "mcp_refresh_tokens" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "mcp_authorization_flow_id" uuid NOT NULL, "token_hash" text NOT NULL, "client_id" text NOT NULL, "expires_at" TIMESTAMP WITH TIME ZONE NOT NULL, "revoked_at" TIMESTAMP WITH TIME ZONE, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "PK_0a56ff19b7fe48d4fa2ac7fd80c" PRIMARY KEY ("id"))`);
48
+ await queryRunner.query(`CREATE TABLE "issued_access_tokens" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "subject_actor_id" uuid NOT NULL, "issued_by_actor_id" uuid NOT NULL, "jti" text NOT NULL, "name" text NOT NULL, "scopes" text NOT NULL, "expires_at" TIMESTAMP WITH TIME ZONE NOT NULL, "revoked_at" TIMESTAMP WITH TIME ZONE, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "last_used_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "UQ_ba180406113fbf46571e68f3f42" UNIQUE ("jti"), CONSTRAINT "PK_38d85c5540f4a7eb8bf0f0a383c" PRIMARY KEY ("id"))`);
49
+ await queryRunner.query(`CREATE TABLE "jwks_keys" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "kid" text NOT NULL, "public_key_pem" text NOT NULL, "private_key_pem" text NOT NULL, "algorithm" text NOT NULL, "is_active" boolean NOT NULL DEFAULT true, "expires_at" TIMESTAMP WITH TIME ZONE NOT NULL, "row_version" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "UQ_e3ce852f6df1aadba3556a4a25c" UNIQUE ("kid"), CONSTRAINT "PK_f34118b5ad5b54a309e5fd0fdd2" PRIMARY KEY ("id"))`);
50
+ await queryRunner.query(`CREATE TABLE "context_block_tags" ("block_id" uuid NOT NULL, "tag_id" uuid NOT NULL, CONSTRAINT "PK_0d76072c9dcfe60511bfbf32250" PRIMARY KEY ("block_id", "tag_id"))`);
51
+ await queryRunner.query(`CREATE INDEX "IDX_8eee5fc7e05f49c69e84f4cd38" ON "context_block_tags" ("block_id") `);
52
+ await queryRunner.query(`CREATE INDEX "IDX_8704e0fe5627b9514b24d898f7" ON "context_block_tags" ("tag_id") `);
53
+ await queryRunner.query(`CREATE TABLE "task_dependencies" ("task_id" uuid NOT NULL, "depends_on_task_id" uuid NOT NULL, CONSTRAINT "PK_34abffd156d4d10466f5f254ef2" PRIMARY KEY ("task_id", "depends_on_task_id"))`);
54
+ await queryRunner.query(`CREATE INDEX "IDX_1ae6688b1bd90fffe857f4cb70" ON "task_dependencies" ("task_id") `);
55
+ await queryRunner.query(`CREATE INDEX "IDX_26dedda08faccdb95aff99e112" ON "task_dependencies" ("depends_on_task_id") `);
56
+ await queryRunner.query(`CREATE TABLE "task_tags" ("task_id" uuid NOT NULL, "tag_id" uuid NOT NULL, CONSTRAINT "PK_a7354e3c3f630636f6e4a29694a" PRIMARY KEY ("task_id", "tag_id"))`);
57
+ await queryRunner.query(`CREATE INDEX "IDX_70515bc464901781ac60b82a1e" ON "task_tags" ("task_id") `);
58
+ await queryRunner.query(`CREATE INDEX "IDX_f883135d033e1541f6a81972e7" ON "task_tags" ("tag_id") `);
59
+ await queryRunner.query(`CREATE TABLE "thread_tasks" ("thread_id" uuid NOT NULL, "task_id" uuid NOT NULL, CONSTRAINT "PK_9ef1b08e2914954da7470f44ee3" PRIMARY KEY ("thread_id", "task_id"))`);
60
+ await queryRunner.query(`CREATE INDEX "IDX_9dfa54dc69d0b1b215d36e4fcb" ON "thread_tasks" ("thread_id") `);
61
+ await queryRunner.query(`CREATE INDEX "IDX_27940e313cd1b50301ca7b9927" ON "thread_tasks" ("task_id") `);
62
+ await queryRunner.query(`CREATE TABLE "thread_context_blocks" ("thread_id" uuid NOT NULL, "context_block_id" uuid NOT NULL, CONSTRAINT "PK_b0db86740ce7697abec9e6a99df" PRIMARY KEY ("thread_id", "context_block_id"))`);
63
+ await queryRunner.query(`CREATE INDEX "IDX_b0ac4c88dcd93e8152d743bcd8" ON "thread_context_blocks" ("thread_id") `);
64
+ await queryRunner.query(`CREATE INDEX "IDX_7ee41ccd22caec2f434d2fa180" ON "thread_context_blocks" ("context_block_id") `);
65
+ await queryRunner.query(`CREATE TABLE "thread_tags" ("thread_id" uuid NOT NULL, "tag_id" uuid NOT NULL, CONSTRAINT "PK_7f989951c8fceb626a32f61805d" PRIMARY KEY ("thread_id", "tag_id"))`);
66
+ await queryRunner.query(`CREATE INDEX "IDX_3b7d48bd25da9d3618981fdc3a" ON "thread_tags" ("thread_id") `);
67
+ await queryRunner.query(`CREATE INDEX "IDX_ee437d566a7d008da12d2424c6" ON "thread_tags" ("tag_id") `);
68
+ await queryRunner.query(`CREATE TABLE "thread_participants" ("thread_id" uuid NOT NULL, "actor_id" uuid NOT NULL, CONSTRAINT "PK_70b36ca524cfccce3936653aa0e" PRIMARY KEY ("thread_id", "actor_id"))`);
69
+ await queryRunner.query(`CREATE INDEX "IDX_c0b642fb1e69a2d51ad4a42763" ON "thread_participants" ("thread_id") `);
70
+ await queryRunner.query(`CREATE INDEX "IDX_88073a6748e95733b098e74996" ON "thread_participants" ("actor_id") `);
71
+ await queryRunner.query(`CREATE TABLE "task_blueprint_tags" ("task_blueprint_id" uuid NOT NULL, "tag_id" uuid NOT NULL, CONSTRAINT "PK_8ef4e39a26f9b3b5ead6ddca8e7" PRIMARY KEY ("task_blueprint_id", "tag_id"))`);
72
+ await queryRunner.query(`CREATE INDEX "IDX_b2bd456852196e805b98e962bc" ON "task_blueprint_tags" ("task_blueprint_id") `);
73
+ await queryRunner.query(`CREATE INDEX "IDX_d7aba355071665af6488f130a7" ON "task_blueprint_tags" ("tag_id") `);
74
+ await queryRunner.query(`ALTER TABLE "workers" ADD CONSTRAINT "FK_504178c0ec7be818c522c0f01af" FOREIGN KEY ("oauth_client_id") REFERENCES "registered_clients"("client_id") ON DELETE CASCADE ON UPDATE NO ACTION`);
75
+ await queryRunner.query(`ALTER TABLE "users" ADD CONSTRAINT "FK_0c17e643b069470055be07d69ed" FOREIGN KEY ("actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
76
+ await queryRunner.query(`ALTER TABLE "mcp_connections" ADD CONSTRAINT "FK_ec0a65330c7c528d7ee7cd09b4a" FOREIGN KEY ("serverId") REFERENCES "mcp_servers"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
77
+ await queryRunner.query(`ALTER TABLE "mcp_scope_mappings" ADD CONSTRAINT "FK_2b56cc692e2f3b451195876c4e9" FOREIGN KEY ("scopeId", "serverId") REFERENCES "mcp_scopes"("id","serverId") ON DELETE CASCADE ON UPDATE NO ACTION`);
78
+ await queryRunner.query(`ALTER TABLE "mcp_scope_mappings" ADD CONSTRAINT "FK_c376dcb7f9a05b39c08d63622bc" FOREIGN KEY ("connectionId") REFERENCES "mcp_connections"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
79
+ await queryRunner.query(`ALTER TABLE "agent_tool_permission_scopes" ADD CONSTRAINT "FK_fea954ca4ca5815942a26c5ad53" FOREIGN KEY ("agent_actor_id", "server_id") REFERENCES "agent_tool_permissions"("agent_actor_id","server_id") ON DELETE CASCADE ON UPDATE NO ACTION`);
80
+ await queryRunner.query(`ALTER TABLE "agent_tool_permission_scopes" ADD CONSTRAINT "FK_71546cc2626cf18017c63ff518f" FOREIGN KEY ("scope_id", "server_id") REFERENCES "mcp_scopes"("id","serverId") ON DELETE CASCADE ON UPDATE NO ACTION`);
81
+ await queryRunner.query(`ALTER TABLE "mcp_scopes" ADD CONSTRAINT "FK_68cecda9c8d84c8c61f229a4be2" FOREIGN KEY ("serverId") REFERENCES "mcp_servers"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
82
+ await queryRunner.query(`ALTER TABLE "agent_tool_permissions" ADD CONSTRAINT "FK_c9e747b35e1b9f6a9ac109685ad" FOREIGN KEY ("agent_actor_id") REFERENCES "agents"("actor_id") ON DELETE CASCADE ON UPDATE NO ACTION`);
83
+ await queryRunner.query(`ALTER TABLE "agent_tool_permissions" ADD CONSTRAINT "FK_f1eb1e26820d24a12c626b81e91" FOREIGN KEY ("server_id") REFERENCES "mcp_servers"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
84
+ await queryRunner.query(`ALTER TABLE "agents" ADD CONSTRAINT "FK_2c4c2595e6f8699f2b26b5e7589" FOREIGN KEY ("actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
85
+ await queryRunner.query(`ALTER TABLE "comments" ADD CONSTRAINT "FK_bbfbee2b1b4f9f1f7de4c02654c" FOREIGN KEY ("commenter_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
86
+ await queryRunner.query(`ALTER TABLE "comments" ADD CONSTRAINT "FK_18c2493067c11f44efb35ca0e03" FOREIGN KEY ("task_id") REFERENCES "tasks"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
87
+ await queryRunner.query(`ALTER TABLE "artefacts" ADD CONSTRAINT "FK_7841ac39f494f914d5200cb94be" FOREIGN KEY ("task_id") REFERENCES "tasks"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
88
+ await queryRunner.query(`ALTER TABLE "task_input_requests" ADD CONSTRAINT "FK_de2e79dbc1588bfc1e6416329f8" FOREIGN KEY ("task_id") REFERENCES "tasks"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
89
+ await queryRunner.query(`ALTER TABLE "task_input_requests" ADD CONSTRAINT "FK_12bbab9cd739978a4ac7a318b5b" FOREIGN KEY ("asked_by_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
90
+ await queryRunner.query(`ALTER TABLE "task_input_requests" ADD CONSTRAINT "FK_99c0a77a070c5ff4eb339107d00" FOREIGN KEY ("assigned_to_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
91
+ await queryRunner.query(`ALTER TABLE "context_blocks" ADD CONSTRAINT "FK_1700363b5a5db27b0f2ea2cc39d" FOREIGN KEY ("created_by_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
92
+ await queryRunner.query(`ALTER TABLE "context_blocks" ADD CONSTRAINT "FK_b34d08eeab998b83e5ca84d7b7b" FOREIGN KEY ("assignee_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
93
+ await queryRunner.query(`ALTER TABLE "context_blocks" ADD CONSTRAINT "FK_938da9a0857d1b418dcc33e7326" FOREIGN KEY ("parent_id") REFERENCES "context_blocks"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
94
+ await queryRunner.query(`ALTER TABLE "tasks" ADD CONSTRAINT "FK_733d1181d78ed254ea08e8683c4" FOREIGN KEY ("assignee_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
95
+ await queryRunner.query(`ALTER TABLE "tasks" ADD CONSTRAINT "FK_a3e0f9b54499d948c2d62c8ef03" FOREIGN KEY ("created_by_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
96
+ await queryRunner.query(`ALTER TABLE "thread_messages" ADD CONSTRAINT "FK_c6bc073e77f201aa2fdbaa1688e" FOREIGN KEY ("thread_id") REFERENCES "threads"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
97
+ await queryRunner.query(`ALTER TABLE "thread_messages" ADD CONSTRAINT "FK_50433df7361de1e6aaa5ce135f0" FOREIGN KEY ("created_by_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
98
+ await queryRunner.query(`ALTER TABLE "threads" ADD CONSTRAINT "FK_88952da3cfbf9e9618e7bb36555" FOREIGN KEY ("created_by_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
99
+ await queryRunner.query(`ALTER TABLE "threads" ADD CONSTRAINT "FK_f93fd3ebb839bcfec39507a7a08" FOREIGN KEY ("parent_task_id") REFERENCES "tasks"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
100
+ await queryRunner.query(`ALTER TABLE "threads" ADD CONSTRAINT "FK_108b53483c683c9984d2a2c50e6" FOREIGN KEY ("state_context_block_id") REFERENCES "context_blocks"("id") ON DELETE RESTRICT ON UPDATE NO ACTION`);
101
+ await queryRunner.query(`ALTER TABLE "task_blueprints" ADD CONSTRAINT "FK_7c590d2fc49e749264538ceb4bb" FOREIGN KEY ("assignee_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
102
+ await queryRunner.query(`ALTER TABLE "task_blueprints" ADD CONSTRAINT "FK_04d8ca9e76a6128b419f3e4ead4" FOREIGN KEY ("created_by_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
103
+ await queryRunner.query(`ALTER TABLE "scheduled_tasks" ADD CONSTRAINT "FK_e0ed072463cead4e3c32ee96a70" FOREIGN KEY ("task_blueprint_id") REFERENCES "task_blueprints"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
104
+ await queryRunner.query(`ALTER TABLE "secrets" ADD CONSTRAINT "FK_b90f89051d9de67b62a3c412e04" FOREIGN KEY ("created_by_actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
105
+ await queryRunner.query(`ALTER TABLE "tag_usage" ADD CONSTRAINT "FK_fc603902944def35770f762c0e8" FOREIGN KEY ("tag_id") REFERENCES "tags"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
106
+ await queryRunner.query(`ALTER TABLE "projects" ADD CONSTRAINT "FK_30fa6513ff893536087fece24e4" FOREIGN KEY ("tagId") REFERENCES "tags"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
107
+ await queryRunner.query(`ALTER TABLE "chat_providers" ADD CONSTRAINT "FK_ce21fdd216a3dc4449048d98701" FOREIGN KEY ("secret_id") REFERENCES "secrets"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
108
+ await queryRunner.query(`ALTER TABLE "agent_runs" ADD CONSTRAINT "FK_76579c6cb0dd9963517972ff181" FOREIGN KEY ("actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
109
+ await queryRunner.query(`ALTER TABLE "agent_runs" ADD CONSTRAINT "FK_696fd2a86092b418b8d9f4b98a1" FOREIGN KEY ("parent_task_id") REFERENCES "tasks"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
110
+ await queryRunner.query(`ALTER TABLE "task_execution_queue" ADD CONSTRAINT "FK_e6293cc4ad257649be5e6f58598" FOREIGN KEY ("task_id") REFERENCES "tasks"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
111
+ await queryRunner.query(`ALTER TABLE "task_execution_history" ADD CONSTRAINT "FK_984e814ae64967b7b44c489f31a" FOREIGN KEY ("task_id") REFERENCES "tasks"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
112
+ await queryRunner.query(`ALTER TABLE "task_execution_history" ADD CONSTRAINT "FK_7142473429261e167efdb3cc233" FOREIGN KEY ("agent_actor_id") REFERENCES "agents"("actor_id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
113
+ await queryRunner.query(`ALTER TABLE "active_task_executions" ADD CONSTRAINT "FK_ff4cf561fb305efc1fe12c52d7d" FOREIGN KEY ("task_id") REFERENCES "tasks"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
114
+ await queryRunner.query(`ALTER TABLE "active_task_executions" ADD CONSTRAINT "FK_76b62d7c79a8d94670416e9f431" FOREIGN KEY ("agent_actor_id") REFERENCES "agents"("actor_id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
115
+ await queryRunner.query(`ALTER TABLE "refresh_tokens" ADD CONSTRAINT "FK_3ddc983c5f7bcf132fd8732c3f4" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
116
+ await queryRunner.query(`ALTER TABLE "connection_authorization_flows" ADD CONSTRAINT "FK_0202c0a6cdc97d768d2f30bd98e" FOREIGN KEY ("authorization_journey_id") REFERENCES "authorization_journeys"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
117
+ await queryRunner.query(`ALTER TABLE "connection_authorization_flows" ADD CONSTRAINT "FK_9733b428ec183d2f631fe084a19" FOREIGN KEY ("mcp_connection_id") REFERENCES "mcp_connections"("id") ON DELETE SET NULL ON UPDATE NO ACTION`);
118
+ await queryRunner.query(`ALTER TABLE "authorization_journeys" ADD CONSTRAINT "FK_52f76ac34609751f50ec32e01b0" FOREIGN KEY ("actor_id") REFERENCES "actors"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
119
+ await queryRunner.query(`ALTER TABLE "mcp_authorization_flows" ADD CONSTRAINT "FK_e059c1afc29350cf077fec4c41b" FOREIGN KEY ("authorization_journey_id") REFERENCES "authorization_journeys"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
120
+ await queryRunner.query(`ALTER TABLE "mcp_authorization_flows" ADD CONSTRAINT "FK_a16cb7e1605a1d6347ba1f40ad3" FOREIGN KEY ("server_id") REFERENCES "mcp_servers"("id") ON DELETE RESTRICT ON UPDATE NO ACTION`);
121
+ await queryRunner.query(`ALTER TABLE "mcp_authorization_flows" ADD CONSTRAINT "FK_0bf6704cedff2e876c78f692398" FOREIGN KEY ("client_id") REFERENCES "registered_clients"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
122
+ await queryRunner.query(`ALTER TABLE "mcp_refresh_tokens" ADD CONSTRAINT "FK_20955b8ef7f0e27ee2198a80015" FOREIGN KEY ("mcp_authorization_flow_id") REFERENCES "mcp_authorization_flows"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
123
+ await queryRunner.query(`ALTER TABLE "issued_access_tokens" ADD CONSTRAINT "FK_d9204aec1e09d08d06011993cd4" FOREIGN KEY ("subject_actor_id") REFERENCES "actors"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
124
+ await queryRunner.query(`ALTER TABLE "issued_access_tokens" ADD CONSTRAINT "FK_20f8dee70027015cf098a9cbf93" FOREIGN KEY ("issued_by_actor_id") REFERENCES "actors"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
125
+ await queryRunner.query(`ALTER TABLE "context_block_tags" ADD CONSTRAINT "FK_8eee5fc7e05f49c69e84f4cd384" FOREIGN KEY ("block_id") REFERENCES "context_blocks"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
126
+ await queryRunner.query(`ALTER TABLE "context_block_tags" ADD CONSTRAINT "FK_8704e0fe5627b9514b24d898f7a" FOREIGN KEY ("tag_id") REFERENCES "tags"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
127
+ await queryRunner.query(`ALTER TABLE "task_dependencies" ADD CONSTRAINT "FK_1ae6688b1bd90fffe857f4cb707" FOREIGN KEY ("task_id") REFERENCES "tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
128
+ await queryRunner.query(`ALTER TABLE "task_dependencies" ADD CONSTRAINT "FK_26dedda08faccdb95aff99e112e" FOREIGN KEY ("depends_on_task_id") REFERENCES "tasks"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
129
+ await queryRunner.query(`ALTER TABLE "task_tags" ADD CONSTRAINT "FK_70515bc464901781ac60b82a1ea" FOREIGN KEY ("task_id") REFERENCES "tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
130
+ await queryRunner.query(`ALTER TABLE "task_tags" ADD CONSTRAINT "FK_f883135d033e1541f6a81972e7d" FOREIGN KEY ("tag_id") REFERENCES "tags"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
131
+ await queryRunner.query(`ALTER TABLE "thread_tasks" ADD CONSTRAINT "FK_9dfa54dc69d0b1b215d36e4fcb7" FOREIGN KEY ("thread_id") REFERENCES "threads"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
132
+ await queryRunner.query(`ALTER TABLE "thread_tasks" ADD CONSTRAINT "FK_27940e313cd1b50301ca7b9927d" FOREIGN KEY ("task_id") REFERENCES "tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
133
+ await queryRunner.query(`ALTER TABLE "thread_context_blocks" ADD CONSTRAINT "FK_b0ac4c88dcd93e8152d743bcd87" FOREIGN KEY ("thread_id") REFERENCES "threads"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
134
+ await queryRunner.query(`ALTER TABLE "thread_context_blocks" ADD CONSTRAINT "FK_7ee41ccd22caec2f434d2fa1802" FOREIGN KEY ("context_block_id") REFERENCES "context_blocks"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
135
+ await queryRunner.query(`ALTER TABLE "thread_tags" ADD CONSTRAINT "FK_3b7d48bd25da9d3618981fdc3ac" FOREIGN KEY ("thread_id") REFERENCES "threads"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
136
+ await queryRunner.query(`ALTER TABLE "thread_tags" ADD CONSTRAINT "FK_ee437d566a7d008da12d2424c64" FOREIGN KEY ("tag_id") REFERENCES "tags"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
137
+ await queryRunner.query(`ALTER TABLE "thread_participants" ADD CONSTRAINT "FK_c0b642fb1e69a2d51ad4a427635" FOREIGN KEY ("thread_id") REFERENCES "threads"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
138
+ await queryRunner.query(`ALTER TABLE "thread_participants" ADD CONSTRAINT "FK_88073a6748e95733b098e74996a" FOREIGN KEY ("actor_id") REFERENCES "actors"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
139
+ await queryRunner.query(`ALTER TABLE "task_blueprint_tags" ADD CONSTRAINT "FK_b2bd456852196e805b98e962bc3" FOREIGN KEY ("task_blueprint_id") REFERENCES "task_blueprints"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
140
+ await queryRunner.query(`ALTER TABLE "task_blueprint_tags" ADD CONSTRAINT "FK_d7aba355071665af6488f130a7c" FOREIGN KEY ("tag_id") REFERENCES "tags"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
141
+ await queryRunner.query(`DO $$
142
+ DECLARE constraint_row record;
143
+ BEGIN
144
+ FOR constraint_row IN
145
+ SELECT n.nspname AS schema_name, c.relname AS table_name, p.conname AS constraint_name
146
+ FROM pg_constraint p
147
+ JOIN pg_class c ON c.oid = p.conrelid
148
+ JOIN pg_namespace n ON n.oid = c.relnamespace
149
+ WHERE p.contype = 'f' AND n.nspname = 'public'
150
+ LOOP
151
+ EXECUTE format(
152
+ 'ALTER TABLE %I.%I ALTER CONSTRAINT %I DEFERRABLE INITIALLY DEFERRED',
153
+ constraint_row.schema_name,
154
+ constraint_row.table_name,
155
+ constraint_row.constraint_name
156
+ );
157
+ END LOOP;
158
+ END $$`);
159
+ await queryRunner.query(`CREATE UNIQUE INDEX "uq_tags_name_ci" ON "tags" (lower("name"))`);
160
+ await queryRunner.query(`CREATE UNIQUE INDEX "idx_secrets_name" ON "secrets" ("name") WHERE "deleted_at" IS NULL`);
161
+ await queryRunner.query(`CREATE UNIQUE INDEX "uq_mcp_servers_provided_id_active" ON "mcp_servers" ("providedId") WHERE "deletedAt" IS NULL`);
162
+ await queryRunner.query(`CREATE UNIQUE INDEX "uq_threads_parent_task_id_non_null" ON "threads" ("parent_task_id") WHERE "parent_task_id" IS NOT NULL AND "deleted_at" IS NULL`);
163
+ await queryRunner.query(`CREATE INDEX "idx_chat_providers_is_active" ON "chat_providers" ("is_active") WHERE "deleted_at" IS NULL`);
164
+ await queryRunner.query(`ALTER TABLE "actors" ADD CONSTRAINT "chk_actors_type" CHECK ("type" IN ('human', 'agent'))`);
165
+ await queryRunner.query(`ALTER TABLE "agents" ADD CONSTRAINT "chk_agents_type" CHECK ("type" IN ('claude', 'codex', 'opencode', 'adk', 'githubcopilot', 'other'))`);
166
+ await queryRunner.query(`ALTER TABLE "tasks" ADD CONSTRAINT "chk_tasks_status" CHECK ("status" IN ('NOT_STARTED', 'IN_PROGRESS', 'FOR_REVIEW', 'DONE'))`);
167
+ await queryRunner.query(`ALTER TABLE "active_task_executions" ADD CONSTRAINT "chk_active_execution_task_status" CHECK ("task_status_before_claim" IN ('NOT_STARTED', 'IN_PROGRESS', 'FOR_REVIEW', 'DONE'))`);
168
+ await queryRunner.query(`ALTER TABLE "task_execution_history" ADD CONSTRAINT "chk_execution_history_status" CHECK ("status" IN ('SUCCEEDED', 'FAILED', 'STALE', 'CANCELLED'))`);
169
+ await queryRunner.query(`ALTER TABLE "task_execution_history" ADD CONSTRAINT "chk_execution_history_error_code" CHECK ("error_code" IS NULL OR "error_code" IN ('OUT_OF_QUOTA', 'INTERRUPTED', 'UNKNOWN'))`);
170
+ await queryRunner.query(`ALTER TABLE "registered_clients" ADD CONSTRAINT "chk_registered_client_auth_method" CHECK ("token_endpoint_auth_method" IN ('none', 'client_secret_basic'))`);
171
+ await queryRunner.query(`CREATE TABLE "adk_sessions" (
172
+ "app_name" text NOT NULL,
173
+ "user_id" text NOT NULL,
174
+ "session_id" text NOT NULL,
175
+ "state_json" jsonb NOT NULL,
176
+ "last_update_time" bigint NOT NULL,
177
+ PRIMARY KEY ("app_name", "user_id", "session_id")
178
+ )`);
179
+ await queryRunner.query(`CREATE TABLE "adk_events" (
180
+ "sequence" bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
181
+ "app_name" text NOT NULL,
182
+ "user_id" text NOT NULL,
183
+ "session_id" text NOT NULL,
184
+ "event_id" text NOT NULL,
185
+ "timestamp" bigint NOT NULL,
186
+ "event_json" jsonb NOT NULL,
187
+ CONSTRAINT "fk_adk_events_session" FOREIGN KEY ("app_name", "user_id", "session_id")
188
+ REFERENCES "adk_sessions" ("app_name", "user_id", "session_id") ON DELETE CASCADE
189
+ )`);
190
+ await queryRunner.query(`CREATE INDEX "idx_adk_events_session_sequence" ON "adk_events" ("app_name", "user_id", "session_id", "sequence")`);
191
+ await queryRunner.query(`CREATE TABLE "adk_app_state" (
192
+ "app_name" text NOT NULL,
193
+ "state_key" text NOT NULL,
194
+ "value_json" jsonb NOT NULL,
195
+ PRIMARY KEY ("app_name", "state_key")
196
+ )`);
197
+ await queryRunner.query(`CREATE TABLE "adk_user_state" (
198
+ "app_name" text NOT NULL,
199
+ "user_id" text NOT NULL,
200
+ "state_key" text NOT NULL,
201
+ "value_json" jsonb NOT NULL,
202
+ PRIMARY KEY ("app_name", "user_id", "state_key")
203
+ )`);
204
+ await queryRunner.query(`CREATE SCHEMA "migration_archive"`);
205
+ await queryRunner.query(`CREATE TABLE "migration_archive"."rows" (
206
+ "source_database" text NOT NULL,
207
+ "source_table" text NOT NULL,
208
+ "source_key" text,
209
+ "reason" text NOT NULL,
210
+ "row_data" jsonb NOT NULL,
211
+ "archived_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
212
+ )`);
213
+ }
214
+ async down(queryRunner) {
215
+ await queryRunner.query(`DROP SCHEMA "migration_archive" CASCADE`);
216
+ await queryRunner.query(`DROP TABLE "adk_user_state"`);
217
+ await queryRunner.query(`DROP TABLE "adk_app_state"`);
218
+ await queryRunner.query(`DROP TABLE "adk_events"`);
219
+ await queryRunner.query(`DROP TABLE "adk_sessions"`);
220
+ await queryRunner.query(`DROP INDEX "public"."idx_chat_providers_is_active"`);
221
+ await queryRunner.query(`DROP INDEX "public"."uq_threads_parent_task_id_non_null"`);
222
+ await queryRunner.query(`DROP INDEX "public"."uq_mcp_servers_provided_id_active"`);
223
+ await queryRunner.query(`DROP INDEX "public"."idx_secrets_name"`);
224
+ await queryRunner.query(`DROP INDEX "public"."uq_tags_name_ci"`);
225
+ await queryRunner.query(`ALTER TABLE "task_blueprint_tags" DROP CONSTRAINT "FK_d7aba355071665af6488f130a7c"`);
226
+ await queryRunner.query(`ALTER TABLE "task_blueprint_tags" DROP CONSTRAINT "FK_b2bd456852196e805b98e962bc3"`);
227
+ await queryRunner.query(`ALTER TABLE "thread_participants" DROP CONSTRAINT "FK_88073a6748e95733b098e74996a"`);
228
+ await queryRunner.query(`ALTER TABLE "thread_participants" DROP CONSTRAINT "FK_c0b642fb1e69a2d51ad4a427635"`);
229
+ await queryRunner.query(`ALTER TABLE "thread_tags" DROP CONSTRAINT "FK_ee437d566a7d008da12d2424c64"`);
230
+ await queryRunner.query(`ALTER TABLE "thread_tags" DROP CONSTRAINT "FK_3b7d48bd25da9d3618981fdc3ac"`);
231
+ await queryRunner.query(`ALTER TABLE "thread_context_blocks" DROP CONSTRAINT "FK_7ee41ccd22caec2f434d2fa1802"`);
232
+ await queryRunner.query(`ALTER TABLE "thread_context_blocks" DROP CONSTRAINT "FK_b0ac4c88dcd93e8152d743bcd87"`);
233
+ await queryRunner.query(`ALTER TABLE "thread_tasks" DROP CONSTRAINT "FK_27940e313cd1b50301ca7b9927d"`);
234
+ await queryRunner.query(`ALTER TABLE "thread_tasks" DROP CONSTRAINT "FK_9dfa54dc69d0b1b215d36e4fcb7"`);
235
+ await queryRunner.query(`ALTER TABLE "task_tags" DROP CONSTRAINT "FK_f883135d033e1541f6a81972e7d"`);
236
+ await queryRunner.query(`ALTER TABLE "task_tags" DROP CONSTRAINT "FK_70515bc464901781ac60b82a1ea"`);
237
+ await queryRunner.query(`ALTER TABLE "task_dependencies" DROP CONSTRAINT "FK_26dedda08faccdb95aff99e112e"`);
238
+ await queryRunner.query(`ALTER TABLE "task_dependencies" DROP CONSTRAINT "FK_1ae6688b1bd90fffe857f4cb707"`);
239
+ await queryRunner.query(`ALTER TABLE "context_block_tags" DROP CONSTRAINT "FK_8704e0fe5627b9514b24d898f7a"`);
240
+ await queryRunner.query(`ALTER TABLE "context_block_tags" DROP CONSTRAINT "FK_8eee5fc7e05f49c69e84f4cd384"`);
241
+ await queryRunner.query(`ALTER TABLE "issued_access_tokens" DROP CONSTRAINT "FK_20f8dee70027015cf098a9cbf93"`);
242
+ await queryRunner.query(`ALTER TABLE "issued_access_tokens" DROP CONSTRAINT "FK_d9204aec1e09d08d06011993cd4"`);
243
+ await queryRunner.query(`ALTER TABLE "mcp_refresh_tokens" DROP CONSTRAINT "FK_20955b8ef7f0e27ee2198a80015"`);
244
+ await queryRunner.query(`ALTER TABLE "mcp_authorization_flows" DROP CONSTRAINT "FK_0bf6704cedff2e876c78f692398"`);
245
+ await queryRunner.query(`ALTER TABLE "mcp_authorization_flows" DROP CONSTRAINT "FK_a16cb7e1605a1d6347ba1f40ad3"`);
246
+ await queryRunner.query(`ALTER TABLE "mcp_authorization_flows" DROP CONSTRAINT "FK_e059c1afc29350cf077fec4c41b"`);
247
+ await queryRunner.query(`ALTER TABLE "authorization_journeys" DROP CONSTRAINT "FK_52f76ac34609751f50ec32e01b0"`);
248
+ await queryRunner.query(`ALTER TABLE "connection_authorization_flows" DROP CONSTRAINT "FK_9733b428ec183d2f631fe084a19"`);
249
+ await queryRunner.query(`ALTER TABLE "connection_authorization_flows" DROP CONSTRAINT "FK_0202c0a6cdc97d768d2f30bd98e"`);
250
+ await queryRunner.query(`ALTER TABLE "refresh_tokens" DROP CONSTRAINT "FK_3ddc983c5f7bcf132fd8732c3f4"`);
251
+ await queryRunner.query(`ALTER TABLE "active_task_executions" DROP CONSTRAINT "FK_76b62d7c79a8d94670416e9f431"`);
252
+ await queryRunner.query(`ALTER TABLE "active_task_executions" DROP CONSTRAINT "FK_ff4cf561fb305efc1fe12c52d7d"`);
253
+ await queryRunner.query(`ALTER TABLE "task_execution_history" DROP CONSTRAINT "FK_7142473429261e167efdb3cc233"`);
254
+ await queryRunner.query(`ALTER TABLE "task_execution_history" DROP CONSTRAINT "FK_984e814ae64967b7b44c489f31a"`);
255
+ await queryRunner.query(`ALTER TABLE "task_execution_queue" DROP CONSTRAINT "FK_e6293cc4ad257649be5e6f58598"`);
256
+ await queryRunner.query(`ALTER TABLE "agent_runs" DROP CONSTRAINT "FK_696fd2a86092b418b8d9f4b98a1"`);
257
+ await queryRunner.query(`ALTER TABLE "agent_runs" DROP CONSTRAINT "FK_76579c6cb0dd9963517972ff181"`);
258
+ await queryRunner.query(`ALTER TABLE "chat_providers" DROP CONSTRAINT "FK_ce21fdd216a3dc4449048d98701"`);
259
+ await queryRunner.query(`ALTER TABLE "projects" DROP CONSTRAINT "FK_30fa6513ff893536087fece24e4"`);
260
+ await queryRunner.query(`ALTER TABLE "tag_usage" DROP CONSTRAINT "FK_fc603902944def35770f762c0e8"`);
261
+ await queryRunner.query(`ALTER TABLE "secrets" DROP CONSTRAINT "FK_b90f89051d9de67b62a3c412e04"`);
262
+ await queryRunner.query(`ALTER TABLE "scheduled_tasks" DROP CONSTRAINT "FK_e0ed072463cead4e3c32ee96a70"`);
263
+ await queryRunner.query(`ALTER TABLE "task_blueprints" DROP CONSTRAINT "FK_04d8ca9e76a6128b419f3e4ead4"`);
264
+ await queryRunner.query(`ALTER TABLE "task_blueprints" DROP CONSTRAINT "FK_7c590d2fc49e749264538ceb4bb"`);
265
+ await queryRunner.query(`ALTER TABLE "threads" DROP CONSTRAINT "FK_108b53483c683c9984d2a2c50e6"`);
266
+ await queryRunner.query(`ALTER TABLE "threads" DROP CONSTRAINT "FK_f93fd3ebb839bcfec39507a7a08"`);
267
+ await queryRunner.query(`ALTER TABLE "threads" DROP CONSTRAINT "FK_88952da3cfbf9e9618e7bb36555"`);
268
+ await queryRunner.query(`ALTER TABLE "thread_messages" DROP CONSTRAINT "FK_50433df7361de1e6aaa5ce135f0"`);
269
+ await queryRunner.query(`ALTER TABLE "thread_messages" DROP CONSTRAINT "FK_c6bc073e77f201aa2fdbaa1688e"`);
270
+ await queryRunner.query(`ALTER TABLE "tasks" DROP CONSTRAINT "FK_a3e0f9b54499d948c2d62c8ef03"`);
271
+ await queryRunner.query(`ALTER TABLE "tasks" DROP CONSTRAINT "FK_733d1181d78ed254ea08e8683c4"`);
272
+ await queryRunner.query(`ALTER TABLE "context_blocks" DROP CONSTRAINT "FK_938da9a0857d1b418dcc33e7326"`);
273
+ await queryRunner.query(`ALTER TABLE "context_blocks" DROP CONSTRAINT "FK_b34d08eeab998b83e5ca84d7b7b"`);
274
+ await queryRunner.query(`ALTER TABLE "context_blocks" DROP CONSTRAINT "FK_1700363b5a5db27b0f2ea2cc39d"`);
275
+ await queryRunner.query(`ALTER TABLE "task_input_requests" DROP CONSTRAINT "FK_99c0a77a070c5ff4eb339107d00"`);
276
+ await queryRunner.query(`ALTER TABLE "task_input_requests" DROP CONSTRAINT "FK_12bbab9cd739978a4ac7a318b5b"`);
277
+ await queryRunner.query(`ALTER TABLE "task_input_requests" DROP CONSTRAINT "FK_de2e79dbc1588bfc1e6416329f8"`);
278
+ await queryRunner.query(`ALTER TABLE "artefacts" DROP CONSTRAINT "FK_7841ac39f494f914d5200cb94be"`);
279
+ await queryRunner.query(`ALTER TABLE "comments" DROP CONSTRAINT "FK_18c2493067c11f44efb35ca0e03"`);
280
+ await queryRunner.query(`ALTER TABLE "comments" DROP CONSTRAINT "FK_bbfbee2b1b4f9f1f7de4c02654c"`);
281
+ await queryRunner.query(`ALTER TABLE "agents" DROP CONSTRAINT "FK_2c4c2595e6f8699f2b26b5e7589"`);
282
+ await queryRunner.query(`ALTER TABLE "agent_tool_permissions" DROP CONSTRAINT "FK_f1eb1e26820d24a12c626b81e91"`);
283
+ await queryRunner.query(`ALTER TABLE "agent_tool_permissions" DROP CONSTRAINT "FK_c9e747b35e1b9f6a9ac109685ad"`);
284
+ await queryRunner.query(`ALTER TABLE "mcp_scopes" DROP CONSTRAINT "FK_68cecda9c8d84c8c61f229a4be2"`);
285
+ await queryRunner.query(`ALTER TABLE "agent_tool_permission_scopes" DROP CONSTRAINT "FK_71546cc2626cf18017c63ff518f"`);
286
+ await queryRunner.query(`ALTER TABLE "agent_tool_permission_scopes" DROP CONSTRAINT "FK_fea954ca4ca5815942a26c5ad53"`);
287
+ await queryRunner.query(`ALTER TABLE "mcp_scope_mappings" DROP CONSTRAINT "FK_c376dcb7f9a05b39c08d63622bc"`);
288
+ await queryRunner.query(`ALTER TABLE "mcp_scope_mappings" DROP CONSTRAINT "FK_2b56cc692e2f3b451195876c4e9"`);
289
+ await queryRunner.query(`ALTER TABLE "mcp_connections" DROP CONSTRAINT "FK_ec0a65330c7c528d7ee7cd09b4a"`);
290
+ await queryRunner.query(`ALTER TABLE "users" DROP CONSTRAINT "FK_0c17e643b069470055be07d69ed"`);
291
+ await queryRunner.query(`ALTER TABLE "workers" DROP CONSTRAINT "FK_504178c0ec7be818c522c0f01af"`);
292
+ await queryRunner.query(`DROP INDEX "public"."IDX_d7aba355071665af6488f130a7"`);
293
+ await queryRunner.query(`DROP INDEX "public"."IDX_b2bd456852196e805b98e962bc"`);
294
+ await queryRunner.query(`DROP TABLE "task_blueprint_tags"`);
295
+ await queryRunner.query(`DROP INDEX "public"."IDX_88073a6748e95733b098e74996"`);
296
+ await queryRunner.query(`DROP INDEX "public"."IDX_c0b642fb1e69a2d51ad4a42763"`);
297
+ await queryRunner.query(`DROP TABLE "thread_participants"`);
298
+ await queryRunner.query(`DROP INDEX "public"."IDX_ee437d566a7d008da12d2424c6"`);
299
+ await queryRunner.query(`DROP INDEX "public"."IDX_3b7d48bd25da9d3618981fdc3a"`);
300
+ await queryRunner.query(`DROP TABLE "thread_tags"`);
301
+ await queryRunner.query(`DROP INDEX "public"."IDX_7ee41ccd22caec2f434d2fa180"`);
302
+ await queryRunner.query(`DROP INDEX "public"."IDX_b0ac4c88dcd93e8152d743bcd8"`);
303
+ await queryRunner.query(`DROP TABLE "thread_context_blocks"`);
304
+ await queryRunner.query(`DROP INDEX "public"."IDX_27940e313cd1b50301ca7b9927"`);
305
+ await queryRunner.query(`DROP INDEX "public"."IDX_9dfa54dc69d0b1b215d36e4fcb"`);
306
+ await queryRunner.query(`DROP TABLE "thread_tasks"`);
307
+ await queryRunner.query(`DROP INDEX "public"."IDX_f883135d033e1541f6a81972e7"`);
308
+ await queryRunner.query(`DROP INDEX "public"."IDX_70515bc464901781ac60b82a1e"`);
309
+ await queryRunner.query(`DROP TABLE "task_tags"`);
310
+ await queryRunner.query(`DROP INDEX "public"."IDX_26dedda08faccdb95aff99e112"`);
311
+ await queryRunner.query(`DROP INDEX "public"."IDX_1ae6688b1bd90fffe857f4cb70"`);
312
+ await queryRunner.query(`DROP TABLE "task_dependencies"`);
313
+ await queryRunner.query(`DROP INDEX "public"."IDX_8704e0fe5627b9514b24d898f7"`);
314
+ await queryRunner.query(`DROP INDEX "public"."IDX_8eee5fc7e05f49c69e84f4cd38"`);
315
+ await queryRunner.query(`DROP TABLE "context_block_tags"`);
316
+ await queryRunner.query(`DROP TABLE "jwks_keys"`);
317
+ await queryRunner.query(`DROP TABLE "issued_access_tokens"`);
318
+ await queryRunner.query(`DROP TABLE "mcp_refresh_tokens"`);
319
+ await queryRunner.query(`DROP TABLE "mcp_authorization_flows"`);
320
+ await queryRunner.query(`DROP TABLE "authorization_journeys"`);
321
+ await queryRunner.query(`DROP TABLE "connection_authorization_flows"`);
322
+ await queryRunner.query(`DROP TABLE "refresh_tokens"`);
323
+ await queryRunner.query(`DROP TABLE "active_task_executions"`);
324
+ await queryRunner.query(`DROP TABLE "task_execution_history"`);
325
+ await queryRunner.query(`DROP TABLE "task_execution_queue"`);
326
+ await queryRunner.query(`DROP TABLE "execution_stats"`);
327
+ await queryRunner.query(`DROP INDEX "public"."idx_agent_runs_task_execution_id"`);
328
+ await queryRunner.query(`DROP TABLE "agent_runs"`);
329
+ await queryRunner.query(`DROP TABLE "chat_providers"`);
330
+ await queryRunner.query(`DROP TABLE "projects"`);
331
+ await queryRunner.query(`DROP INDEX "public"."IDX_fc603902944def35770f762c0e"`);
332
+ await queryRunner.query(`DROP TABLE "tag_usage"`);
333
+ await queryRunner.query(`DROP TABLE "secrets"`);
334
+ await queryRunner.query(`DROP INDEX "public"."idx_scheduled_tasks_enabled_next_run_at"`);
335
+ await queryRunner.query(`DROP INDEX "public"."idx_scheduled_tasks_task_blueprint_id"`);
336
+ await queryRunner.query(`DROP TABLE "scheduled_tasks"`);
337
+ await queryRunner.query(`DROP TABLE "task_blueprints"`);
338
+ await queryRunner.query(`DROP TABLE "threads"`);
339
+ await queryRunner.query(`DROP TABLE "thread_messages"`);
340
+ await queryRunner.query(`DROP TABLE "tasks"`);
341
+ await queryRunner.query(`DROP TABLE "tags"`);
342
+ await queryRunner.query(`DROP INDEX "public"."IDX_a9ba3074228102f4d699f5364f"`);
343
+ await queryRunner.query(`DROP TABLE "context_blocks"`);
344
+ await queryRunner.query(`DROP TABLE "task_input_requests"`);
345
+ await queryRunner.query(`DROP TABLE "artefacts"`);
346
+ await queryRunner.query(`DROP TABLE "comments"`);
347
+ await queryRunner.query(`DROP TABLE "actors"`);
348
+ await queryRunner.query(`DROP TABLE "agents"`);
349
+ await queryRunner.query(`DROP TABLE "agent_tool_permissions"`);
350
+ await queryRunner.query(`DROP TABLE "mcp_servers"`);
351
+ await queryRunner.query(`DROP TABLE "mcp_scopes"`);
352
+ await queryRunner.query(`DROP TABLE "agent_tool_permission_scopes"`);
353
+ await queryRunner.query(`DROP TABLE "mcp_scope_mappings"`);
354
+ await queryRunner.query(`DROP TABLE "mcp_connections"`);
355
+ await queryRunner.query(`DROP TABLE "users"`);
356
+ await queryRunner.query(`DROP TABLE "workers"`);
357
+ await queryRunner.query(`DROP TABLE "registered_clients"`);
358
+ }
359
+ }
360
+ exports.PostgresBaseline1750000000000 = PostgresBaseline1750000000000;
361
+ //# sourceMappingURL=1750000000000-PostgresBaseline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1750000000000-PostgresBaseline.js","sourceRoot":"","sources":["../../src/migrations/1750000000000-PostgresBaseline.ts"],"names":[],"mappings":";;;AAEA,MAAa,6BAA6B;IACxC,IAAI,GAAG,+BAA+B,CAAC;IAEhC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;QACrE,MAAM,WAAW,CAAC,KAAK,CACrB,6mBAA6mB,CAC9mB,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,6fAA6f,CAC9f,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,uxBAAuxB,CACxxB,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,mmBAAmmB,CACpmB,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,6iBAA6iB,CAC9iB,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,sXAAsX,CACvX,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,qWAAqW,CACtW,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,8gBAA8gB,CAC/gB,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,wTAAwT,CACzT,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,gyBAAgyB,CACjyB,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,ibAAib,CAClb,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,+YAA+Y,CAChZ,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,8ZAA8Z,CAC/Z,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,kcAAkc,CACnc,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,wfAAwf,CACzf,CA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