From 94501b7331ec722a53bc5beb91cf8b4b0945d39a Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Sat, 10 Jun 2023 00:20:33 -0500 Subject: [PATCH] fix: formatting, remove unused audit table --- schema/010_audit.sql | 5 ----- schema/010_user.sql | 28 ++++++---------------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/schema/010_audit.sql b/schema/010_audit.sql index aea10f1..35c5239 100644 --- a/schema/010_audit.sql +++ b/schema/010_audit.sql @@ -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 - ); diff --git a/schema/010_user.sql b/schema/010_user.sql index be4e11c..ebb9ff0 100644 --- a/schema/010_user.sql +++ b/schema/010_user.sql @@ -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