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'
|
, 'delete'
|
||||||
, 'create'
|
, '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;
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user