Channel
Subscription channels and contact enrollments.
Source: packages/db/src/schema/channel.ts
Enums
| Enum | Values |
|---|---|
visibility | private, public |
enrollment_status | enrolled, unenrolled |
default_subscription | opt_in, opt_out |
channel
| Column | Type | Notes |
|---|---|---|
id | text | PK, prefix chn_ |
name | varchar(255) | NOT NULL |
description | text | |
organization_id | text | FK → organization.id, CASCADE |
visibility | visibility | default private |
default_subscription | default_subscription | default opt_in |
user_id | text | FK → user.id, CASCADE |
created_at | timestamp | |
updated_at | timestamp | |
deleted_at | timestamp |
channel_subscription
| Column | Type | Notes |
|---|---|---|
id | text | PK, prefix sub_ |
contact_id | text | FK → contact.id, CASCADE |
channel_id | text | FK → channel.id, CASCADE |
organization_id | text | FK → organization.id, CASCADE |
status | enrollment_status | default enrolled |
created_at | timestamp | |
updated_at | timestamp | |
deleted_at | timestamp |
Unique: (contact_id, channel_id)
Was this page helpful?