Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(database): add dedupKey column and unique index to notifications

Richie McIlroy93a7d14b0ec5
diff --git a/packages/database/schema.ts b/packages/database/schema.ts
index 9d0d24455..902a2345d 100644
--- a/packages/database/schema.ts
+++ b/packages/database/schema.ts
@@ -446,6 +446,7 @@ export const notifications = mysqlTable(
location?: string | null;
}>()
.notNull(),
+ dedupKey: varchar("dedupKey", { length: 128 }),
readAt: timestamp("readAt"),
createdAt: timestamp("createdAt").notNull().defaultNow(),
},
@@ -462,6 +463,7 @@ export const notifications = mysqlTable(
table.recipientId,
table.createdAt,
),
+ dedupKeyUnique: uniqueIndex("dedup_key_idx").on(table.dedupKey),
}),
);