Skip to content

Commit 2f5fb5e

Browse files
committed
fix ADR migration test fixture and backup guidance
1 parent 687572a commit 2f5fb5e

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

‎docs/upstream-sync/adr-recovery.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ continue using the graph database.
1212

1313
Reindexing or replacing the graph database leaves the sidecar file untouched.
1414
Back up and restore the graph database and its `.adr.db` sidecar together to
15-
preserve ADRs. Team artifacts retain the existing interchange format: export
15+
preserve ADRs. Stop writers and close the stores before copying the files, or
16+
use SQLite's backup facilities for each database while coordinating writes.
17+
Team artifacts retain the existing interchange format: export
1618
copies the selected ADR into `project_summaries` in the snapshot, and import
1719
restores it into the sidecar only if that project has no local ADR. A failed
1820
artifact ADR restore is logged; graph import remains successful, so recover the

‎tests/test_artifact.c‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,9 @@ TEST(adr_sidecar_migrates_and_survives_graph_replacement) {
281281
sqlite3 *raw = NULL;
282282
ASSERT_EQ(sqlite3_open(g_db, &raw), SQLITE_OK);
283283
ASSERT_EQ(
284-
sqlite3_exec(
285-
raw,
286-
"CREATE TABLE project_summaries (project TEXT PRIMARY KEY, summary TEXT NOT NULL, "
287-
"source_hash TEXT NOT NULL, created_at TEXT NOT NULL, updated_at TEXT NOT NULL);"
288-
"INSERT INTO project_summaries VALUES ('test-proj','legacy ADR','h','c','u');",
289-
NULL, NULL, NULL),
284+
sqlite3_exec(raw,
285+
"INSERT INTO project_summaries VALUES ('test-proj','legacy ADR','h','c','u');",
286+
NULL, NULL, NULL),
290287
SQLITE_OK);
291288
sqlite3_close(raw);
292289

0 commit comments

Comments
 (0)