summaryrefslogtreecommitdiff
path: root/sql/legacy/Pg-upgrade-2.4.4-2.5.0.sql
blob: 5d3b9b9d24531d28242b46010ba08290e42520f7 (plain)
  1. --
  2. alter table ar add ponumber text;
  3. alter table ap add ponumber text;
  4. alter table oe add ponumber text;
  5. --
  6. alter table project add startdate date;
  7. alter table project add enddate date;
  8. --
  9. create table recurring (id int, reference text, startdate date, nextdate date, enddate date, repeat int2, unit varchar(6), howmany int, payment bool default 'f');
  10. create table recurringemail (id int, formname text, format text, message text);
  11. create table recurringprint (id int, formname text, format text, printer text);
  12. --
  13. create function del_recurring() returns opaque as '
  14. begin
  15. delete from recurring where id = old.id;
  16. delete from recurringemail where id = old.id;
  17. delete from recurringprint where id = old.id;
  18. return NULL;
  19. end;
  20. ' language 'plpgsql';
  21. --end function
  22. create trigger del_recurring after delete on ar for each row execute procedure del_recurring();
  23. -- end trigger
  24. create trigger del_recurring after delete on ap for each row execute procedure del_recurring();
  25. -- end trigger
  26. create trigger del_recurring after delete on gl for each row execute procedure del_recurring();
  27. -- end trigger
  28. create trigger del_recurring after delete on oe for each row execute procedure del_recurring();
  29. -- end trigger
  30. --
  31. update defaults set version = '2.5.0';