summaryrefslogtreecommitdiff
path: root/sql/Oracle-upgrade-2.0.0-2.0.8.sql
blob: eb65e9caed98e1e43abaa58903edf504af6e42cd (plain)
  1. --
  2. create table partsgroup (id integer, partsgroup varchar2(100));
  3. create index partsgroup_id_key on partsgroup (id);
  4. --
  5. alter table parts add (partsgroup_id integer);
  6. --
  7. alter table assembly add (bom char(1));
  8. update assembly set bom = '0' where assembly.id = parts.id and parts.bom = '0';
  9. update assembly set bom = '1' where assembly.id = parts.id and parts.bom = '1';
  10. --
  11. CREATE OR REPLACE TRIGGER partsgroupid BEFORE INSERT ON partsgroup FOR EACH ROW
  12. BEGIN
  13. SELECT id.nextval
  14. INTO :new.id
  15. FROM DUAL;--
  16. END;;
  17. --
  18. update defaults set version = '2.0.8';
  19. --