Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start writing status field on channel events as P #725

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backends/rapidpro/channel_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ func writeChannelEvent(ctx context.Context, b *backend, event courier.ChannelEve

const sqlInsertChannelEvent = `
INSERT INTO
channels_channelevent( org_id, channel_id, contact_id, contact_urn_id, event_type, optin_id, extra, occurred_on, created_on, log_uuids)
VALUES(:org_id, :channel_id, :contact_id, :contact_urn_id, :event_type, :optin_id, :extra, :occurred_on, NOW(), :log_uuids)
channels_channelevent( org_id, channel_id, contact_id, contact_urn_id, event_type, optin_id, extra, occurred_on, created_on, status, log_uuids)
VALUES(:org_id, :channel_id, :contact_id, :contact_urn_id, :event_type, :optin_id, :extra, :occurred_on, NOW(), 'P', :log_uuids)
RETURNING id, created_on`

// writeChannelEventToDB writes the passed in channel event to our db
Expand Down
1 change: 1 addition & 0 deletions backends/rapidpro/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ DROP TABLE IF EXISTS channels_channelevent CASCADE;
CREATE TABLE channels_channelevent (
id serial primary key,
event_type character varying(16) NOT NULL,
status character varying(1) NOT NULL,
extra text,
occurred_on timestamp with time zone NOT NULL,
created_on timestamp with time zone NOT NULL,
Expand Down
Loading