fix: formatting, remove unused audit table

This commit is contained in:
Orion Kindel 2023-06-10 00:20:33 -05:00
parent 737137439a
commit 94501b7331
Signed by untrusted user who does not match committer: orion
GPG Key ID: 6D4165AE4C928719
2 changed files with 6 additions and 27 deletions

View File

@ -3,8 +3,3 @@ create type public.audit_kind as enum
, 'delete'
, 'create'
);
create table public.audit
( id int not null primary key generated always as identity
, kind public.audit_kind not null
);

View File

@ -49,21 +49,10 @@ create function public.do_usr_audit()
end if;
insert into public.usr_audit
( kind
, usr
, actor
, prev_username
, prev_email
, prev_password
)
(kind, usr, actor, prev_username, prev_email, prev_password )
values
( audit_kind
, usr_id
, usr_id -- TODO
, prev_username
, prev_email
, prev_password
);
-- TODO actor
(audit_kind, usr_id, usr_id, prev_username, prev_email, prev_password );
return NEW;
end;
@ -76,15 +65,10 @@ create function public.do_usr_soft_delete()
audit_id int;
begin
insert into public.usr_audit
( kind
, usr
, actor
)
(kind, usr, actor)
values
( 'delete' :: public.audit_kind
, OLD.id
, OLD.id -- TODO
);
-- TODO actor
('delete' :: public.audit_kind, OLD.id, OLD.id);
update public.usr
set deleted = true