thomascube
2005-10-07 42b11351497ce67e96a0465c76694632cdfb3ecb
commit | author | age
f5dc2a 1 --
S 2 -- PostgreSQL database dump
3 --
4
5 SET client_encoding = 'UNICODE';
6 SET check_function_bodies = false;
7 SET search_path = public, pg_catalog;
8
9 ALTER TABLE ONLY public.identities DROP CONSTRAINT "$1";
10 ALTER TABLE ONLY public.contacts DROP CONSTRAINT "$1";
11 ALTER TABLE ONLY public."cache" DROP CONSTRAINT "$2";
12 ALTER TABLE ONLY public."cache" DROP CONSTRAINT "$1";
13 ALTER TABLE ONLY public.users DROP CONSTRAINT users_pkey;
14 ALTER TABLE ONLY public."session" DROP CONSTRAINT session_pkey;
15 ALTER TABLE ONLY public.identities DROP CONSTRAINT identities_pkey;
16 ALTER TABLE ONLY public.contacts DROP CONSTRAINT contacts_pkey;
17 ALTER TABLE ONLY public."cache" DROP CONSTRAINT cache_pkey;
18 DROP TABLE public.users;
19 DROP TABLE public."session";
20 DROP TABLE public.identities;
21 DROP TABLE public.contacts;
22 DROP TABLE public."cache";
23 DROP SEQUENCE public.user_ids;
24 DROP SEQUENCE public.identity_ids;
25 DROP SEQUENCE public.contact_ids;
26 DROP SEQUENCE public.cache_ids;
27 --
28 -- TOC entry 4 (OID 15282470)
29 -- Name: cache_ids; Type: SEQUENCE; Schema: public; Owner: postgres
30 --
31
32 CREATE SEQUENCE cache_ids
33     INCREMENT BY 1
34     NO MAXVALUE
35     NO MINVALUE
36     CACHE 1;
37
38
39 --
40 -- TOC entry 5 (OID 15282472)
41 -- Name: contact_ids; Type: SEQUENCE; Schema: public; Owner: postgres
42 --
43
44 CREATE SEQUENCE contact_ids
45     START WITH 1
46     INCREMENT BY 1
47     NO MAXVALUE
48     NO MINVALUE
49     CACHE 1;
50
51
52 --
53 -- TOC entry 6 (OID 15282474)
54 -- Name: identity_ids; Type: SEQUENCE; Schema: public; Owner: postgres
55 --
56
57 CREATE SEQUENCE identity_ids
58     START WITH 1
59     INCREMENT BY 1
60     NO MAXVALUE
61     NO MINVALUE
62     CACHE 1;
63
64
65 --
66 -- TOC entry 7 (OID 15282476)
67 -- Name: user_ids; Type: SEQUENCE; Schema: public; Owner: postgres
68 --
69
70 CREATE SEQUENCE user_ids
71     INCREMENT BY 1
72     NO MAXVALUE
73     NO MINVALUE
74     CACHE 1;
75
76
77 --
78 -- TOC entry 8 (OID 15282478)
79 -- Name: cache; Type: TABLE; Schema: public; Owner: postgres
80 --
81
82 CREATE TABLE "cache" (
83     cache_id integer DEFAULT nextval('cache_ids'::text) NOT NULL,
84     user_id integer DEFAULT 0 NOT NULL,
85     session_id character varying(32),
86     cache_key character varying(128) DEFAULT ''::character varying NOT NULL,
87     created timestamp with time zone DEFAULT now() NOT NULL,
88     data text NOT NULL
89 );
90
91
92 --
93 -- TOC entry 10 (OID 15282486)
94 -- Name: contacts; Type: TABLE; Schema: public; Owner: postgres
95 --
96
97 CREATE TABLE contacts (
98     contact_id integer DEFAULT nextval('contact_ids'::text) NOT NULL,
99     user_id integer DEFAULT 0 NOT NULL,
100     del boolean DEFAULT false NOT NULL,
101     name character varying(128) DEFAULT ''::character varying NOT NULL,
102     email character varying(128) DEFAULT ''::character varying NOT NULL,
103     firstname character varying(128) DEFAULT ''::character varying NOT NULL,
104     surname character varying(128) DEFAULT ''::character varying NOT NULL,
105     vcard text NOT NULL
106 );
107
108
109 --
110 -- TOC entry 11 (OID 15282494)
111 -- Name: identities; Type: TABLE; Schema: public; Owner: postgres
112 --
113
114 CREATE TABLE identities (
115     identity_id integer DEFAULT nextval('identity_ids'::text) NOT NULL,
116     user_id integer DEFAULT 0 NOT NULL,
117     del boolean DEFAULT false NOT NULL,
118     "default" boolean DEFAULT false NOT NULL,
119     name character varying(128) NOT NULL,
120     organization character varying(128) NOT NULL,
121     email character varying(128) NOT NULL,
122     "reply-to" character varying(128) NOT NULL,
123     bcc character varying(128) NOT NULL,
124     signature text NOT NULL
125 );
126
127
128 --
129 -- TOC entry 12 (OID 15282503)
130 -- Name: session; Type: TABLE; Schema: public; Owner: postgres
131 --
132
133 CREATE TABLE "session" (
134     sess_id character varying(32) DEFAULT ''::character varying NOT NULL,
135     created timestamp with time zone DEFAULT now() NOT NULL,
136     changed timestamp with time zone DEFAULT now() NOT NULL,
137     vars text NOT NULL
138 );
139
140
141 --
142 -- TOC entry 13 (OID 15282510)
143 -- Name: users; Type: TABLE; Schema: public; Owner: postgres
144 --
145
146 CREATE TABLE users (
147     user_id integer DEFAULT nextval('user_ids'::text) NOT NULL,
148     username character varying(128) DEFAULT ''::character varying NOT NULL,
149     mail_host character varying(128) DEFAULT ''::character varying NOT NULL,
42b113 150     alias character varying(128) DEFAULT ''::character varying NOT NULL,
f5dc2a 151     created timestamp with time zone DEFAULT now() NOT NULL,
S 152     last_login timestamp with time zone DEFAULT now() NOT NULL,
153     "language" character varying(5) DEFAULT 'en'::character varying NOT NULL,
154     preferences text DEFAULT ''::text NOT NULL
155 );
156
157
158 --
159 -- TOC entry 14 (OID 15282518)
160 -- Name: cache_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
161 --
162
163 ALTER TABLE ONLY "cache"
164     ADD CONSTRAINT cache_pkey PRIMARY KEY (cache_id);
165
166
167 --
168 -- TOC entry 15 (OID 15282520)
169 -- Name: contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
170 --
171
172 ALTER TABLE ONLY contacts
173     ADD CONSTRAINT contacts_pkey PRIMARY KEY (contact_id);
174
175
176 --
177 -- TOC entry 16 (OID 15282522)
178 -- Name: identities_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
179 --
180
181 ALTER TABLE ONLY identities
182     ADD CONSTRAINT identities_pkey PRIMARY KEY (identity_id);
183
184
185 --
186 -- TOC entry 17 (OID 15282524)
187 -- Name: session_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
188 --
189
190 ALTER TABLE ONLY "session"
191     ADD CONSTRAINT session_pkey PRIMARY KEY (sess_id);
192
193
194 --
195 -- TOC entry 18 (OID 15282526)
196 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
197 --
198
199 ALTER TABLE ONLY users
200     ADD CONSTRAINT users_pkey PRIMARY KEY (user_id);
201
202
203 --
204 -- TOC entry 19 (OID 15282528)
205 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
206 --
207
208 ALTER TABLE ONLY "cache"
209     ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id);
210
211
212 --
213 -- TOC entry 20 (OID 15282532)
214 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
215 --
216
217 ALTER TABLE ONLY "cache"
218     ADD CONSTRAINT "$2" FOREIGN KEY (session_id) REFERENCES "session"(sess_id);
219
220
221 --
222 -- TOC entry 21 (OID 15282536)
223 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
224 --
225
226 ALTER TABLE ONLY contacts
227     ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id);
228
229
230 --
231 -- TOC entry 22 (OID 15282540)
232 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
233 --
234
235 ALTER TABLE ONLY identities
236     ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id);
237
238
239 SET SESSION AUTHORIZATION 'postgres';
240
241 --
242 -- TOC entry 3 (OID 15282469)
243 -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
244 --
245
246 COMMENT ON SCHEMA public IS 'Standard public schema';
247
248
249 SET SESSION AUTHORIZATION 'postgres';
250
251 --
252 -- TOC entry 9 (OID 15282478)
253 -- Name: TABLE "cache"; Type: COMMENT; Schema: public; Owner: postgres
254 --