Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions archives/runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,6 @@ func DeleteFlowStarts(ctx context.Context, rt *runtime.Runtime, now time.Time, o
return fmt.Errorf("error deleting related groups for start: %d: %w", startID, err)
}

// delete calls M2M
_, err = tx.Exec(`DELETE from flows_flowstart_calls WHERE flowstart_id = $1`, startID)
if err != nil {
tx.Rollback()
return fmt.Errorf("error deleting related calls for start: %d: %w", startID, err)
}

// delete counts
_, err = tx.Exec(`DELETE from flows_flowstartcount WHERE start_id = $1`, startID)
if err != nil {
Expand Down
19 changes: 0 additions & 19 deletions testdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ CREATE TABLE msgs_msg (
next_attempt timestamp with time zone NOT NULL,
failed_reason character varying(1),
external_id character varying(255),
metadata text,
log_uuids uuid[]
);

Expand All @@ -169,12 +168,6 @@ CREATE TABLE msgs_msg_labels (
label_id integer NOT NULL REFERENCES msgs_label(id)
);

CREATE TABLE ivr_call (
id serial primary key,
org_id integer NOT NULL REFERENCES orgs_org(id),
created_on timestamp with time zone NOT NULL
);

CREATE TABLE flows_flowstart (
id serial primary key,
org_id integer NOT NULL REFERENCES orgs_org(id),
Expand All @@ -193,12 +186,6 @@ CREATE TABLE flows_flowstart_groups (
contactgroup_id integer NOT NULL REFERENCES contacts_contactgroup(id)
);

CREATE TABLE flows_flowstart_calls (
id serial primary key,
flowstart_id integer NOT NULL REFERENCES flows_flowstart(id),
call_id integer NOT NULL REFERENCES ivr_call(id)
);

CREATE TABLE flows_flowrun (
id serial primary key,
uuid uuid NOT NULL UNIQUE,
Expand Down Expand Up @@ -321,9 +308,6 @@ INSERT INTO msgs_msg_labels(id, msg_id, label_id) VALUES
INSERT INTO auth_user(id, username) VALUES
(1, 'greg@gmail.com');

INSERT INTO ivr_call(id, org_id, created_on) VALUES
(1, 2, NOW());

INSERT INTO flows_flowstart(id, org_id, created_on) VALUES
(1, 2, NOW());

Expand All @@ -333,9 +317,6 @@ INSERT INTO flows_flowstart_contacts(flowstart_id, contact_id) VALUES
INSERT INTO flows_flowstart_groups(flowstart_id, contactgroup_id) VALUES
(1, 1);

INSERT INTO flows_flowstart_calls(flowstart_id, call_id) VALUES
(1, 1);

INSERT INTO flows_flowrun(id, uuid, org_id, responded, contact_id, flow_id, results, path, path_nodes, path_times, created_on, modified_on, exited_on, status, start_id) VALUES
(1, '4ced1260-9cfe-4b7f-81dd-b637108f15b9', 2, TRUE, 6, 1, '{}', '[]', NULL, NULL, '2017-08-12 21:11:59.890662+02:00','2017-08-12 21:11:59.890662+02:00','2017-08-12 21:11:59.890662+02:00', 'C', 1),
(2, '7d68469c-0494-498a-bdf3-bac68321fd6d', 2, TRUE, 6, 1,
Expand Down