Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(bootstrap): pre-v0.18 fixtures drop the v224 trust generation trigger before stripping pages.source_id

garrytan2ab31843299b
diff --git a/test/bootstrap.test.ts b/test/bootstrap.test.ts
index 5299b9142d..845ff291cc 100644
--- a/test/bootstrap.test.ts
+++ b/test/bootstrap.test.ts
@@ -149,6 +149,9 @@ describe('PGLiteEngine#applyForwardReferenceBootstrap', () => {
ALTER TABLE pages DROP CONSTRAINT IF EXISTS pages_source_slug_key;
ALTER TABLE pages ADD CONSTRAINT pages_slug_key UNIQUE (slug);
DROP INDEX IF EXISTS idx_pages_source_id;
+ -- The v224 trust generation trigger's WHEN reads pages.source_id, slug and
+ -- deleted_at; a pre-v0.18 brain predates it (v224 recreates it).
+ DROP TRIGGER IF EXISTS trust_generation_update ON pages;
ALTER TABLE pages DROP COLUMN IF EXISTS source_id;
DROP TABLE IF EXISTS sources CASCADE;
`);
@@ -203,6 +206,9 @@ describe('PGLiteEngine#applyForwardReferenceBootstrap', () => {
ALTER TABLE pages DROP CONSTRAINT IF EXISTS pages_source_slug_key;
ALTER TABLE pages ADD CONSTRAINT pages_slug_key UNIQUE (slug);
DROP INDEX IF EXISTS idx_pages_source_id;
+ -- The v224 trust generation trigger's WHEN reads pages.source_id, slug and
+ -- deleted_at; a pre-v0.18 brain predates it (v224 recreates it).
+ DROP TRIGGER IF EXISTS trust_generation_update ON pages;
ALTER TABLE pages DROP COLUMN IF EXISTS source_id;
DROP TABLE IF EXISTS sources CASCADE;
ALTER TABLE links DROP CONSTRAINT IF EXISTS links_resolution_type_check;
diff --git a/test/schema-bootstrap-coverage.test.ts b/test/schema-bootstrap-coverage.test.ts
index 5e4c104860..727c82d197 100644
--- a/test/schema-bootstrap-coverage.test.ts
+++ b/test/schema-bootstrap-coverage.test.ts
@@ -248,6 +248,9 @@ test('applyForwardReferenceBootstrap covers every forward reference declared in
ALTER TABLE pages DROP CONSTRAINT IF EXISTS pages_source_slug_key;
ALTER TABLE pages ADD CONSTRAINT pages_slug_key UNIQUE (slug);
DROP INDEX IF EXISTS idx_pages_source_id;
+ -- The v224 trust generation trigger's WHEN reads pages.source_id, slug and
+ -- deleted_at; a pre-v0.18 brain predates it (v224 recreates it).
+ DROP TRIGGER IF EXISTS trust_generation_update ON pages;
ALTER TABLE pages DROP COLUMN IF EXISTS source_id;
DROP TABLE IF EXISTS sources CASCADE;
@@ -411,6 +414,9 @@ test('after bootstrap, PGLITE_SCHEMA_SQL replays without crashing on missing for
ALTER TABLE pages DROP CONSTRAINT IF EXISTS pages_source_slug_key;
ALTER TABLE pages ADD CONSTRAINT pages_slug_key UNIQUE (slug);
DROP INDEX IF EXISTS idx_pages_source_id;
+ -- The v224 trust generation trigger's WHEN reads pages.source_id, slug and
+ -- deleted_at; a pre-v0.18 brain predates it (v224 recreates it).
+ DROP TRIGGER IF EXISTS trust_generation_update ON pages;
ALTER TABLE pages DROP COLUMN IF EXISTS source_id;
DROP TABLE IF EXISTS sources CASCADE;
DROP INDEX IF EXISTS idx_links_source;