Skip to content

Commit 62807f7

Browse files
committed
bug: fix missing clone options
1 parent cde4e55 commit 62807f7

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
CREATE OR REPLACE FUNCTION clone_match_options(
2+
_match_options_id uuid
3+
)
4+
RETURNS uuid AS $$
5+
DECLARE
6+
cloned_id uuid;
7+
BEGIN
8+
IF _match_options_id IS NULL THEN
9+
RETURN NULL;
10+
END IF;
11+
12+
INSERT INTO match_options (
13+
overtime, knife_round, mr, best_of, coaches, number_of_substitutes,
14+
map_veto, timeout_setting, tech_timeout_setting, map_pool_id, type,
15+
regions, prefer_dedicated_server, invite_code, lobby_access,
16+
region_veto, ready_setting, check_in_setting, default_models, tv_delay,
17+
auto_cancellation, match_mode, auto_cancel_duration, live_match_timeout
18+
)
19+
SELECT
20+
overtime, knife_round, mr, best_of, coaches, number_of_substitutes,
21+
map_veto, timeout_setting, tech_timeout_setting, map_pool_id, type,
22+
regions, prefer_dedicated_server, invite_code, lobby_access,
23+
region_veto, ready_setting, check_in_setting, default_models, tv_delay,
24+
auto_cancellation, match_mode, auto_cancel_duration, live_match_timeout
25+
FROM match_options
26+
WHERE id = _match_options_id
27+
RETURNING id INTO cloned_id;
28+
29+
RETURN cloned_id;
30+
END;
31+
$$ LANGUAGE plpgsql;

0 commit comments

Comments
 (0)