Skip to content

Commit 6a9e43c

Browse files
committed
Remove flows_flowstart_calls
1 parent 893be28 commit 6a9e43c

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

archives/runs.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,6 @@ func DeleteFlowStarts(ctx context.Context, rt *runtime.Runtime, now time.Time, o
283283
return fmt.Errorf("error deleting related groups for start: %d: %w", startID, err)
284284
}
285285

286-
// delete calls M2M
287-
_, err = tx.Exec(`DELETE from flows_flowstart_calls WHERE flowstart_id = $1`, startID)
288-
if err != nil {
289-
tx.Rollback()
290-
return fmt.Errorf("error deleting related calls for start: %d: %w", startID, err)
291-
}
292-
293286
// delete counts
294287
_, err = tx.Exec(`DELETE from flows_flowstartcount WHERE start_id = $1`, startID)
295288
if err != nil {

testdb.sql

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ CREATE TABLE msgs_msg (
153153
next_attempt timestamp with time zone NOT NULL,
154154
failed_reason character varying(1),
155155
external_id character varying(255),
156-
metadata text,
157156
log_uuids uuid[]
158157
);
159158

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

172-
CREATE TABLE ivr_call (
173-
id serial primary key,
174-
org_id integer NOT NULL REFERENCES orgs_org(id),
175-
created_on timestamp with time zone NOT NULL
176-
);
177-
178171
CREATE TABLE flows_flowstart (
179172
id serial primary key,
180173
org_id integer NOT NULL REFERENCES orgs_org(id),
@@ -193,12 +186,6 @@ CREATE TABLE flows_flowstart_groups (
193186
contactgroup_id integer NOT NULL REFERENCES contacts_contactgroup(id)
194187
);
195188

196-
CREATE TABLE flows_flowstart_calls (
197-
id serial primary key,
198-
flowstart_id integer NOT NULL REFERENCES flows_flowstart(id),
199-
call_id integer NOT NULL REFERENCES ivr_call(id)
200-
);
201-
202189
CREATE TABLE flows_flowrun (
203190
id serial primary key,
204191
uuid uuid NOT NULL UNIQUE,
@@ -321,9 +308,6 @@ INSERT INTO msgs_msg_labels(id, msg_id, label_id) VALUES
321308
INSERT INTO auth_user(id, username) VALUES
322309
(1, 'greg@gmail.com');
323310

324-
INSERT INTO ivr_call(id, org_id, created_on) VALUES
325-
(1, 2, NOW());
326-
327311
INSERT INTO flows_flowstart(id, org_id, created_on) VALUES
328312
(1, 2, NOW());
329313

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

336-
INSERT INTO flows_flowstart_calls(flowstart_id, call_id) VALUES
337-
(1, 1);
338-
339320
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
340321
(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),
341322
(2, '7d68469c-0494-498a-bdf3-bac68321fd6d', 2, TRUE, 6, 1,

0 commit comments

Comments
 (0)