1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/noalyss_ynh.git synced 2024-09-03 19:46:20 +02:00
noalyss_ynh/sources/include/sql/patch/upgrade60.sql
dudjima 3a905a4a87 Update sources 7.01
Update files from sources with last update on noalyss.eu
2018-04-13 18:58:28 +02:00

40 lines
874 B
PL/PgSQL

begin;
alter SEQUENCE document_type_dt_id_seq start 25;
insert into document_type (dt_id,dt_value) values (20,'Réception commande Fournisseur');
insert into document_type (dt_id,dt_value) values (21,'Réception commande Client');
insert into document_type (dt_id,dt_value) values (22,'Réception magazine');
CREATE OR REPLACE FUNCTION extension_ins_upd()
RETURNS "trigger" AS
$BODY$
declare
sCode text;
sFile text;
begin
sCode:=trim(upper(NEW.ex_code));
sCode:=replace(sCode,' ','_');
sCode:=substr(sCode,1,15);
sCode=upper(sCode);
NEW.ex_code:=sCode;
-- remove forbidden char
sFile:=NEW.ex_file;
sFile:=replace(sFile,';','_');
sFile:=replace(sFile,'<','_');
sFile:=replace(sFile,'>','_');
sFile:=replace(sFile,'..','');
sFile:=replace(sFile,'&','');
sFile:=replace(sFile,'|','');
return NEW;
end;
$BODY$
LANGUAGE 'plpgsql';
update version set val=61;
commit;