feat(schema): 003 — resources, deps, credentials, source_docs

This commit is contained in:
root
2026-05-31 02:18:39 +10:00
parent c891c495bb
commit 99d64221a0
2 changed files with 80 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { resetDb, withClient } from '../helpers/db.js';
import { migrateUp } from '../../lib/db/migrate.js';
describe('migration 003 — resources', () => {
beforeEach(async () => { await resetDb(); await migrateUp(); });
it('creates resources, resource_dependencies, resource_credentials, source_docs', async () => {
await withClient(async (c) => {
for (const t of ['resources','resource_dependencies','resource_credentials','source_docs']) {
const { rows } = await c.query(
`SELECT to_regclass('public.' || $1) AS t;`, [t]
);
expect(rows[0].t).toBe(t);
}
});
});
});