2 alter table customer add column cc text;
3 alter table customer add column bcc text;
5 alter table vendor add column cc text;
6 alter table vendor add column bcc text;
10 shiptoname varchar(35),
11 shiptoaddr1 varchar(35),
12 shiptoaddr2 varchar(35),
13 shiptoaddr3 varchar(35),
14 shiptoaddr4 varchar(35),
15 shiptocontact varchar(35),
16 shiptophone varchar(20),
17 shiptofax varchar(20),
21 insert into shipto (trans_id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail) select id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail from customer where shiptoname != '' or shiptoname is not null;
23 insert into shipto (trans_id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail) select distinct on (a.id) a.id, c.shiptoname, c.shiptoaddr1, c.shiptoaddr2, c.shiptoaddr3, c.shiptoaddr4, c.shiptocontact, c.shiptophone, c.shiptofax, c.shiptoemail from customer c, ar a where a.customer_id = c.id;
25 insert into shipto (trans_id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail) select distinct on (o.id) o.id, c.shiptoname, c.shiptoaddr1, c.shiptoaddr2, c.shiptoaddr3, c.shiptoaddr4, c.shiptocontact, c.shiptophone, c.shiptofax, c.shiptoemail from customer c, oe o where o.customer_id = c.id;
27 create index shipto_trans_id_key on shipto (trans_id);
29 create table custome (
30 id int default nextval('id'),
43 creditlimit float DEFAULT 0,
49 insert into custome (id, name, addr1, addr2, addr3, addr4, contact, phone, fax, email, notes, discount, taxincluded, creditlimit, terms, customernumber) select id, name, addr1, addr2, addr3, addr4, contact, phone, fax, email, notes, discount, taxincluded, creditlimit, terms, customernumber from customer;
52 alter table custome rename to customer;
53 create index customer_id_key on customer (id);
54 create index customer_name_key on customer (name);
55 create index customer_contact_key on customer (contact);
57 alter table parts add column bom boolean;
58 alter table parts alter column bom set default 'f';
59 update parts set bom = 'f';
60 update parts set bom = 't' where assembly;
61 alter table parts add column image text;
62 alter table parts add column drawing text;
63 alter table parts add column microfiche text;
65 alter table gl add column notes text;
67 alter table oe add column closed bool;
68 alter table oe alter column closed set default 'f';
69 update oe set closed = 'f';
71 create table project (
72 id int default nextval('id'),
77 create index project_id_key on project (id);
79 alter table acc_trans add column project_id int;
80 update acc_trans set cleared = '0' where cleared = '1';
82 alter table invoice add column project_id int;
83 alter table invoice add column deliverydate date;
84 alter table orderitems add column project_id int;
85 alter table orderitems add column reqdate date;
87 alter table gl rename source to reference;
88 create index gl_reference_key on gl (reference);
89 create index acc_trans_source_key on acc_trans (lower(source));
91 update defaults set version = '2.0.0';