|
| 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