X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=functions%2Fmerge_servers.sql;h=551d7cfed9d5dff136b3cba5a38a5e9b2fab0320;hb=d87c5b9096c77b597f837d3b5109c168b2645649;hp=f929064fe58ed21809488d0ec99f433b14d88e3f;hpb=3be91bb320695ba24d6488cf6fb9ddde4853f030;p=xonotic%2Fxonstatdb.git diff --git a/functions/merge_servers.sql b/functions/merge_servers.sql index f929064..551d7cf 100644 --- a/functions/merge_servers.sql +++ b/functions/merge_servers.sql @@ -17,19 +17,11 @@ begin raise exception 'Both servers have hashkeys and they are different! Not merging.'; end if; - -- fill in the "important" missing attributes - if w_server.ip_addr is null and l_server.ip_addr is not null then - w_server.ip_addr := l_server.ip_addr; - end if; - + -- fill in the hashkey (everything else will be handled by xonstat) if w_server.hashkey is null and l_server.hashkey is not null then w_server.hashkey := l_server.hashkey; end if; - if w_server.revision is null and l_server.revision is not null then - w_server.revision := l_server.revsion; - end if; - -- games get moved to the new server update games set server_id = p_winner_server_id where server_id = p_loser_server_id; @@ -47,6 +39,8 @@ begin update servers set active_ind = false where server_id = p_loser_server_id; raise notice 'Server #% deactivated.', p_loser_server_id; + + insert into merged_servers(winning_server_id, losing_server_id) values(p_winner_server_id, p_loser_server_id); end; $$ language plpgsql;