feat(schema): 005 — tags, entity_tags, entity_links, attachments

This commit is contained in:
root
2026-05-31 11:02:14 +10:00
parent 1d799105ac
commit 1b51c3c18d
2 changed files with 59 additions and 0 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 005 — cross', () => {
beforeAll(async () => { await resetDb(); await migrateUp(); });
it('creates tags, entity_tags, entity_links, attachments', async () => {
await withClient(async (c) => {
for (const t of ['tags','entity_tags','entity_links','attachments']) {
const { rows } = await c.query(`SELECT to_regclass('public.' || $1) AS t;`, [t]);
expect(rows[0].t).toBe(t);
}
});
});
});