Added a link back to the home page
[infodrom.org/infocon.infodrom.org] / misc / schemes
1 DROP TABLE article;
2 DROP TABLE offer;
3 DROP TABLE spool;
4 DROP TABLE customer;
5 DROP TABLE dispatch;
6 DROP TABLE dispatchlist;
7 DROP TABLE status;
8
9 CREATE TABLE article (
10         article VARCHAR(10),
11         name TEXT,
12         description TEXT,
13         url_path TEXT,
14         url_width INT4,
15         url_height INT4,
16         comment TEXT,
17         tax float4
18 );
19 CREATE UNIQUE INDEX "article_id" on "article" using btree ( article );
20 CREATE  INDEX "article_name" on "article" using btree ( name );
21
22 CREATE TABLE offer (
23         articleid VARCHAR(12),
24         article VARCHAR(10),
25         subname TEXT,
26         self_width  FLOAT4,
27         self_height FLOAT4,
28         self_depth  FLOAT4,
29         self_weight FLOAT4,
30         comment TEXT,
31         price float4,
32         price_orig float4
33 );
34 CREATE UNIQUE INDEX "offer_id" on "offer" using btree ( articleid );
35 CREATE  INDEX "offer_offer" on "offer" using btree ( article );
36 CREATE  INDEX "offer_name" on "offer" using btree ( subname );
37
38 CREATE TABLE spool (
39         articleid VARCHAR(12),
40         count_spare int4,
41         count_sold int4
42 );
43 CREATE INDEX "spool_id" on "spool" using btree ( articleid );
44
45 CREATE TABLE customer (
46         customer int4,
47         company TEXT,
48         firstname TEXT,
49         lastname TEXT,
50         appendix TEXT,
51         street TEXT,
52         plz TEXT,
53         city TEXT,
54         country TEXT,
55         comment TEXT,
56         passwd TEXT
57 );
58 CREATE UNIQUE INDEX "customer_id" on "customer" using btree ( customer );
59
60 CREATE TABLE dispatch (
61         dispatch int4,
62         customer int4,
63         date datetime
64 );
65 CREATE UNIQUE INDEX "dispatch_id" on "dispatch" using btree ( dispatch );
66
67 CREATE TABLE dispatchlist (
68         dispatch int4,
69         articleid varchar(12),
70         quantity int4,
71         unitprice float4
72 );
73 CREATE  INDEX "dispatchlist_orderid" on "dispatchlist" using btree ( dispatch );
74 CREATE  INDEX "dispatchlist_artid"   on "dispatchlist" using btree ( articleid );
75
76 CREATE TABLE status (
77         dispatch int4,
78         status int4,
79         staff TEXT,
80         date datetime
81 );
82 CREATE  INDEX "status_disp" on "status" using btree ( dispatch );
83
84
85 REVOKE ALL on "article" from PUBLIC;
86 GRANT  ALL on "article" to "www";
87 GRANT  ALL on "article" to "joey";
88
89 REVOKE ALL on "offer" from PUBLIC;
90 GRANT  ALL on "offer" to "www";
91 GRANT  ALL on "offer" to "joey";
92
93 REVOKE ALL on "dispatch" from PUBLIC;
94 GRANT  ALL on "dispatch" to "www";
95 GRANT  ALL on "dispatch" to "joey";
96
97 REVOKE ALL on "dispatchlist" from PUBLIC;
98 GRANT  ALL on "dispatchlist" to "www";
99 GRANT  ALL on "dispatchlist" to "joey";
100
101 REVOKE ALL on "customer" from PUBLIC;
102 GRANT  ALL on "customer" to "www";
103 GRANT  ALL on "customer" to "joey";
104
105 REVOKE ALL on "spool" from PUBLIC;
106 GRANT  ALL on "spool" to "www";
107 GRANT  ALL on "spool" to "joey";
108
109 REVOKE ALL on "status" from PUBLIC;
110 GRANT  ALL on "status" to "www";
111 GRANT  ALL on "status" to "joey";