Skip to content

Commit

Permalink
fix(check_data): add current_user strategy and bug fix with audit_che…
Browse files Browse the repository at this point in the history
…ck_data.id
  • Loading branch information
mguzman14 committed Jan 20, 2025
1 parent c437171 commit 14f0319
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions utils/fct/gw_fct_check_fprocess.sql
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ BEGIN

IF v_process_except_table IS NULL THEN

INSERT INTO t_audit_check_data (fid, criticity, result_id, error_message, fcount)
INSERT INTO t_audit_check_data (fid, criticity, result_id, error_message, fcount, cur_user)
VALUES (v_function_fid, v_process_except_level, v_check_fid, concat(
CASE WHEN v_process_except_level = 2 THEN 'WARNING-' WHEN v_process_except_level = 3 THEN 'ERROR-' END,
v_check_fid, ': ', concat(v_text_aux, v_count, ' ', v_process_except_msg)), v_count);
v_check_fid, ': ', concat(v_text_aux, v_count, ' ', v_process_except_msg)), v_count, current_user);

ELSE
INSERT INTO t_audit_check_data (fid, criticity, result_id, error_message, fcount)
INSERT INTO t_audit_check_data (fid, criticity, result_id, error_message, fcount, cur_user)
VALUES (v_function_fid, v_process_except_level, v_check_fid, concat(
CASE WHEN v_process_except_level = 2 THEN 'WARNING-' WHEN v_process_except_level = 3 THEN 'ERROR-' END,
v_check_fid, ' (',v_process_except_table,'): ', concat(v_text_aux, v_count, ' ', v_process_except_msg)), v_count);
v_check_fid, ' (',v_process_except_table,'): ', concat(v_text_aux, v_count, ' ', v_process_except_msg)), v_count, current_user);

v_querytext = 'INSERT INTO t_'||v_process_except_table||' ('||v_exceptable_id||', '||v_exceptable_catalog||',
expl_id, fid, the_geom, descript) SELECT '||v_exceptable_id||', '||v_exceptable_catalog||',
Expand All @@ -115,8 +115,8 @@ BEGIN
END IF;

ELSE
INSERT INTO t_audit_check_data (fid, criticity, result_id, error_message, fcount)
VALUES (v_function_fid, 1, v_check_fid, concat('INFO: ', v_process_info_msg), 0);
INSERT INTO t_audit_check_data (fid, criticity, result_id, error_message, fcount, cur_user)
VALUES (v_function_fid, 1, v_check_fid, concat('INFO: ', v_process_info_msg), 0, current_user);

IF v_process_except_table IS NOT NULL THEN

Expand Down
2 changes: 2 additions & 0 deletions utils/fct/gw_fct_create_querytables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ BEGIN
DROP TABLE IF EXISTS t_audit_check_data; EXECUTE 'CREATE TEMP TABLE t_audit_check_data AS SELECT * FROM audit_check_data';
DROP TABLE IF EXISTS t_audit_check_project; EXECUTE 'CREATE TEMP TABLE t_audit_check_project AS SELECT * FROM audit_check_project';

ALTER TABLE t_audit_check_data ALTER COLUMN id SET DEFAULT nextval('SCHEMA_NAME.audit_check_data_id_seq'::regclass);


-- create anl tables
DROP TABLE IF EXISTS t_anl_node; EXECUTE 'CREATE TEMP TABLE t_anl_node AS SELECT * FROM anl_node WHERE cur_user = current_user';
Expand Down

0 comments on commit 14f0319

Please sign in to comment.