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/noalyss-6.9.0.0/html/admin/sql/patch/upgrade35.sql
Laurent Peuch fce579e032 init
2015-09-27 00:42:21 +02:00

45 lines
969 B
PL/PgSQL

begin;
CREATE or replace FUNCTION t_document_modele_validate() RETURNS "trigger"
AS $$
declare
lText text;
modified document_modele%ROWTYPE;
begin
modified=NEW;
modified.md_filename=replace(NEW.md_filename,' ','_');
return modified;
end;
$$ LANGUAGE plpgsql;
CREATE or replace FUNCTION t_document_validate() RETURNS "trigger"
AS $$
declare
lText text;
modified document%ROWTYPE;
begin
modified=NEW;
modified.d_filename=replace(NEW.d_filename,' ','_');
return modified;
end;
$$ LANGUAGE plpgsql;
CREATE TRIGGER document_validate
BEFORE INSERT OR UPDATE ON document
FOR EACH ROW
EXECUTE PROCEDURE t_document_validate();
CREATE TRIGGER document_modele_validate
BEFORE INSERT OR UPDATE ON document_modele
FOR EACH ROW
EXECUTE PROCEDURE t_document_modele_validate();
update operation_analytique set oa_debit=j_debit from jrnx where jrnx.j_id=operation_analytique.j_id ;
update version set val=36;
commit;