fix: formatting, remove unused audit table
This commit is contained in:
parent
737137439a
commit
94501b7331
@ -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
|
||||
);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user