Insert a logging record to the merged_server table after the merge is done.
authorAnt Zucaro <azucaro@gmail.com>
Fri, 25 Nov 2016 21:17:49 +0000 (16:17 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Fri, 25 Nov 2016 21:17:49 +0000 (16:17 -0500)
functions/merge_servers.sql

index 602c808..551d7cf 100644 (file)
@@ -39,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;