summaryrefslogtreecommitdiff
path: root/SQL/postgres.initial.sql
diff options
context:
space:
mode:
Diffstat (limited to 'SQL/postgres.initial.sql')
-rw-r--r--SQL/postgres.initial.sql5
1 files changed, 3 insertions, 2 deletions
diff --git a/SQL/postgres.initial.sql b/SQL/postgres.initial.sql
index 05c61924a..88f12af66 100644
--- a/SQL/postgres.initial.sql
+++ b/SQL/postgres.initial.sql
@@ -152,7 +152,7 @@ CREATE SEQUENCE message_ids
-- Name: messages; Type: TABLE; Schema: public; Owner: postgres
--
-CREATE TABLE "messages" (
+CREATE TABLE messages (
message_id integer DEFAULT nextval('message_ids'::text) PRIMARY KEY,
user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
del integer DEFAULT 0 NOT NULL,
@@ -170,4 +170,5 @@ CREATE TABLE "messages" (
structure text
);
-ALTER TABLE "messages" ADD UNIQUE (user_id, cache_key, uid);
+ALTER TABLE messages ADD UNIQUE (user_id, cache_key, uid);
+CREATE INDEX messages_created_idx ON messages (created);