@hogsend/db 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -141,6 +141,13 @@
141
141
  "when": 1780907482971,
142
142
  "tag": "0019_flippant_songbird",
143
143
  "breakpoints": true
144
+ },
145
+ {
146
+ "idx": 20,
147
+ "version": "7",
148
+ "when": 1780932858220,
149
+ "tag": "0020_colossal_vengeance",
150
+ "breakpoints": true
144
151
  }
145
152
  ]
146
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hogsend/db",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/demo-seed.ts CHANGED
@@ -542,7 +542,7 @@ function buildSend(opts: {
542
542
  complainedAt,
543
543
  bounceType,
544
544
  bounceReason,
545
- resendId:
545
+ messageId:
546
546
  status === "queued"
547
547
  ? null
548
548
  : `re_${Math.floor(rand() * 1e16).toString(36)}`,
@@ -22,7 +22,7 @@ export const emailSends = pgTable(
22
22
  userId: text("user_id"),
23
23
  userEmail: text("user_email"),
24
24
  templateKey: text("template_key"),
25
- resendId: text("resend_id"),
25
+ messageId: text("message_id"),
26
26
  fromEmail: text("from_email").notNull(),
27
27
  toEmail: text("to_email").notNull(),
28
28
  subject: text("subject").notNull(),
@@ -51,6 +51,9 @@ export const emailSends = pgTable(
51
51
  index("email_sends_created_at_idx").on(table.createdAt),
52
52
  index("email_sends_journey_state_id_idx").on(table.journeyStateId),
53
53
  index("email_sends_user_id_idx").on(table.userId),
54
+ // Serves the provider-webhook by-message resolver
55
+ // (resolveEmailSendContextByMessageId) — previously a seq-scan.
56
+ index("email_sends_message_id_idx").on(table.messageId),
54
57
  // Serves the frequency-cap COUNT (recipient + recency, optionally category).
55
58
  index("email_sends_freq_cap_idx").on(
56
59
  table.toEmail,