feat: real audit_log with redaction + pending_changes; replace stub

This commit is contained in:
root
2026-05-31 11:04:53 +10:00
parent 47ea0768fd
commit 10902bc6ac
7 changed files with 231 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
import { describe, it, expect, beforeAll } from 'vitest';
import { resetDb, withClient } from '../helpers/db.js';
import { migrateUp } from '../../lib/db/migrate.js';
describe('migration 006 — audit', () => {
beforeAll(async () => { await resetDb(); await migrateUp(); });
it('creates audit_log and pending_changes', async () => {
await withClient(async (c) => {
for (const t of ['audit_log','pending_changes']) {
const { rows } = await c.query(`SELECT to_regclass('public.' || $1) AS t;`, [t]);
expect(rows[0].t).toBe(t);
}
});
});
});