diff --git a/backends/rapidpro/channel_event.go b/backends/rapidpro/channel_event.go index 3e86a8b58..17d6aa009 100644 --- a/backends/rapidpro/channel_event.go +++ b/backends/rapidpro/channel_event.go @@ -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 diff --git a/backends/rapidpro/schema.sql b/backends/rapidpro/schema.sql index 857260fe3..8b1eddaf6 100644 --- a/backends/rapidpro/schema.sql +++ b/backends/rapidpro/schema.sql @@ -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,