Upgrade SQL

This commit is contained in:
sparkyx 2024-02-18 13:24:19 +01:00
parent 2942abefae
commit 910ae8b9f2
4 changed files with 36 additions and 38 deletions

View file

@ -123,7 +123,7 @@ if (!defined("NOALYSS_PACKAGE_REPOSITORY")) {
if (!defined("SYSINFO_DISPLAY")) {
define("SYSINFO_DISPLAY", TRUE);
}
define("DBVERSION", 194);
define("DBVERSION", 195);
define("MONO_DATABASE", 25);
define("DBVERSIONREPO", 20);
define('NOTFOUND', '--not found--');

View file

@ -0,0 +1,35 @@
begin;
CREATE OR REPLACE FUNCTION comptaproc.trg_remove_script_tag()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
begin
NEW.agc_comment_raw:= regexp_replace(NEW.agc_comment_raw, '<script', 'scritp', 'i');
return NEW;
end;
$function$;
create trigger t_remove_script_tag before
insert
or
update
on
public.action_gestion_comment for each row execute function comptaproc.trg_remove_script_tag();
INSERT INTO public.menu_ref (me_code,me_menu,me_file,me_url,me_description,me_parameter,me_javascript,me_type,me_description_etendue) VALUES
('PDF:card','export Fiche détail PDF','export_card_pdf.php',NULL,NULL,NULL,NULL,'PR',NULL);
insert into public.profile_menu (me_code,p_id,p_type_display) select 'PDF:card',p_id,'P' from profile;
create table action_gestion_filter(af_id bigint generated always as identity, af_user text not null, af_name text not null , af_search text not null);
insert into version (val,v_description) values (195,'Protect injection JS , sauve recherche suivi');
commit;

View file

@ -1,10 +1 @@
drop trigger t_remove_script_tag on public.action_gestion_comment ;
drop FUNCTION comptaproc.trg_remove_script_tag();
delete from profile_menu where me_code='PDF:card';
delete from public.menu_ref where me_code='PDF:card';
drop table action_gestion_filter;

View file

@ -1,28 +0,0 @@
CREATE OR REPLACE FUNCTION comptaproc.trg_remove_script_tag()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
begin
NEW.agc_comment_raw:= regexp_replace(NEW.agc_comment_raw, '<script', 'scritp', 'i');
return NEW;
end;
$function$
;
create trigger t_remove_script_tag before
insert
or
update
on
public.action_gestion_comment for each row execute function comptaproc.trg_remove_script_tag();
INSERT INTO public.menu_ref (me_code,me_menu,me_file,me_url,me_description,me_parameter,me_javascript,me_type,me_description_etendue) VALUES
('PDF:card','export Fiche détail PDF','export_card_pdf.php',NULL,NULL,NULL,NULL,'PR',NULL);
insert into public.profile_menu (me_code,p_id,p_type_display) select 'PDF:card',p_id,'P' from profile;
create table action_gestion_filter(af_id bigint generated always as identity, af_user text not null, af_name text not null , af_search text not null);