#!/bin/sh
export PGPASSWORD=PYnuOIXNbkVOvdTL
P="psql -h 127.0.0.1 -U bgar1_delta_com -d bgar1_delta_com_ingredi -tA"
echo "== hashes"
$P -c "select count(*) from users where password is not null and password <> ''"
$P -c "select count(*) from users"
echo "== type distribution"
$P -c "select type, count(*) from users group by 1 order by 2 desc"
echo "== admins with hash"
$P -c "select id||' | '||username||' | '||coalesce(email_address,'')||' | '||coalesce(private_display_name,'') from users where perm_admin and password is not null limit 40"
echo "== history"
$P -c "select count(*) from user_password_history"
