Skip to content

Commit 13c8509

Browse files
committed
Stop writing Msg.queued_on
1 parent 29098b1 commit 13c8509

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

Diff for: backends/rapidpro/backend_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,6 @@ func (ts *BackendTestSuite) TestWriteMsg() {
11351135
ts.NotNil(m.NextAttempt_)
11361136
ts.NotNil(m.CreatedOn_)
11371137
ts.NotNil(m.ModifiedOn_)
1138-
ts.NotNil(m.QueuedOn_)
11391138

11401139
contact, err := contactForURN(ctx, ts.b, m.OrgID_, knChannel, urn, nil, "", clog)
11411140
ts.NoError(err)
@@ -1532,7 +1531,6 @@ SELECT
15321531
created_on,
15331532
modified_on,
15341533
next_attempt,
1535-
queued_on,
15361534
sent_on,
15371535
log_uuids
15381536
FROM

Diff for: backends/rapidpro/msg.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ type Msg struct {
7272
NextAttempt_ time.Time ` db:"next_attempt"`
7373
CreatedOn_ time.Time `json:"created_on" db:"created_on"`
7474
ModifiedOn_ time.Time ` db:"modified_on"`
75-
QueuedOn_ time.Time ` db:"queued_on"`
7675
SentOn_ *time.Time ` db:"sent_on"`
7776
LogUUIDs pq.StringArray ` db:"log_uuids"`
7877

@@ -125,7 +124,6 @@ func newMsg(direction MsgDirection, channel courier.Channel, urn urns.URN, text
125124
NextAttempt_: now,
126125
CreatedOn_: now,
127126
ModifiedOn_: now,
128-
QueuedOn_: now,
129127
LogUUIDs: []string{string(clog.UUID())},
130128

131129
channel: dbChannel,
@@ -247,9 +245,9 @@ func writeMsg(ctx context.Context, b *backend, msg courier.MsgIn, clog *courier.
247245
const sqlInsertMsg = `
248246
INSERT INTO
249247
msgs_msg(org_id, uuid, direction, text, attachments, msg_type, msg_count, error_count, high_priority, status,
250-
visibility, external_id, channel_id, contact_id, contact_urn_id, created_on, modified_on, next_attempt, queued_on, sent_on, log_uuids)
248+
visibility, external_id, channel_id, contact_id, contact_urn_id, created_on, modified_on, next_attempt, sent_on, log_uuids)
251249
VALUES(:org_id, :uuid, :direction, :text, :attachments, 'T', :msg_count, :error_count, :high_priority, :status,
252-
:visibility, :external_id, :channel_id, :contact_id, :contact_urn_id, :created_on, :modified_on, :next_attempt, :queued_on, :sent_on, :log_uuids)
250+
:visibility, :external_id, :channel_id, :contact_id, :contact_urn_id, :created_on, :modified_on, :next_attempt, :sent_on, :log_uuids)
253251
RETURNING id`
254252

255253
func writeMsgToDB(ctx context.Context, b *backend, m *Msg, clog *courier.ChannelLog) error {

Diff for: backends/rapidpro/schema.sql

-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ CREATE TABLE msgs_msg (
7676
created_on timestamp with time zone NOT NULL,
7777
modified_on timestamp with time zone,
7878
sent_on timestamp with time zone,
79-
queued_on timestamp with time zone,
8079
direction character varying(1) NOT NULL,
8180
status character varying(1) NOT NULL,
8281
visibility character varying(1) NOT NULL,

Diff for: backends/rapidpro/testdata.sql

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ INSERT INTO msgs_optin(id, uuid, org_id, name) VALUES
4444

4545
/** Msg with id 10000 */
4646
DELETE FROM msgs_msg;
47-
INSERT INTO msgs_msg("id", "text", "high_priority", "created_on", "modified_on", "sent_on", "queued_on", "direction", "status", "visibility", "msg_type",
47+
INSERT INTO msgs_msg("id", "text", "high_priority", "created_on", "modified_on", "sent_on", "direction", "status", "visibility", "msg_type",
4848
"msg_count", "error_count", "next_attempt", "external_id", "channel_id", "contact_id", "contact_urn_id", "org_id")
49-
VALUES(10000, 'test message', True, now(), now(), now(), now(), 'O', 'W', 'V', 'T',
49+
VALUES(10000, 'test message', True, now(), now(), now(), 'O', 'W', 'V', 'T',
5050
1, 0, now(), 'ext1', 10, 100, 1000, 1);
5151

52-
INSERT INTO msgs_msg("id", "text", "high_priority", "created_on", "modified_on", "sent_on", "queued_on", "direction", "status", "visibility", "msg_type",
52+
INSERT INTO msgs_msg("id", "text", "high_priority", "created_on", "modified_on", "sent_on", "direction", "status", "visibility", "msg_type",
5353
"msg_count", "error_count", "next_attempt", "external_id", "channel_id", "contact_id", "contact_urn_id", "org_id")
54-
VALUES(10001, 'test message without external', True, now(), now(), now(), now(), 'O', 'W', 'V', 'T',
54+
VALUES(10001, 'test message without external', True, now(), now(), now(), 'O', 'W', 'V', 'T',
5555
1, 0, now(), '', 10, 100, 1000, 1);
5656

57-
INSERT INTO msgs_msg("id", "text", "high_priority", "created_on", "modified_on", "sent_on", "queued_on", "direction", "status", "visibility", "msg_type",
57+
INSERT INTO msgs_msg("id", "text", "high_priority", "created_on", "modified_on", "sent_on", "direction", "status", "visibility", "msg_type",
5858
"msg_count", "error_count", "next_attempt", "external_id", "channel_id", "contact_id", "contact_urn_id", "org_id")
59-
VALUES(10002, 'test message incoming', True, now(), now(), now(), now(), 'I', 'P', 'V', 'T',
59+
VALUES(10002, 'test message incoming', True, now(), now(), now(), 'I', 'P', 'V', 'T',
6060
1, 0, now(), 'ext2', 10, 100, 1000, 1);
6161

6262
INSERT INTO msgs_media("id", "uuid", "org_id", "content_type", "url", "path", "size", "duration", "width", "height", "original_id")

0 commit comments

Comments
 (0)