Skip to content

Commit

Permalink
Merge pull request #725 from nyaruka/event_status
Browse files Browse the repository at this point in the history
Start writing status field on channel events as P
  • Loading branch information
rowanseymour authored Apr 2, 2024
2 parents 746618b + 4b3d7fe commit 48dd9e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit 48dd9e5

Please sign in to comment.