commit | author | age
|
977a29
|
1 |
-- |
T |
2 |
-- Sequence "user_ids" |
|
3 |
-- Name: user_ids; Type: SEQUENCE; Schema: public; Owner: postgres |
|
4 |
-- |
|
5 |
|
|
6 |
CREATE SEQUENCE user_ids |
|
7 |
INCREMENT BY 1 |
|
8 |
NO MAXVALUE |
|
9 |
NO MINVALUE |
|
10 |
CACHE 1; |
|
11 |
|
f5dc2a
|
12 |
-- |
1cded8
|
13 |
-- Table "users" |
f5dc2a
|
14 |
-- Name: users; Type: TABLE; Schema: public; Owner: postgres |
S |
15 |
-- |
|
16 |
|
|
17 |
CREATE TABLE users ( |
15a9d1
|
18 |
user_id integer DEFAULT nextval('user_ids'::text) PRIMARY KEY, |
f5dc2a
|
19 |
username character varying(128) DEFAULT ''::character varying NOT NULL, |
S |
20 |
mail_host character varying(128) DEFAULT ''::character varying NOT NULL, |
42b113
|
21 |
alias character varying(128) DEFAULT ''::character varying NOT NULL, |
f5dc2a
|
22 |
created timestamp with time zone DEFAULT now() NOT NULL, |
S |
23 |
last_login timestamp with time zone DEFAULT now() NOT NULL, |
|
24 |
"language" character varying(5) DEFAULT 'en'::character varying NOT NULL, |
|
25 |
preferences text DEFAULT ''::text NOT NULL |
|
26 |
); |
|
27 |
|
|
28 |
|
b59474
|
29 |
|
f5dc2a
|
30 |
-- |
1cded8
|
31 |
-- Table "session" |
T |
32 |
-- Name: session; Type: TABLE; Schema: public; Owner: postgres |
|
33 |
-- |
|
34 |
|
|
35 |
CREATE TABLE "session" ( |
15a9d1
|
36 |
sess_id character varying(40) DEFAULT ''::character varying PRIMARY KEY, |
1cded8
|
37 |
created timestamp with time zone DEFAULT now() NOT NULL, |
T |
38 |
changed timestamp with time zone DEFAULT now() NOT NULL, |
|
39 |
ip character varying(16) NOT NULL, |
|
40 |
vars text NOT NULL |
|
41 |
); |
|
42 |
|
|
43 |
|
b59474
|
44 |
|
T |
45 |
-- |
|
46 |
-- Sequence "identity_ids" |
|
47 |
-- Name: identity_ids; Type: SEQUENCE; Schema: public; Owner: postgres |
|
48 |
-- |
|
49 |
|
|
50 |
CREATE SEQUENCE identity_ids |
|
51 |
START WITH 1 |
|
52 |
INCREMENT BY 1 |
|
53 |
NO MAXVALUE |
|
54 |
NO MINVALUE |
|
55 |
CACHE 1; |
1cded8
|
56 |
|
T |
57 |
-- |
|
58 |
-- Table "identities" |
|
59 |
-- Name: identities; Type: TABLE; Schema: public; Owner: postgres |
|
60 |
-- |
|
61 |
|
|
62 |
CREATE TABLE identities ( |
15a9d1
|
63 |
identity_id integer DEFAULT nextval('identity_ids'::text) PRIMARY KEY, |
T |
64 |
user_id integer NOT NULL REFERENCES users (user_id), |
1cded8
|
65 |
del integer DEFAULT 0 NOT NULL, |
T |
66 |
standard integer DEFAULT 0 NOT NULL, |
|
67 |
name character varying(128) NOT NULL, |
|
68 |
organization character varying(128), |
|
69 |
email character varying(128) NOT NULL, |
|
70 |
"reply-to" character varying(128), |
|
71 |
bcc character varying(128), |
|
72 |
signature text |
|
73 |
); |
|
74 |
|
b59474
|
75 |
|
T |
76 |
|
|
77 |
-- |
|
78 |
-- Sequence "contact_ids" |
|
79 |
-- Name: contact_ids; Type: SEQUENCE; Schema: public; Owner: postgres |
|
80 |
-- |
|
81 |
|
|
82 |
CREATE SEQUENCE contact_ids |
|
83 |
START WITH 1 |
|
84 |
INCREMENT BY 1 |
|
85 |
NO MAXVALUE |
|
86 |
NO MINVALUE |
|
87 |
CACHE 1; |
1cded8
|
88 |
|
T |
89 |
-- |
|
90 |
-- Table "contacts" |
|
91 |
-- Name: contacts; Type: TABLE; Schema: public; Owner: postgres |
|
92 |
-- |
|
93 |
|
|
94 |
CREATE TABLE contacts ( |
15a9d1
|
95 |
contact_id integer DEFAULT nextval('contact_ids'::text) PRIMARY KEY, |
T |
96 |
user_id integer NOT NULL REFERENCES users (user_id), |
1cded8
|
97 |
changed timestamp with time zone DEFAULT now() NOT NULL, |
T |
98 |
del integer DEFAULT 0 NOT NULL, |
|
99 |
name character varying(128) DEFAULT ''::character varying NOT NULL, |
|
100 |
email character varying(128) DEFAULT ''::character varying NOT NULL, |
|
101 |
firstname character varying(128) DEFAULT ''::character varying NOT NULL, |
|
102 |
surname character varying(128) DEFAULT ''::character varying NOT NULL, |
|
103 |
vcard text |
|
104 |
); |
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
-- |
b59474
|
109 |
-- Sequence "cache_ids" |
T |
110 |
-- Name: cache_ids; Type: SEQUENCE; Schema: public; Owner: postgres |
|
111 |
-- |
|
112 |
|
|
113 |
CREATE SEQUENCE cache_ids |
|
114 |
INCREMENT BY 1 |
|
115 |
NO MAXVALUE |
|
116 |
NO MINVALUE |
|
117 |
CACHE 1; |
|
118 |
|
|
119 |
-- |
1cded8
|
120 |
-- Table "cache" |
T |
121 |
-- Name: cache; Type: TABLE; Schema: public; Owner: postgres |
|
122 |
-- |
|
123 |
|
|
124 |
CREATE TABLE "cache" ( |
15a9d1
|
125 |
cache_id integer DEFAULT nextval('cache_ids'::text) PRIMARY KEY, |
T |
126 |
user_id integer NOT NULL REFERENCES users (user_id), |
f88d41
|
127 |
session_id character varying(40) REFERENCES "session" (sess_id), |
1cded8
|
128 |
cache_key character varying(128) DEFAULT ''::character varying NOT NULL, |
T |
129 |
created timestamp with time zone DEFAULT now() NOT NULL, |
|
130 |
data text NOT NULL |
|
131 |
); |
|
132 |
|
|
133 |
|
|
134 |
|
|
135 |
-- |
b59474
|
136 |
-- Sequence "message_ids" |
T |
137 |
-- Name: message_ids; Type: SEQUENCE; Schema: public; Owner: postgres |
|
138 |
-- |
|
139 |
|
|
140 |
CREATE SEQUENCE message_ids |
|
141 |
INCREMENT BY 1 |
|
142 |
NO MAXVALUE |
|
143 |
NO MINVALUE |
|
144 |
CACHE 1; |
|
145 |
|
|
146 |
-- |
1cded8
|
147 |
-- Table "messages" |
T |
148 |
-- Name: messages; Type: TABLE; Schema: public; Owner: postgres |
|
149 |
-- |
|
150 |
|
|
151 |
CREATE TABLE "messages" ( |
15a9d1
|
152 |
message_id integer DEFAULT nextval('message_ids'::text) PRIMARY KEY, |
T |
153 |
user_id integer NOT NULL REFERENCES users (user_id), |
1cded8
|
154 |
del integer DEFAULT 0 NOT NULL, |
T |
155 |
cache_key character varying(128) DEFAULT ''::character varying NOT NULL, |
b59474
|
156 |
created timestamp with time zone DEFAULT now() NOT NULL, |
1cded8
|
157 |
idx integer DEFAULT 0 NOT NULL, |
T |
158 |
uid integer DEFAULT 0 NOT NULL, |
|
159 |
subject character varying(128) DEFAULT ''::character varying NOT NULL, |
|
160 |
"from" character varying(128) DEFAULT ''::character varying NOT NULL, |
|
161 |
"to" character varying(128) DEFAULT ''::character varying NOT NULL, |
|
162 |
cc character varying(128) DEFAULT ''::character varying NOT NULL, |
|
163 |
date timestamp with time zone NOT NULL, |
|
164 |
size integer DEFAULT 0 NOT NULL, |
|
165 |
headers text NOT NULL, |
|
166 |
body text |
|
167 |
); |
|
168 |
|