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/html/admin/sql/patch/upgrade35.sql
2015-09-27 00:54:25 +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;