create table configuration (
 id counter,
 fieldname text (50) null, 
 fieldvalue text (200) null, 
 fieldgroup text (20) null, 
 fieldyesno YesNo  null, 
 message Memo  null, 
 showfield text (50) null, 
 fieldgroup2 text (50) null
);
create table configuration1 (
 id counter,
 fieldname text (50) null, 
 fieldvalue text (200) null, 
 fieldgroup text (20) null, 
 fieldyesno YesNo  null, 
 message Memo  null, 
 showfield text (50) null, 
 fieldgroup2 text (50) null
);

create table content (
 contentid counter,
 messagetype text (100) null, 
 message Memo  null, 
 message2 Memo  null, 
 contentimage text (255) null, 
 hide YesNo  null, 
 template text (255) null, 
 contentlanguage text (50) null, 
 other1 text (255) null, 
 other2 text (255) null, 
 other3 text (255) null, 
 loggedin YesNo  null, 
 impressions Long  null, 
 cdateadded DateTime  null, 
 cdateupdated DateTime  null
);

create table ordertracking (
 trackid counter,
 orderid Long  null, 
 trackcomment Memo  null, 
 trackdate DateTime  null, 
 tracktime DateTime  null, 
 trackname text (100) null, 
 trackview YesNo  null, 
 trackother text (100) null, 
 trackemail text (100) null
);
create table prodcategories (
 id counter,
 intcategoryid Long  null, 
 intcatalogid Long  null
);
create table projects (
 pid counter,
 pdate DateTime  null, 
 description text (255) null, 
 customer text (100) null, 
 customeremail text (100) null, 
 price Currency  null, 
 dualprice Currency  null, 
 paid text (100) null, 
 datepaid DateTime  null, 
 processed YesNo  null, 
 orderid Long  null, 
 canceled YesNo  null, 
 comments Memo  null, 
 other1 text (255) null, 
 other2 text (100) null, 
 other3 text (255) null, 
 billid Long  null, 
 billdescription Memo  null
);
create table registrant (registrantid Counter,
 firstname text (100) null ,
 lastname text (100) null,
 address text (255) null ,
 city text (100) null ,
 state text (100) null ,
 postcode text (50) null ,
 country text (100) null ,
 company text (100) null ,
 phone text (50) null ,
 workphone text (50) null ,
 mobilephone text (50) null ,
 fax text (50) null ,
 email text (255)  null ,
 comments text (255) null ,
 logincount long null ,
 lastlogindate datetime null,
 regpassword text (50) null ,
 publicpassword text (50) null ,
 eventdate datetime null ,
 eventdateend datetime null ,
 eventtype text (255) null ,
 cofirstname text (100) null ,
 colastname text (100)  null,
 coaddress text (255) null ,
 cocity text (100) null ,
 costate text (100) null ,
 copostcode text (50) null ,
 cocountry text (100) null ,
 cophone text (50) null ,
 coemail text (255) null ,
 sendfirstname text (50) null ,
 sendlastname text (50)  null,
 sendaddress text (255) null ,
 sendcity text (100) null ,
 sendstate text (100) null ,
 sendpostcode text (50) null ,
 sendcountry text (100) null ,
 sendphone text (50) null ,
 sendemail text (255) null ,
 regdate datetime null,
 regtime datetime null,
 thankyounote memo null,
 shippingtype text(50) null,
 regorderid long null,
 publicallowed text (10) null,
 processed YESNO null
);
create table registryitems (regitemid Counter,
 registrantid Long null ,
 orderid long null,
 regcatalogid long null,
 numitems long null,
 itemname memo null,
 unitprice currency null,
 dualprice double null,
 supplierid long null,
 address text (255),
 numpurchased long null,
 purchaseorderid long null
 );

create table reviews (
        id counter,
	catalogid long null,
	authorized text (5) null,
	reviewdate datetime null,
	reviewtime datetime null,
	rating long null,
	title text (255) null,
	comment memo null,
	location text(100) null,
	name text(100) null,
	email text (100) null,
	other1 text (100) null,
	other2 text (100) null

);
create table sitesessions (
 id counter,
 sessiondate DateTime  null, 
 sessiontime DateTime  null, 
 sessionkey text (50) null, 
 sessionvalue Memo  null,
 sessionnow text(50) null
);

create table suppliers (
 supplierid counter,
 name text (255) null, 
 supplieruserid text (100) null, 
 firstname text (50) null, 
 lastname text (50) null, 
 address text (255) null, 
 city text (100) null, 
 state text (100) null, 
 postcode text (20) null, 
 country text (100) null, 
 company text (255) null, 
 phone text (50) null, 
 workphone text (30) null, 
 mobilephone text (30) null, 
 fax text (30) null, 
 email text (50) null, 
 comments text (255) null, 
 logincount Long  null, 
 lastlogindate DateTime  null, 
 website text (200) null, 
 supplierpassword text (50) null, 
 accountno text (50) null, 
 template text (100) null, 
 commissionrate Double  null, 
 other1 text (100) null
);
create table affiliatelog (
 afflogid counter,
 affid Long  null, 
 affdate DateTime  null, 
 afftime DateTime  null, 
 affdirecturl text (255) null, 
 affreferrer text (255) null, 
 affcookie YesNo  null, 
 affother1 text (255) null
);
create table billing (
 billid counter,
 billamount Currency  null, 
 billnextbilldate DateTime  null, 
 billcustomer text (255) null, 
 billemail text (100) null, 
 billdescription Memo  null, 
 billinstallments Long  null, 
 billinstallmenttype text (50) null, 
 billinterval Long  null, 
 billlastbilldate DateTime  null, 
 billorderid Long  null, 
 billlastmaildate DateTime  null, 
 billsentcount Long  null, 
 billcanceled YesNo  null, 
 billcompleted YesNo  null, 
 billcreationdate DateTime  null, 
 billorderitemid Long  null, 
 billenddate DateTime  null, 
 billtemplate text (100) null, 
 billother1 text (100) null, 
 billother2 text (100) null
);
create table pinnumbers (
 serialid counter,
 catalogid Long  null, 
 pinnumber text (255) null, 
 orderid Long  null, 
 pinproductmatch text (40) null, 
 pinother1 text (255) null
);
create table hackers (
 hackerid counter,
 ipaddress text (50) null, 
 email text (200) null, 
 comment text (255) null, 
 other text (100) null
);

create table languages (
 id counter,
 lang text (50) null, 
 keyword text (50) null, 
 caption text (255) null
);
create table savedcarts (
 id counter,
 cartname text (100) null, 
 customerid Long  null, 
 cartcookies Memo  null, 
 savedate DateTime  null, 
 savetime DateTime  null, 
 other1 text (100) null,
 catalogid long
);
create table templates (
 id counter,
 templatename text (100) null, 
 template Memo  null
);

create table downloads (
 id counter,
 orderid Long  null, 
 catalogid Long  null, 
 customerid Long  null, 
 filename text (255) null, 
 downloadcount Long  null, 
 downloaddatelimit DateTime  null, 
 downloadmaxcount Long  null, 
 downloadcreatedate DateTime  null, 
 downloadother text (100) null, 
 downloadother1 text (100) null, 
 authorized text (10) null, 
 lastdownloaddate DateTime  null
);

create table currencyvalues (
	id counter,
	cid text (50) null ,
	fullunitname text (50) null ,
	conversionvalue double null ,
	currencysymbol text (100) null ,
	theimage text (100) null ,
	hide yesno null
);

create table insurancemethods (
 insurancemethodid counter,
 insurancemethod text (50) null, 
 insuranceprice currency null, 
 insurancebasecost currency null, 
 insuranceextracost currency null, 
 insuranceother1 text (50) null,
 insuranceother2 text (50) null,
 insurancecost1 currency null, 
 insurancecost2 currency null, 
 insuranceroutine text (255) null,
 insurancecountry text (50) null
);

create table translatecategories (
    translateid counter, 
    lang text (100) null, 
    categoryid long null, 
    catdescription text (255) null

);
create table translateprodfeatures (
    translateid counter, 
    lang text (100) null, 
    id long null, 
    featurecaption text (100) null, 
    featurename text (255) null

);
create table translateproducts (
    translateid counter, 
    lang text (100) null, 
    catalogid long null, 
    cdescription memo null, 
    cname text (255) null, 
    extendeddesc memo null
);


create table translatecontent (
 translateid counter,
 lang text (100) null, 
 contentid Long  null, 
 message Memo  null, 
 message2 Memo  null
);
create table menuitem (
 id counter,
 name text (50) null, 
 seq Long  null, 
 pmenuitemid Long  null, 
 url text (255) null, 
 contentid Long  null, 
 openin Memo  null
);

create table ups_config (
        [upsids] counter, 
	[xzeroweighterror] text (10) null,
	[xautoseparateweight] text (10) null,
	[xautoseparatepackages] text (10) null,
	[xsuppliershipfield] text (30) null,
	[xusesupplierzip] text (10) null,
	[xindividualpackages] text (10) null,
	[ups_weightunits] text (10) null,
	[ups_residentialind] text (10) null,
	[ups_unitofmeasurement] text (10) null,
	[packagingtype] text (10) null,
	[pickuptype] text (10) null,
	[xmerchantcountry] text (10) null,
	[xmerchantstate] text (10) null,
	[xmerchantcity] text (50) null,
	[xmerchantpostcode] text (20) null,
	[accesslicencenum] text (50) null,
	[username] text (50) null,
	[password] text (50) null,
	[developerkey] text (50) null,
	[gatewaylocation_license] text (50) null,
	[gatewaylocation_register] text (50) null,
	[xml] text (10) null,
	[xcheckindividualproductfield] text (10) null,
	[xcheckindividualproduct] text (10) null,
	[xdimensionfield] text (30) null,
	[ups_dimensions] text (20) null,
	[gatewaylocation_paymenttesting] text (50) null,
	[gatewaylocation_payment] text (50) null,
	[testmode] text (10) null,
	[xupsacctno] text (20) null,
	[dimensions] text (20) null,
	[xtrace] text (10) null,
	[xtracexml] text (10) null,
	[gatewaylocation_trackingtesting] text (50) null,
	[gatewaylocation_tracking] text (50) null	
);

table categories;
alter table categories add column cathide text(10) NULL;
alter table categories add column highercategoryid Long;
alter table categories add column customermatch text(50) Null;
alter table categories add column productmatch text(50) Null;
alter table categories add column catmemo MEMO NULL ;
alter table categories add column catlanguage text (50) null;
alter table categories add column catproducttemplate text (255) null;
table prodfeatures;
alter table prodfeatures add column featurerequired YesNo NULL;
alter table prodfeatures add column featureother1 text(50) NULL;
alter table prodfeatures add column featureimage text (255) null;
alter table prodfeatures add column featureweight Double  null;
alter table prodfeatures add column featurepercent Double  null;
alter table prodfeatures add column featuredefault YesNo  null;
table oitems;
alter table oitems add column address memo NULL;
alter table oitems add column supplierid long NULL;
alter table oitems add column features text(255) NULL;
alter table oitems add column pinnumber text (255) null;
table orders;
alter table orders add column canceled YESNO NULL;
alter table orders add column ipaddress text(100) NULL;
alter table orders add column hackeryesno YESNO NULL;
alter table orders add column customercancel YESNO NULL;
alter table orders add column opoints Long NULL;
alter table orders add column vatnumber text (50) NULL;
alter table orders add column commission currency NULL;
alter table orders  add column opending text (100) null;
alter table orders  add column shipmessage text (255) null;
alter table orders  add column hearaboutus text (100) null;
ALTER TABLE orders alter column ocardno text (100) null;
table products;
alter table products  add column crossselling text(255) NULL;
alter table products  add column supplierid long NULL;
alter table products  add column hide yesno NULL;
alter table products  add column productmatch text(100) NULL;
alter table products  add column customermatch text(100) NULL;
alter table products  add column orderattachment text(255) NULL;
alter table products  add column orderdownload text(255) NULL;
alter table products  add column groupfordiscount text(50) NULL;
alter table products  add column clanguage text(50) NULL;
alter table products add column points Long NULL;
alter table products add column price2 currency NULL;
alter table products add column price3 currency NULL;
alter table products add column pointstobuy Long NULL;
alter table products add column  billprice Currency  null;
alter table products add column  billinstallments Long  null; 
alter table products add column  billinstallmenttype text (50) null;
alter table products add column  billinterval Long  null;
alter table products add column  maximumquantity Long  null;
alter table products add column  frontpage text (100) null;
table projects;
alter table projects add column  billid Long  null;
alter table projects add column  billdescription memo null;
table reviews;
alter table reviews  add column authorized text(10) NULL;
table shipmethods;
alter table shipmethods  add column shipcountry text(50) NULL;
table quantitydiscounts;
alter table quantitydiscounts add column groupfordiscount text(100) NULL;
table suppliers;
alter table suppliers add column supplieruserid text(100) NULL;
alter table suppliers add column supplierpassword text(100) NULL;
table customers;
alter table customers  add column maillist  YesNo NULL;
alter table customers  add column productgroup text(50) NULL;
alter table customers  add column cookiequestion YESNO;
alter table customers  add column pointstotal Long NULL;
alter table customers  add column pointsremaining Long NULL;
alter table customers  add column vatnumber text (50) NULL;
alter table customers  add column userid text (50) null;
alter table customers  add column hearaboutus text (100) null;
alter table customers  add column taxexempt text (50) null;
table tbllog;
alter table tbllog add fldipaddress text(40) NULL ;
table affiliates;
alter table affiliates add column template text (200) null;
alter table affiliates add column referralid Long null;
alter table affiliates add mastercommissionrate double NULL ;
update categories set highercategoryid=0 where highercategoryid is null; 
' 5.50
table orders;
alter table orders add column oaddress2  text(100) NULL;
alter table orders add column oshipaddress2  text(100) NULL;
alter table orders add column deliverydate text(20) NULL;
alter table orders add column deliverytime text(20) NULL;
alter table orders add column producttotal currency NULL;
table customers;
alter table customers  add column address2 text(100) NULL;
table coupons;
alter table coupons  add column couponcustomers text(255) NULL;
alter table coupons  add column couponminimum currency NULL;
table configuration;
alter table configuration  add column message  Memo NULL;
table registrant;
alter table registrant  add column processed YESNO NULL;
table products;
alter table products  add column inventoryproducts  text(255) NULL;
alter table products  add column taxfree  YESNO NULL;
alter table products  add column freeshipping YESNO NULL;
table savedcarts;
alter table savedcarts add column catalogid long null;
table configuration1;
alter table configuration1  add column message  Memo NULL;
' 6.00
table categories;
alter table categories add column impressions long null;

table configuration;
alter table configuration add column showfield text (50) null;
alter table configuration add column fieldgroup2 text (50) null;
table configuration1;
alter table configuration1 add column showfield text (50) null;
alter table configuration1 add column fieldgroup2 text (50) null;
table content;
alter table content add column loggedin yesno null;
alter table content add column impressions long null;
alter table content add column cdateadded datetime null;
alter table content add column cdateupdated datetime null;
table coupons;
alter table coupons add column couponaffid long null;

table products;
alter table products add column highercatalogid long null;
alter table products add column spdisplaytype text (50) null;
alter table products add column hassubproduct text (50) null;
alter table products add column impressions long null;
alter table products add column cdateadded datetime null;
alter table products add column cdateupdated datetime null;
alter table products add column templatelisting text (100) null;

table tblaccess;
alter table tblaccess add column fldsection text (50) null;
alter table tblaccess add column fldmenu text (50) null;
alter table tblaccess add column fldorder text (50) null ;
table orders;
alter table orders add column oinsurancemethodtype text (100) null;
alter table orders add column oinsurancecost text (100) null;
alter table orders add column oinsurancemethod long null;
alter table orders add column odualinsurance double null;
ALTER TABLE orders ADD COLUMN upstrackno text (50) null;
