From 2e6180a6f216752b97c6401ab24a38547ee47db7 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Wed, 10 Jul 2024 09:41:12 -0500 Subject: [PATCH] Start writing msgs_msg.is_android --- backends/rapidpro/msg.go | 4 ++-- backends/rapidpro/schema.sql | 1 + backends/rapidpro/testdata.sql | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/backends/rapidpro/msg.go b/backends/rapidpro/msg.go index 3b9d2b5c8..f46cc2302 100644 --- a/backends/rapidpro/msg.go +++ b/backends/rapidpro/msg.go @@ -245,9 +245,9 @@ func writeMsg(ctx context.Context, b *backend, msg courier.MsgIn, clog *courier. const sqlInsertMsg = ` INSERT INTO - msgs_msg(org_id, uuid, direction, text, attachments, msg_type, msg_count, error_count, high_priority, status, + msgs_msg(org_id, uuid, direction, text, attachments, msg_type, msg_count, error_count, high_priority, status, is_android, visibility, external_id, channel_id, contact_id, contact_urn_id, created_on, modified_on, next_attempt, sent_on, log_uuids) - VALUES(:org_id, :uuid, :direction, :text, :attachments, 'T', :msg_count, :error_count, :high_priority, :status, + VALUES(:org_id, :uuid, :direction, :text, :attachments, 'T', :msg_count, :error_count, :high_priority, :status, FALSE, :visibility, :external_id, :channel_id, :contact_id, :contact_urn_id, :created_on, :modified_on, :next_attempt, :sent_on, :log_uuids) RETURNING id` diff --git a/backends/rapidpro/schema.sql b/backends/rapidpro/schema.sql index c5b75968f..e151d1f15 100644 --- a/backends/rapidpro/schema.sql +++ b/backends/rapidpro/schema.sql @@ -88,6 +88,7 @@ CREATE TABLE msgs_msg ( direction character varying(1) NOT NULL, status character varying(1) NOT NULL, visibility character varying(1) NOT NULL, + is_android boolean NOT NULL, msg_count integer NOT NULL, high_priority boolean NULL, error_count integer NOT NULL, diff --git a/backends/rapidpro/testdata.sql b/backends/rapidpro/testdata.sql index 217a4bf6b..7a769d374 100644 --- a/backends/rapidpro/testdata.sql +++ b/backends/rapidpro/testdata.sql @@ -44,19 +44,19 @@ INSERT INTO msgs_optin(id, uuid, org_id, name) VALUES /** Msg with id 10000 */ DELETE FROM msgs_msg; -INSERT INTO msgs_msg("id", "uuid", "text", "high_priority", "created_on", "modified_on", "sent_on", "direction", "status", "visibility", "msg_type", +INSERT INTO msgs_msg("id", "uuid", "text", "high_priority", "created_on", "modified_on", "sent_on", "direction", "status", "visibility", "msg_type", "is_android", "msg_count", "error_count", "next_attempt", "external_id", "channel_id", "contact_id", "contact_urn_id", "org_id") - VALUES(10000, 'b10fff91-4ff6-46d4-b237-caed786e09d3', 'test message', True, now(), now(), now(), 'O', 'W', 'V', 'T', + VALUES(10000, 'b10fff91-4ff6-46d4-b237-caed786e09d3', 'test message', True, now(), now(), now(), 'O', 'W', 'V', 'T', FALSE, 1, 0, now(), 'ext1', 10, 100, 1000, 1); -INSERT INTO msgs_msg("id", "uuid", "text", "high_priority", "created_on", "modified_on", "sent_on", "direction", "status", "visibility", "msg_type", +INSERT INTO msgs_msg("id", "uuid", "text", "high_priority", "created_on", "modified_on", "sent_on", "direction", "status", "visibility", "msg_type", "is_android", "msg_count", "error_count", "next_attempt", "external_id", "channel_id", "contact_id", "contact_urn_id", "org_id") - VALUES(10001, '452adaa9-1e4d-4ff3-a3c6-d3867ff2adfb', 'test message without external', True, now(), now(), now(), 'O', 'W', 'V', 'T', + VALUES(10001, '452adaa9-1e4d-4ff3-a3c6-d3867ff2adfb', 'test message without external', True, now(), now(), now(), 'O', 'W', 'V', 'T', FALSE, 1, 0, now(), '', 10, 100, 1000, 1); -INSERT INTO msgs_msg("id", "uuid", "text", "high_priority", "created_on", "modified_on", "sent_on", "direction", "status", "visibility", "msg_type", +INSERT INTO msgs_msg("id", "uuid", "text", "high_priority", "created_on", "modified_on", "sent_on", "direction", "status", "visibility", "msg_type", "is_android", "msg_count", "error_count", "next_attempt", "external_id", "channel_id", "contact_id", "contact_urn_id", "org_id") - VALUES(10002, '0ee51bf5-b285-4c39-95d6-c85d18b23f1e', 'test message incoming', True, now(), now(), now(), 'I', 'P', 'V', 'T', + VALUES(10002, '0ee51bf5-b285-4c39-95d6-c85d18b23f1e', 'test message incoming', True, now(), now(), now(), 'I', 'P', 'V', 'T', FALSE, 1, 0, now(), 'ext2', 10, 100, 1000, 1); INSERT INTO msgs_media("id", "uuid", "org_id", "content_type", "url", "path", "size", "duration", "width", "height", "original_id")