fix(report): keep the public table allowlist in sync with the longform appendix

The staging quality gate failed because database-local-business still listed the old pg_tables set after 20260905010000.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-05 11:32:17 +08:00
parent bab0718700
commit 52a4570ca1
3 changed files with 33 additions and 4 deletions
+11 -2
View File
@@ -92,11 +92,17 @@ test("local PostgreSQL applies the reviewed business schema and serves authentic
assert.match(migration.stdout, /applied 20260831020000_feature_pricing_admin_runtime_read_policy\.sql/);
assert.match(migration.stdout, /applied 20260901010000_append_consultation_question\.sql/);
assert.match(migration.stdout, /applied 20260901020000_chat_session_pin_archive\.sql/);
assert.match(migration.stdout, /applied 20260905010000_personal_report_longform_appendices\.sql/);
assert.equal(
existsSync(fileURLToPath(new URL("../db/migrations/20260901020000_chat_session_pin_archive.sql", import.meta.url))),
false,
"business migration must not be copied into frontend/db/migrations (BUG-127/BUG-144)",
);
assert.equal(
existsSync(fileURLToPath(new URL("../db/migrations/20260905010000_personal_report_longform_appendices.sql", import.meta.url))),
false,
"business migration must not be copied into frontend/db/migrations (BUG-127/BUG-144)",
);
fixture.psql(pinArchiveMigration);
assert.equal(
fixture.psql(`
@@ -178,8 +184,10 @@ test("local PostgreSQL applies the reviewed business schema and serves authentic
"rectification:standard:3:draft",
);
// Existing assertion updated for the requested durable per-section table.
// Original value omitted personal_report_sections because the table did not exist.
// Public table allowlist. Last change (BUG-548):
// original: omitted personal_report_longform_appendices
// new: insert it between personal_report_jobs and personal_report_sections
// reason: 20260905010000 added the appendix cache table; this list must match live pg_tables
assert.equal(
fixture.psql(`
select string_agg(tablename, ',' order by tablename)
@@ -254,6 +262,7 @@ test("local PostgreSQL applies the reviewed business schema and serves authentic
"payment_orders",
"payment_packages",
"personal_report_jobs",
"personal_report_longform_appendices",
"personal_report_sections",
"personal_reports",
"pricing_experiment_events",