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