comparison SQL/postgres.initial.sql @ 8:bf99236cc5cd default tip

try to recover from upgrade fail
author Charlie Root
date Sat, 29 Dec 2018 07:07:34 -0500
parents 4681f974d28b
children
comparison
equal deleted inserted replaced
7:65fd7d441cf1 8:bf99236cc5cd
20 user_id integer DEFAULT nextval('users_seq'::text) PRIMARY KEY, 20 user_id integer DEFAULT nextval('users_seq'::text) PRIMARY KEY,
21 username varchar(128) DEFAULT '' NOT NULL, 21 username varchar(128) DEFAULT '' NOT NULL,
22 mail_host varchar(128) DEFAULT '' NOT NULL, 22 mail_host varchar(128) DEFAULT '' NOT NULL,
23 created timestamp with time zone DEFAULT now() NOT NULL, 23 created timestamp with time zone DEFAULT now() NOT NULL,
24 last_login timestamp with time zone DEFAULT NULL, 24 last_login timestamp with time zone DEFAULT NULL,
25 failed_login timestamp with time zone DEFAULT NULL,
26 failed_login_counter integer DEFAULT NULL,
25 "language" varchar(5), 27 "language" varchar(5),
26 preferences text DEFAULT ''::text NOT NULL, 28 preferences text DEFAULT ''::text NOT NULL,
27 CONSTRAINT users_username_key UNIQUE (username, mail_host) 29 CONSTRAINT users_username_key UNIQUE (username, mail_host)
28 ); 30 );
29 31
33 -- Name: session; Type: TABLE; Schema: public; Owner: postgres 35 -- Name: session; Type: TABLE; Schema: public; Owner: postgres
34 -- 36 --
35 37
36 CREATE TABLE "session" ( 38 CREATE TABLE "session" (
37 sess_id varchar(128) DEFAULT '' PRIMARY KEY, 39 sess_id varchar(128) DEFAULT '' PRIMARY KEY,
38 created timestamp with time zone DEFAULT now() NOT NULL,
39 changed timestamp with time zone DEFAULT now() NOT NULL, 40 changed timestamp with time zone DEFAULT now() NOT NULL,
40 ip varchar(41) NOT NULL, 41 ip varchar(41) NOT NULL,
41 vars text NOT NULL 42 vars text NOT NULL
42 ); 43 );
43 44
164 165
165 CREATE TABLE "cache" ( 166 CREATE TABLE "cache" (
166 user_id integer NOT NULL 167 user_id integer NOT NULL
167 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, 168 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
168 cache_key varchar(128) DEFAULT '' NOT NULL, 169 cache_key varchar(128) DEFAULT '' NOT NULL,
169 created timestamp with time zone DEFAULT now() NOT NULL, 170 expires timestamp with time zone DEFAULT NULL,
170 expires timestamp with time zone DEFAULT NULL, 171 data text NOT NULL,
171 data text NOT NULL 172 PRIMARY KEY (user_id, cache_key)
172 ); 173 );
173 174
174 CREATE INDEX cache_user_id_idx ON "cache" (user_id, cache_key);
175 CREATE INDEX cache_expires_idx ON "cache" (expires); 175 CREATE INDEX cache_expires_idx ON "cache" (expires);
176 176
177 -- 177 --
178 -- Table "cache_shared" 178 -- Table "cache_shared"
179 -- Name: cache_shared; Type: TABLE; Schema: public; Owner: postgres 179 -- Name: cache_shared; Type: TABLE; Schema: public; Owner: postgres
180 -- 180 --
181 181
182 CREATE TABLE "cache_shared" ( 182 CREATE TABLE "cache_shared" (
183 cache_key varchar(255) NOT NULL, 183 cache_key varchar(255) NOT NULL PRIMARY KEY,
184 created timestamp with time zone DEFAULT now() NOT NULL,
185 expires timestamp with time zone DEFAULT NULL, 184 expires timestamp with time zone DEFAULT NULL,
186 data text NOT NULL 185 data text NOT NULL
187 ); 186 );
188 187
189 CREATE INDEX cache_shared_cache_key_idx ON "cache_shared" (cache_key);
190 CREATE INDEX cache_shared_expires_idx ON "cache_shared" (expires); 188 CREATE INDEX cache_shared_expires_idx ON "cache_shared" (expires);
191 189
192 -- 190 --
193 -- Table "cache_index" 191 -- Table "cache_index"
194 -- Name: cache_index; Type: TABLE; Schema: public; Owner: postgres 192 -- Name: cache_index; Type: TABLE; Schema: public; Owner: postgres
288 CREATE TABLE "system" ( 286 CREATE TABLE "system" (
289 name varchar(64) NOT NULL PRIMARY KEY, 287 name varchar(64) NOT NULL PRIMARY KEY,
290 value text 288 value text
291 ); 289 );
292 290
293 INSERT INTO system (name, value) VALUES ('roundcube-version', '2015030800'); 291 INSERT INTO system (name, value) VALUES ('roundcube-version', '2016112200');