feat: add portal database schema

This commit is contained in:
Leon Tonhäuser committed 2026-08-09 20:26:18 +02:00
1 parent 763098b129
commit 7acaacb92e
17 files changed
+4410 -111

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { afterAll, expect, test } from "vitest";
import { startPostgres } from "./postgres";
const testDb = await startPostgres();
afterAll(() => testDb.stop());
test("rejects duplicate download idempotency keys for one editorial", async () => {
const seed = await testDb.seedEditorialWithUsage();
await testDb.insertDownload({ ...seed, idempotencyKey: "same-request" });
await expect(
testDb.insertDownload({ ...seed, idempotencyKey: "same-request" }),
).rejects.toThrow();
});