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 msgs_msg.is_android #759

Merged
merged 1 commit into from
Jul 10, 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/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
1 change: 1 addition & 0 deletions backends/rapidpro/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions backends/rapidpro/testdata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading