Skip to content

Commit

Permalink
Merge pull request #52 from nyaruka/remove_template_err_field
Browse files Browse the repository at this point in the history
Stop using msgs_msg.has_template_error which is now nullable
  • Loading branch information
nicpottier committed Oct 30, 2017
2 parents e92e890 + c2ed5f5 commit b2dc038
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions backends/rapidpro/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ func newMsg(direction MsgDirection, channel courier.Channel, urn urns.URN, text
}

const insertMsgSQL = `
INSERT INTO msgs_msg(org_id, direction, has_template_error, text, attachments, msg_count, error_count, high_priority, status,
INSERT INTO msgs_msg(org_id, direction, text, attachments, msg_count, error_count, high_priority, status,
visibility, external_id, channel_id, contact_id, contact_urn_id, created_on, modified_on, next_attempt, queued_on, sent_on)
VALUES(:org_id, :direction, FALSE, :text, :attachments, :msg_count, :error_count, :high_priority, :status,
VALUES(:org_id, :direction, :text, :attachments, :msg_count, :error_count, :high_priority, :status,
:visibility, :external_id, :channel_id, :contact_id, :contact_urn_id, :created_on, :modified_on, :next_attempt, :queued_on, :sent_on)
RETURNING id
`
Expand Down
1 change: 0 additions & 1 deletion backends/rapidpro/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ CREATE TABLE msgs_msg (
direction character varying(1) NOT NULL,
status character varying(1) NOT NULL,
visibility character varying(1) NOT NULL,
has_template_error boolean NOT NULL,
msg_type character varying(1),
msg_count integer NOT NULL,
error_count integer NOT NULL,
Expand Down
8 changes: 4 additions & 4 deletions backends/rapidpro/testdata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ INSERT INTO contacts_contacturn("id", "identity", "path", "scheme", "priority",
/** Msg with id 10,000 */
DELETE from msgs_msg;
INSERT INTO msgs_msg("id", "text", "high_priority", "created_on", "modified_on", "sent_on", "queued_on", "direction", "status", "visibility",
"has_template_error", "msg_count", "error_count", "next_attempt", "external_id", "channel_id", "contact_id", "contact_urn_id", "org_id")
"msg_count", "error_count", "next_attempt", "external_id", "channel_id", "contact_id", "contact_urn_id", "org_id")
VALUES(10000, 'test message', True, now(), now(), now(), now(), 'O', 'W', 'V',
False, 1, 0, now(), 'ext1', 10, 100, 1000, 1);
1, 0, now(), 'ext1', 10, 100, 1000, 1);

INSERT INTO msgs_msg("id", "text", "high_priority", "created_on", "modified_on", "sent_on", "queued_on", "direction", "status", "visibility",
"has_template_error", "msg_count", "error_count", "next_attempt", "external_id", "channel_id", "contact_id", "contact_urn_id", "org_id")
"msg_count", "error_count", "next_attempt", "external_id", "channel_id", "contact_id", "contact_urn_id", "org_id")
VALUES(10001, 'test message without external', True, now(), now(), now(), now(), 'O', 'W', 'V',
False, 1, 0, now(), 'ext1', 10, 100, 1000, 1);
1, 0, now(), 'ext1', 10, 100, 1000, 1);

0 comments on commit b2dc038

Please sign in to comment.