changeset 38:176b68335f52

Drop table quotes and add index on reminders
author Lewin Bormann <lbo@spheniscida.de>
date Sat, 10 Dec 2016 15:06:35 +0100
parents 6a6cf067fbff
children 3cc9ebfc1137
files schema.sql
diffstat 1 files changed, 3 insertions(+), 67 deletions(-) [+]
line wrap: on
line diff
--- a/schema.sql	Sat Dec 10 14:29:48 2016 +0100
+++ b/schema.sql	Sat Dec 10 15:06:35 2016 +0100
@@ -16,23 +16,18 @@
 SET search_path = public, pg_catalog;
 
 DROP INDEX public.todo_done_chat_id_list_idx;
-DROP INDEX public.quotes_quoted_idx;
-DROP INDEX public.quotes_chat_id_idx;
+DROP INDEX public.reminders_due_done_idx;
 DROP INDEX public.fortunes_used_idx;
 ALTER TABLE ONLY public.todo DROP CONSTRAINT todo_pkey;
 ALTER TABLE ONLY public.reminders DROP CONSTRAINT reminders_pkey;
-ALTER TABLE ONLY public.quotes DROP CONSTRAINT quotes_pkey;
 ALTER TABLE ONLY public.fortunes DROP CONSTRAINT fortunes_pkey;
 ALTER TABLE public.todo ALTER COLUMN id DROP DEFAULT;
 ALTER TABLE public.reminders ALTER COLUMN id DROP DEFAULT;
-ALTER TABLE public.quotes ALTER COLUMN id DROP DEFAULT;
 ALTER TABLE public.fortunes ALTER COLUMN id DROP DEFAULT;
 DROP SEQUENCE public.todo_id_seq;
 DROP TABLE public.todo;
 DROP SEQUENCE public.reminders_id_seq;
 DROP TABLE public.reminders;
-DROP SEQUENCE public.quotes_id_seq;
-DROP TABLE public.quotes;
 DROP SEQUENCE public.fortunes_id_seq;
 DROP TABLE public.fortunes;
 DROP EXTENSION plpgsql;
@@ -109,43 +104,6 @@
 
 
 --
--- Name: quotes; Type: TABLE; Schema: public; Owner: goe_bot
---
-
-CREATE TABLE quotes (
-    id integer NOT NULL,
-    ts timestamp without time zone,
-    quote text,
-    owner text,
-    quoted integer DEFAULT 0,
-    chat_id integer
-);
-
-
-ALTER TABLE quotes OWNER TO goe_bot;
-
---
--- Name: quotes_id_seq; Type: SEQUENCE; Schema: public; Owner: goe_bot
---
-
-CREATE SEQUENCE quotes_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-ALTER TABLE quotes_id_seq OWNER TO goe_bot;
-
---
--- Name: quotes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: goe_bot
---
-
-ALTER SEQUENCE quotes_id_seq OWNED BY quotes.id;
-
-
---
 -- Name: reminders; Type: TABLE; Schema: public; Owner: goe_bot
 --
 
@@ -231,13 +189,6 @@
 -- Name: id; Type: DEFAULT; Schema: public; Owner: goe_bot
 --
 
-ALTER TABLE ONLY quotes ALTER COLUMN id SET DEFAULT nextval('quotes_id_seq'::regclass);
-
-
---
--- Name: id; Type: DEFAULT; Schema: public; Owner: goe_bot
---
-
 ALTER TABLE ONLY reminders ALTER COLUMN id SET DEFAULT nextval('reminders_id_seq'::regclass);
 
 
@@ -257,14 +208,6 @@
 
 
 --
--- Name: quotes_pkey; Type: CONSTRAINT; Schema: public; Owner: goe_bot
---
-
-ALTER TABLE ONLY quotes
-    ADD CONSTRAINT quotes_pkey PRIMARY KEY (id);
-
-
---
 -- Name: reminders_pkey; Type: CONSTRAINT; Schema: public; Owner: goe_bot
 --
 
@@ -288,17 +231,10 @@
 
 
 --
--- Name: quotes_chat_id_idx; Type: INDEX; Schema: public; Owner: goe_bot
+-- Name: reminders_due_done_idx; Type: INDEX; Schema: public; Owner: goe_bot
 --
 
-CREATE INDEX quotes_chat_id_idx ON quotes USING btree (chat_id);
-
-
---
--- Name: quotes_quoted_idx; Type: INDEX; Schema: public; Owner: goe_bot
---
-
-CREATE INDEX quotes_quoted_idx ON quotes USING btree (quoted);
+CREATE INDEX reminders_due_done_idx ON reminders USING btree (due, done);
 
 
 --