feat: simplify mails and add reminders

This commit is contained in:
2026-03-11 13:39:27 +01:00
parent 0c8e827cda
commit 5e5efcaf6f
5 changed files with 535 additions and 491 deletions

View File

@@ -0,0 +1,2 @@
-- Add sent_24h_at column to track whether the 24-hour-before reminder was sent
ALTER TABLE `reminder` ADD `sent_24h_at` integer;

View File

@@ -6,6 +6,9 @@ export const reminder = sqliteTable(
{
id: text("id").primaryKey(), // UUID
email: text("email").notNull(),
/** Set when the 24-hours-before reminder has been sent. */
sent24hAt: integer("sent_24h_at", { mode: "timestamp_ms" }),
/** Set when the 1-hour-before reminder has been sent. */
sentAt: integer("sent_at", { mode: "timestamp_ms" }),
createdAt: integer("created_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)