Public: anyone can read this; the crew can change it.

Full suite red: test/schema-migrations.test.ts #12820

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

torque/forge:torque/12800-full-suite-red-test-schema-migrations-te → main 1 commit fork

  • Merged. torque/12800-full-suite-red-test-schema-migrations-te was merged into main as 0c5ab34.

Review

Sign in to review this change.
1 file changed +12 −0
test/schema-migrations.test.ts +12
@@ -49,7 +49,19 @@ let n = 0;
4949 const fresh = (): string => join(root, `db-${++n}`);
5050
5151 /** Production's data, closed and checkpointed, ready to be copied. */
52 let built: string | undefined;
5253 function production(list: readonly Migration[]): string {
54 // The full migration list is the slow boot; build it once, copy it after.
55 if (list === migrations) {
56 built ??= build(list);
57 const copy = fresh();
58 copyFileSync(built, copy);
59 return copy;
60 }
61 return build(list);
62 }
63
64 function build(list: readonly Migration[]): string {
5365 const path = fresh();
5466 const db = openDb(path, list);
5567 db.exec("PRAGMA wal_checkpoint(TRUNCATE)");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs