Skip to content

Commit

Permalink
Merge pull request #15 from rapidpro/has_template_error
Browse files Browse the repository at this point in the history
Stop using Msg.has_template_error
  • Loading branch information
rowanseymour authored Oct 29, 2017
2 parents 6e39d53 + 3c80221 commit de1bfe0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/rapidpro/mage/dao/MessageDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public interface MessageDao {
String getLastExternalId(@Bind("channelId") int channelId, @BindEnum("direction") Direction direction);

@SqlUpdate(
"INSERT INTO " + Table.MESSAGE + " (channel_id, contact_id, contact_urn_id, text, direction, status, org_id, created_on, queued_on, has_template_error, msg_type, msg_count, external_id, error_count, next_attempt, visibility) " +
"VALUES(:channelId, :contactId, :contactUrnId, :text, 'I', 'P', :orgId, :createdOn, :queuedOn, FALSE, NULL, 1, :externalId, 0, NOW(), 'V')"
"INSERT INTO " + Table.MESSAGE + " (channel_id, contact_id, contact_urn_id, text, direction, status, org_id, created_on, queued_on, msg_type, msg_count, external_id, error_count, next_attempt, visibility) " +
"VALUES(:channelId, :contactId, :contactUrnId, :text, 'I', 'P', :orgId, :createdOn, :queuedOn, NULL, 1, :externalId, 0, NOW(), 'V')"
)
@GetGeneratedKeys
int insertIncoming(@Bind("channelId") Integer channelId,
Expand Down
14 changes: 7 additions & 7 deletions src/test/resources/initial-dataset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ the table, and second identifies the item. This minimizes possible confusion of

<!-- Outgoing messages sent from Twilio channel with a broadcast -->
<msgs_broadcast id="-71" is_active="true" text="Testing" status="Q" org_id="-11" created_by_id="-2" created_on="2014-04-04 10:41:10.601" modified_by_id="-2" modified_on="2014-04-04 10:41:10.601" />
<msgs_msg id="-81" channel_id="-41" contact_id="-51" contact_urn_id="-61" org_id="-11" text="Testing" direction="O" status="W" broadcast_id="-71" external_id="SMS81" created_on="2014-01-22 23:25:01.836" sent_on="2014-01-22 23:25:02.181" has_template_error="false" msg_type="F" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-31" />
<msgs_msg id="-82" channel_id="-41" contact_id="-51" contact_urn_id="-61" org_id="-11" text="Testing" direction="O" status="S" broadcast_id="-71" external_id="SMS82" created_on="2014-01-22 23:26:01.836" sent_on="2014-01-22 23:26:02.181" has_template_error="false" msg_type="F" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-31" />
<msgs_msg id="-83" channel_id="-41" contact_id="-51" contact_urn_id="-61" org_id="-11" text="Testing" direction="O" status="D" broadcast_id="-71" external_id="SMS83" created_on="2014-01-22 23:27:01.836" sent_on="2014-01-22 23:27:02.181" modified_on="2014-01-22 23:37:09.335" has_template_error="false" msg_type="F" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-31" />
<msgs_msg id="-81" channel_id="-41" contact_id="-51" contact_urn_id="-61" org_id="-11" text="Testing" direction="O" status="W" broadcast_id="-71" external_id="SMS81" created_on="2014-01-22 23:25:01.836" sent_on="2014-01-22 23:25:02.181" msg_type="F" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-31" />
<msgs_msg id="-82" channel_id="-41" contact_id="-51" contact_urn_id="-61" org_id="-11" text="Testing" direction="O" status="S" broadcast_id="-71" external_id="SMS82" created_on="2014-01-22 23:26:01.836" sent_on="2014-01-22 23:26:02.181" msg_type="F" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-31" />
<msgs_msg id="-83" channel_id="-41" contact_id="-51" contact_urn_id="-61" org_id="-11" text="Testing" direction="O" status="D" broadcast_id="-71" external_id="SMS83" created_on="2014-01-22 23:27:01.836" sent_on="2014-01-22 23:27:02.181" modified_on="2014-01-22 23:37:09.335" msg_type="F" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-31" />

<!-- Outgoing messages sent from Vumi channel with a broadcast -->
<msgs_broadcast id="-72" is_active="true" text="Testing" status="Q" org_id="-12" created_by_id="-2" created_on="2014-04-04 10:41:10.601" modified_by_id="-2" modified_on="2014-04-04 10:41:10.601" />
<msgs_msg id="-84" channel_id="-45" contact_id="-51" contact_urn_id="-61" org_id="-12" text="Testing" direction="O" status="W" broadcast_id="-72" external_id="SMS84" created_on="2014-01-22 23:28:01.836" sent_on="2014-01-22 23:28:02.181" modified_on="2014-01-22 23:38:09.335" has_template_error="false" msg_type="F" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-33" />
<msgs_msg id="-85" channel_id="-45" contact_id="-51" contact_urn_id="-61" org_id="-12" text="Testing" direction="O" status="S" broadcast_id="-72" external_id="SMS85" created_on="2014-01-22 23:29:01.836" sent_on="2014-01-22 23:29:02.181" modified_on="2014-01-22 23:39:09.335" has_template_error="false" msg_type="F" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-33" />
<msgs_msg id="-84" channel_id="-45" contact_id="-51" contact_urn_id="-61" org_id="-12" text="Testing" direction="O" status="W" broadcast_id="-72" external_id="SMS84" created_on="2014-01-22 23:28:01.836" sent_on="2014-01-22 23:28:02.181" modified_on="2014-01-22 23:38:09.335" msg_type="F" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-33" />
<msgs_msg id="-85" channel_id="-45" contact_id="-51" contact_urn_id="-61" org_id="-12" text="Testing" direction="O" status="S" broadcast_id="-72" external_id="SMS85" created_on="2014-01-22 23:29:01.836" sent_on="2014-01-22 23:29:02.181" modified_on="2014-01-22 23:39:09.335" msg_type="F" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-33" />

<!-- Incoming SMSs received on Vumi -->
<msgs_msg id="-86" channel_id="-45" contact_id="-51" contact_urn_id="-61" org_id="-12" text="Testing in" direction="I" status="P" external_id="SMS86" created_on="2014-01-22 23:25:01.836" sent_on="2014-01-22 23:25:02.181" modified_on="2014-01-22 23:25:09.335" has_template_error="false" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-33" />-->
<msgs_msg id="-87" channel_id="-45" contact_id="-51" contact_urn_id="-61" org_id="-12" text="Testing again" direction="I" status="P" external_id="SMS87" created_on="2014-01-22 23:25:01.836" sent_on="2014-01-22 23:25:02.181" modified_on="2014-01-22 23:25:09.335" has_template_error="false" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-33" />-->
<msgs_msg id="-86" channel_id="-45" contact_id="-51" contact_urn_id="-61" org_id="-12" text="Testing in" direction="I" status="P" external_id="SMS86" created_on="2014-01-22 23:25:01.836" sent_on="2014-01-22 23:25:02.181" modified_on="2014-01-22 23:25:09.335" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-33" />-->
<msgs_msg id="-87" channel_id="-45" contact_id="-51" contact_urn_id="-61" org_id="-12" text="Testing again" direction="I" status="P" external_id="SMS87" created_on="2014-01-22 23:25:01.836" sent_on="2014-01-22 23:25:02.181" modified_on="2014-01-22 23:25:09.335" msg_count="1" error_count="0" next_attempt="2014-01-22 23:25:02.15" visibility="V" topup_id="-33" />-->

</dataset>
1 change: 0 additions & 1 deletion testdb/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ CREATE TABLE msgs_msg (
created_on timestamp with time zone NOT NULL,
sent_on timestamp with time zone,
modified_on timestamp with time zone,
has_template_error boolean NOT NULL,
msg_type character varying(1),
msg_count integer NOT NULL,
external_id character varying(255),
Expand Down

0 comments on commit de1bfe0

Please sign in to comment.