3 id int default nextval('id'),
17 taxincluded bool default 'f',
18 creditlimit float default 0,
20 customernumber varchar(32),
24 taxnumber varchar(32),
31 insert into temp (id,name,address1,city,country,state,contact,phone,fax,email,notes,discount,taxincluded,creditlimit,terms,customernumber,cc,bcc,business_id,taxnumber,sic_code,iban,bic,employee_id) select id,name,substr(addr1,1,32),substr(addr2,1,32),substr(addr3,1,32),substr(addr4,1,32),contact,phone,fax,email,notes,discount,taxincluded,creditlimit,terms,substr(customernumber,1,32),cc,bcc,business_id,substr(taxnumber,1,32),sic_code,iban,bic,employee_id from customer;
34 alter table temp rename to customer;
36 create index customer_id_key on customer (id);
37 create index customer_customernumber_key on customer (customernumber);
38 create index customer_name_key on customer (name);
39 create index customer_contact_key on customer (contact);
41 create trigger del_customer after delete on customer for each row execute procedure del_customer();
45 id int default nextval('id'),
59 taxincluded bool default 'f',
60 vendornumber varchar(32),
63 gifi_accno varchar(30),
65 taxnumber varchar(32),
68 creditlimit float default 0,
74 insert into temp (id,name,address1,city,country,state,contact,phone,fax,email,notes,terms,taxincluded,vendornumber,cc,bcc,gifi_accno,business_id,taxnumber,sic_code,discount,creditlimit,iban,bic,employee_id) select id,name,substr(addr1,1,32),substr(addr2,1,32),substr(addr3,1,32),substr(addr4,1,32),contact,phone,fax,email,notes,terms,taxincluded,substr(vendornumber,1,32),cc,bcc,gifi_accno,business_id,substr(taxnumber,1,32),sic_code,discount,creditlimit,iban,bic,employee_id from vendor;
77 alter table temp rename to vendor;
79 create index vendor_id_key on vendor (id);
80 create index vendor_name_key on vendor (name);
81 create index vendor_vendornumber_key on vendor (vendornumber);
82 create index vendor_contact_key on vendor (contact);
84 create trigger del_vendor after delete on vendor for each row execute procedure del_vendor();
89 shiptoname varchar(64),
90 shiptoaddress1 varchar(32),
91 shiptoaddress2 varchar(32),
92 shiptocity varchar(32),
93 shiptostate varchar(32),
94 shiptozipcode varchar(10),
95 shiptocountry varchar(32),
96 shiptocontact varchar(64),
97 shiptophone varchar(20),
98 shiptofax varchar(20),
102 insert into temp (trans_id,shiptoname,shiptoaddress1,shiptocity,shiptocountry,shiptostate,shiptocontact,shiptophone,shiptofax,shiptoemail) select trans_id,shiptoname,substr(shiptoaddr1,1,32),substr(shiptoaddr2,1,32),substr(shiptoaddr3,1,32),substr(shiptoaddr4,1,32),shiptocontact,shiptophone,shiptofax,shiptoemail from shipto;
105 alter table temp rename to shipto;
106 create index shipto_trans_id_key on shipto (trans_id);
109 id int default nextval('id'),
112 address1 varchar(32),
113 address2 varchar(32),
118 workphone varchar(20),
119 homephone varchar(20),
120 startdate date default current_date,
124 sales bool default 'f',
132 insert into temp (id,login,name,address1,city,country,state,workphone,homephone,startdate,enddate,notes,role,sales,email,sin,iban,bic,managerid) select id,login,name,substr(addr1,1,32),substr(addr2,1,32),substr(addr3,1,32),substr(addr4,1,32),workphone,homephone,startdate,enddate,notes,role,sales,email,sin,iban,bic,managerid from employee;
135 alter table temp rename to employee;
137 create index employee_id_key on employee (id);
138 create unique index employee_login_key on employee (login);
139 create index employee_name_key on employee (name);
141 update defaults set version = '2.3.5';