-- Run as database owner after creating and confirming the Auth email account. -- Set the supplied password in Authentication / Users. Never put it in frontend code. begin; do $$ begin if not exists(select 1 from auth.users where lower(email)='tutul@sbut.com' and email_confirmed_at is not null) then raise exception 'Create confirmed Auth email account tutul@sbut.com first';end if; end $$; insert into wallet_private.admins(user_id,login_id,kind) select id,'FOUNDER-TUTUL','founder' from auth.users where lower(email)='tutul@sbut.com' and email_confirmed_at is not null and not exists(select 1 from wallet_private.admins where kind='founder') on conflict do nothing; commit;