summaryrefslogtreecommitdiff
path: root/sql/legacy/Pg-upgrade-1.8.4-1.8.5.sql
blob: 807857aa1589fac7a850759b9ba9a684ed8f0191 (plain)
  1. --
  2. alter table customer rename column businessnumber to customernumber;
  3. create index customer_customernumber_key on customer (customernumber);
  4. alter table vendor rename column businessnumber to vendornumber;
  5. create index vendor_vendornumber_key on vendor (vendornumber);
  6. --
  7. CREATE TABLE employee (
  8. id int DEFAULT nextval ('id'),
  9. login text,
  10. name varchar(35),
  11. addr1 varchar(35),
  12. addr2 varchar(35),
  13. addr3 varchar(35),
  14. addr4 varchar(35),
  15. workphone varchar(20),
  16. homephone varchar(20),
  17. startdate date default current_date,
  18. enddate date,
  19. notes text
  20. );
  21. --
  22. create index employee_id_key on employee (id);
  23. create unique index employee_login_key on employee (login);
  24. create index employee_name_key on employee (name);
  25. --
  26. alter table gl add column employee_id int;
  27. create index gl_employee_id_key on gl (employee_id);
  28. alter table ar add column employee_id int;
  29. create index ar_employee_id_key on ar (employee_id);
  30. alter table ap add column employee_id int;
  31. create index ap_employee_id_key on ap (employee_id);
  32. alter table oe add column employee_id int;
  33. create index oe_employee_id_key on oe (employee_id);
  34. --
  35. alter table invoice add column unit varchar(5);
  36. alter table orderitems add column unit varchar(5);
  37. --
  38. update chart set gifi_accno = '' where gifi_accno = NULL;
  39. alter table chart rename to chartold;
  40. CREATE TABLE chart (
  41. id int DEFAULT nextval ('id'),
  42. accno text NOT NULL,
  43. description text,
  44. charttype char(1) DEFAULT 'A',
  45. category char(1),
  46. link text,
  47. gifi_accno text
  48. );
  49. insert into chart (id, accno, description, charttype, category, link, gifi_accno) select id, accno, description, charttype, category, link, gifi_accno from chartold;
  50. drop table chartold;
  51. create index chart_id_key on chart (id);
  52. create unique index chart_accno_key on chart (accno);
  53. create index chart_category_key on chart (category);
  54. create index chart_link_key on chart (link);
  55. create index chart_gifi_accno_key on chart (gifi_accno);
  56. --
  57. alter table parts alter column inventory_accno_id drop default;
  58. --
  59. alter table defaults rename ordnumber to sonumber;
  60. alter table defaults add column ponumber text;
  61. --
  62. update defaults set version = '1.8.5', ponumber = sonumber;
  63. --