DROP TABLE article; DROP TABLE offer; DROP TABLE spool; DROP TABLE customer; DROP TABLE dispatch; DROP TABLE dispatchlist; DROP TABLE status; CREATE TABLE article ( article VARCHAR(10), name TEXT, description TEXT, url_path TEXT, url_width INT4, url_height INT4, comment TEXT, tax float4 ); CREATE UNIQUE INDEX "article_id" on "article" using btree ( article ); CREATE INDEX "article_name" on "article" using btree ( name ); CREATE TABLE offer ( articleid VARCHAR(12), article VARCHAR(10), subname TEXT, self_width FLOAT4, self_height FLOAT4, self_depth FLOAT4, self_weight FLOAT4, comment TEXT, price float4, price_orig float4 ); CREATE UNIQUE INDEX "offer_id" on "offer" using btree ( articleid ); CREATE INDEX "offer_offer" on "offer" using btree ( article ); CREATE INDEX "offer_name" on "offer" using btree ( subname ); CREATE TABLE spool ( articleid VARCHAR(12), count_spare int4, count_sold int4 ); CREATE INDEX "spool_id" on "spool" using btree ( articleid ); CREATE TABLE customer ( customer int4, company TEXT, firstname TEXT, lastname TEXT, appendix TEXT, street TEXT, plz TEXT, city TEXT, country TEXT, comment TEXT, passwd TEXT ); CREATE UNIQUE INDEX "customer_id" on "customer" using btree ( customer ); CREATE TABLE dispatch ( dispatch int4, customer int4, date datetime ); CREATE UNIQUE INDEX "dispatch_id" on "dispatch" using btree ( dispatch ); CREATE TABLE dispatchlist ( dispatch int4, articleid varchar(12), quantity int4, unitprice float4 ); CREATE INDEX "dispatchlist_orderid" on "dispatchlist" using btree ( dispatch ); CREATE INDEX "dispatchlist_artid" on "dispatchlist" using btree ( articleid ); CREATE TABLE status ( dispatch int4, status int4, staff TEXT, date datetime ); CREATE INDEX "status_disp" on "status" using btree ( dispatch ); REVOKE ALL on "article" from PUBLIC; GRANT ALL on "article" to "www"; GRANT ALL on "article" to "joey"; REVOKE ALL on "offer" from PUBLIC; GRANT ALL on "offer" to "www"; GRANT ALL on "offer" to "joey"; REVOKE ALL on "dispatch" from PUBLIC; GRANT ALL on "dispatch" to "www"; GRANT ALL on "dispatch" to "joey"; REVOKE ALL on "dispatchlist" from PUBLIC; GRANT ALL on "dispatchlist" to "www"; GRANT ALL on "dispatchlist" to "joey"; REVOKE ALL on "customer" from PUBLIC; GRANT ALL on "customer" to "www"; GRANT ALL on "customer" to "joey"; REVOKE ALL on "spool" from PUBLIC; GRANT ALL on "spool" to "www"; GRANT ALL on "spool" to "joey"; REVOKE ALL on "status" from PUBLIC; GRANT ALL on "status" to "www"; GRANT ALL on "status" to "joey";