diff --git a/core/models/flows.go b/core/models/flows.go index 087a6ff12..fbe3045e7 100644 --- a/core/models/flows.go +++ b/core/models/flows.go @@ -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 diff --git a/mailroom_test.dump b/mailroom_test.dump index 358a3ea90..9a5be93d2 100644 Binary files a/mailroom_test.dump and b/mailroom_test.dump differ diff --git a/testsuite/testdata/flows.go b/testsuite/testdata/flows.go index cab77fe53..dc7bec7ec 100644 --- a/testsuite/testdata/flows.go +++ b/testsuite/testdata/flows.go @@ -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)} }