Skip to content

Commit

Permalink
Merge pull request #149 from nyaruka/update_testdb
Browse files Browse the repository at this point in the history
Update test database
  • Loading branch information
rowanseymour authored Oct 5, 2023
2 parents f7b2dcf + f984e73 commit ebf5b1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions core/models/flows.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,10 @@ SELECT ROW_TO_JSON(r) FROM (
FROM
flows_flow f
INNER JOIN LATERAL (
SELECT
flow_id, spec_version, definition, revision
FROM
flows_flowrevision
WHERE
flow_id = f.id AND is_active = TRUE
ORDER BY
revision DESC
SELECT flow_id, spec_version, definition, revision
FROM flows_flowrevision
WHERE flow_id = f.id
ORDER BY revision DESC
LIMIT 1
) fr ON fr.flow_id = f.id
%s
Expand Down
Binary file modified mailroom_test.dump
Binary file not shown.
4 changes: 2 additions & 2 deletions testsuite/testdata/flows.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func InsertFlow(rt *runtime.Runtime, org *Org, definition []byte) *Flow {
VALUES($1, $2, $3, 'M', '13.1.0', 'eng', 10, FALSE, FALSE, TRUE, FALSE, FALSE, $4, NOW(), $4, NOW(), NOW(), $4) RETURNING id`, org.ID, uuid, name, Admin.ID,
))

rt.DB.MustExec(`INSERT INTO flows_flowrevision(flow_id, definition, spec_version, revision, is_active, created_by_id, created_on, modified_by_id, modified_on)
VALUES($1, $2, '13.1.0', 1, TRUE, $3, NOW(), $3, NOW())`, id, definition, Admin.ID)
rt.DB.MustExec(`INSERT INTO flows_flowrevision(flow_id, definition, spec_version, revision, created_by_id, created_on)
VALUES($1, $2, '13.1.0', 1, $3, NOW())`, id, definition, Admin.ID)

return &Flow{ID: id, UUID: assets.FlowUUID(uuid)}
}
Expand Down

0 comments on commit ebf5b1c

Please sign in to comment.