Skip to content

Commit

Permalink
Set org id on flow starts
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Apr 10, 2020
1 parent 0ca4353 commit 1b2e94f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions models/starts.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ func InsertFlowStarts(ctx context.Context, db Queryer, starts []*FlowStart) erro

const insertStartSQL = `
INSERT INTO
flows_flowstart(uuid, created_on, modified_on, restart_participants, include_active, query, status, flow_id, extra, parent_summary)
VALUES(:uuid, NOW(), NOW(), :restart_participants, :include_active, :query, 'P' , :flow_id, :extra, :parent_summary)
flows_flowstart(uuid, org_id, created_on, modified_on, restart_participants, include_active, query, status, flow_id, extra, parent_summary)
VALUES(:uuid, :org_id, NOW(), NOW(), :restart_participants, :include_active, :query, 'P', :flow_id, :extra, :parent_summary)
RETURNING
id
`
Expand Down
4 changes: 2 additions & 2 deletions runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ func TestBatchStart(t *testing.T) {

// create a start object
db.MustExec(
`INSERT INTO flows_flowstart(created_on, modified_on, uuid, restart_participants, include_active, contact_count, status, flow_id, created_by_id)
VALUES(NOW(), NOW(), $1, TRUE, TRUE, 2, 'P', $2, 1)`, uuids.New(), models.SingleMessageFlowID)
`INSERT INTO flows_flowstart(uuid, org_id, flow_id, created_on, modified_on, restart_participants, include_active, contact_count, status, created_by_id)
VALUES($1, $2, $3, NOW(), NOW(), TRUE, TRUE, 2, 'P', 1)`, uuids.New(), models.Org1, models.SingleMessageFlowID)

// and our batch object
contactIDs := []models.ContactID{models.CathyID, models.BobID}
Expand Down

0 comments on commit 1b2e94f

Please sign in to comment.