@hogsend/db 0.0.1 → 0.1.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.
@@ -64,6 +64,13 @@
64
64
  "when": 1780308366878,
65
65
  "tag": "0008_demonic_agent_brand",
66
66
  "breakpoints": true
67
+ },
68
+ {
69
+ "idx": 9,
70
+ "version": "7",
71
+ "when": 1780319468132,
72
+ "tag": "0009_productive_shadowcat",
73
+ "breakpoints": true
67
74
  }
68
75
  ]
69
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hogsend/db",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,6 +15,13 @@ export const contacts = pgTable(
15
15
  organizationId: text("organization_id"),
16
16
  externalId: text("external_id").notNull().unique(),
17
17
  email: text("email"),
18
+ /**
19
+ * Opportunistic IANA-timezone cache (e.g. "America/New_York"). Populated
20
+ * best-effort when a tz is resolved from PostHog person props. PostHog and
21
+ * `properties` jsonb remain authoritative sources — this column sits below
22
+ * them in the resolution precedence, so nothing is blocked on it.
23
+ */
24
+ timezone: text("timezone"),
18
25
  properties: jsonb("properties")
19
26
  .$type<Record<string, unknown>>()
20
27
  .default({}),
@@ -30,5 +30,11 @@ export const emailSends = pgTable(
30
30
  index("email_sends_status_idx").on(table.status),
31
31
  index("email_sends_created_at_idx").on(table.createdAt),
32
32
  index("email_sends_journey_state_id_idx").on(table.journeyStateId),
33
+ // Serves the frequency-cap COUNT (recipient + recency, optionally category).
34
+ index("email_sends_freq_cap_idx").on(
35
+ table.toEmail,
36
+ table.createdAt,
37
+ table.category,
38
+ ),
33
39
  ],
34
40
  );