BEGIN
DROP TABLE recipient_addresses
CREATE TABLE recipient_addresses (email_addr VARCHAR(64))
CREATE UNIQUE INDEX unique_email ON recipient_addresses (email_addr)
INSERT INTO recipient_addresses VALUES ('jcomeau@risp.org')
INSERT INTO recipient_addresses VALUES ('jc@jcomeau.com')
INSERT INTO recipient_addresses VALUES ('jcomeau_ictx@yahoo.com')

DROP TABLE items_for_sale
CREATE TABLE items_for_sale (item_number varchar(10),
 sku VARCHAR(10),
 listed_timestamp VARCHAR(26))
CREATE UNIQUE INDEX unique_item ON items_for_sale (item_number)
INSERT INTO items_for_sale VALUES ('9999999999', '9999999999',
 '2000-01-01 01:01:01')
INSERT INTO items_for_sale VALUES ('9999999998', '9999999999',
 '2000-01-01 01:01:01')
INSERT INTO items_for_sale VALUES ('9999999997', '9999999999',
 '2000-01-01 01:01:01')
INSERT INTO items_for_sale VALUES ('9999999996', '9999999999',
 '2000-01-01 01:01:01')
INSERT INTO items_for_sale VALUES ('9999999995', '9999999999',
 '2000-01-01 01:01:01')

DROP TABLE products
CREATE TABLE products (sku VARCHAR(10),
 description VARCHAR(64),
 price VARCHAR(12))
CREATE UNIQUE INDEX unique_sku ON products (sku)
INSERT INTO products VALUES ('9999999999', 'Test item', '9.99')

DROP TABLE sales
CREATE TABLE sales (item_number VARCHAR(10),
 txn_id VARCHAR(17))
CREATE UNIQUE INDEX unique_sale ON sales (item_number)

DROP TABLE transactions
CREATE TABLE transactions (txn_id VARCHAR(17),
 business VARCHAR(127),
 receiver_email VARCHAR(127),
 receiver_id VARCHAR(127),
 item_name VARCHAR(127),
 item_number VARCHAR(127),
 quantity VARCHAR(127),
 invoice VARCHAR(127), -- from sales page, must be unique per transaction
 custom VARCHAR(255),
 memo VARCHAR(255),
 tax VARCHAR(127),
 option_name1 VARCHAR(127),
 option_selection1 VARCHAR(127),
 option_name2 VARCHAR(127),
 option_selection2 VARCHAR(127),
 num_cart_items VARCHAR(127),
 payment_status VARCHAR(127),
 pending_reason VARCHAR(127),
 reason_code VARCHAR(127),
 payment_date VARCHAR(127),
 parent_txn_id VARCHAR(17),
 txn_type VARCHAR(127),
 payment_type VARCHAR(127),
 mc_gross VARCHAR(127),
 mc_fee VARCHAR(127),
 mc_currency VARCHAR(3),
 settle_amount VARCHAR(127),
 settle_currency VARCHAR(3),
 exchange_rate VARCHAR(127),
 payment_gross VARCHAR(127),
 payment_fee VARCHAR(127),
 for_auction VARCHAR(127),
 auction_buyer_id VARCHAR(127),
 auction_closing_date VARCHAR(127),
 auction_multi_item VARCHAR(127),
 first_name VARCHAR(127),
 last_name VARCHAR(127),
 payer_business_name VARCHAR(127),
 address_name VARCHAR(127),
 address_street VARCHAR(127),
 address_city VARCHAR(127),
 address_state VARCHAR(127),
 address_zip VARCHAR(127),
 address_country VARCHAR(127),
 address_status VARCHAR(127),
 payer_email VARCHAR(127),
 payer_id VARCHAR(127),
 payer_status VARCHAR(127),
 notify_version VARCHAR(127),
 verify_sign VARCHAR(127),
 jcomeau_com_ipn_leftover VARCHAR(255),
 jcomeau_com_timestamp VARCHAR(127),
 jcomeau_com_remote_addr VARCHAR(127))
COMMIT
SELECT * FROM recipient_addresses
SELECT * FROM items_for_sale
SELECT * FROM products
SELECT * FROM sales
SELECT * FROM transactions
