@catalyst-cloud/schema 0.1.20 → 0.1.21
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.
- package/package.json +1 -1
- package/src/migrations.generated.ts +9 -0
- package/src/mirror.ts +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@catalyst-cloud/schema",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Typed Drizzle schema = single source of truth for the per-tenant Mirror DO SQLite store (CTC-13 / ADR-0002). Shared by the mirror Worker, the host-sync replica, and the browser OPFS replica.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -214,6 +214,13 @@ export const MIRROR_MIGRATIONS = {
|
|
|
214
214
|
tag: "0028_burly_nemesis",
|
|
215
215
|
breakpoints: true,
|
|
216
216
|
},
|
|
217
|
+
{
|
|
218
|
+
idx: 29,
|
|
219
|
+
version: "6",
|
|
220
|
+
when: 1787615021252,
|
|
221
|
+
tag: "0029_square_silhouette",
|
|
222
|
+
breakpoints: true,
|
|
223
|
+
},
|
|
217
224
|
],
|
|
218
225
|
},
|
|
219
226
|
migrations: {
|
|
@@ -272,5 +279,7 @@ export const MIRROR_MIGRATIONS = {
|
|
|
272
279
|
"0027_closed_miek":
|
|
273
280
|
"CREATE TABLE `check_suites` (\n\t`repo_id` text NOT NULL,\n\t`check_suite_id` text PRIMARY KEY NOT NULL,\n\t`head_sha` text,\n\t`head_branch` text,\n\t`status` text,\n\t`conclusion` text,\n\t`app_slug` text,\n\t`latest_check_runs_count` integer,\n\t`updated_at` integer\n);\n--> statement-breakpoint\nCREATE INDEX `idx_check_suites_sha` ON `check_suites` (`head_sha`);--> statement-breakpoint\nCREATE TABLE `push_events` (\n\t`delivery_id` text PRIMARY KEY NOT NULL,\n\t`repo_id` text NOT NULL,\n\t`ref` text NOT NULL,\n\t`before` text,\n\t`after` text,\n\t`forced` integer,\n\t`created` integer,\n\t`deleted` integer,\n\t`base_ref` text,\n\t`pusher_id` text,\n\t`head_commit_sha` text,\n\t`updated_at` integer\n);\n--> statement-breakpoint\nCREATE INDEX `idx_push_events_repo_ref` ON `push_events` (`repo_id`,`ref`,`updated_at`);--> statement-breakpoint\nALTER TABLE `pull_requests` ADD `merge_commit_sha` text;",
|
|
274
281
|
"0028_burly_nemesis": "ALTER TABLE `check_suites` ADD `pull_request_numbers` text;",
|
|
282
|
+
"0029_square_silhouette":
|
|
283
|
+
"CREATE INDEX `idx_relations_type_related` ON `relations` (`type`,`related_identifier`);",
|
|
275
284
|
},
|
|
276
285
|
} as const;
|
package/src/mirror.ts
CHANGED
|
@@ -148,7 +148,18 @@ export const relations = sqliteTable(
|
|
|
148
148
|
related_identifier: text("related_identifier"),
|
|
149
149
|
updated_at: integer("updated_at"),
|
|
150
150
|
},
|
|
151
|
-
(t) => [
|
|
151
|
+
(t) => [
|
|
152
|
+
index("idx_relations_issue").on(t.issue_identifier),
|
|
153
|
+
// CTC-990: serves evaluateBlockers' incoming-`blocks` lookup (work-eligibility.ts) —
|
|
154
|
+
// `WHERE type = 'blocks' AND related_identifier = ?`, run inside /work/acquire's
|
|
155
|
+
// transactionSync CAS burst, so it cannot afford a full scan. Composite (not single-column)
|
|
156
|
+
// because the predicate always constrains both columns with equality — measured to let SQLite
|
|
157
|
+
// seek on both. `relations` is a Drizzle-mirrored table (replicates to every host/browser
|
|
158
|
+
// replica), so its indexes belong here, in the SSOT, never as a DO-side
|
|
159
|
+
// `CREATE INDEX IF NOT EXISTS` — a DO-side index on a mirrored table would be invisible to the
|
|
160
|
+
// daemon/browser replicas and to this file's own fidelity tests (ADR-0002).
|
|
161
|
+
index("idx_relations_type_related").on(t.type, t.related_identifier),
|
|
162
|
+
],
|
|
152
163
|
);
|
|
153
164
|
|
|
154
165
|
// Linear IssueHistory events (CTC-14) — the per-issue change timeline. Captured INLINE on the issues
|