@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.
package/package.json
CHANGED
package/src/schema/contacts.ts
CHANGED
|
@@ -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
|
);
|