Skip to content

Instantly share code, notes, and snippets.

DELIMITER $$
CREATE PROCEDURE sp_mass_payee_update (IN id_list JSON)
z_proc:BEGIN
DECLARE cur_id BIGINT UNSIGNED;
DECLARE done INT DEFAULT 0;
DECLARE cur CURSOR FOR
SELECT p.id, p.xpayer_id, p.zfsp_id
FROM JSON_TABLE(id_list, '$[*]' COLUMNS (id BIGINT UNSIGNED PATH '$')) AS j
JOIN xpayee p ON p.id = j.id
WHERE p.payee_status = 'active'
[alias]
gone = ! "git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs git branch -D"