fix: harden usage accounting idempotency

This commit is contained in:
Leon Tonhäuser committed 2026-08-10 10:59:12 +02:00
1 parent 22fe6bf659
commit 3de1530074
14 files changed
+708 -107

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
import { index, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
import { index, pgTable, timestamp, uuid } from "drizzle-orm/pg-core";
import { users } from "./auth";
import { editorialAccounts } from "./editorials";
@@ -10,7 +10,7 @@ export const albumGrants = pgTable(
editorialAccountId: uuid("editorial_account_id")
.notNull()
.references(() => editorialAccounts.id, { onDelete: "restrict" }),
immichAlbumId: text("immich_album_id").notNull(),
immichAlbumId: uuid("immich_album_id").notNull(),
grantedAt: timestamp("granted_at", { withTimezone: true }).notNull().defaultNow(),
revokedAt: timestamp("revoked_at", { withTimezone: true }),
grantedByUserId: uuid("granted_by_user_id").references(() => users.id, {