forked from wikimedia/mediawiki-extensions-Drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrafts.pg.sql
More file actions
36 lines (32 loc) · 1.06 KB
/
Drafts.pg.sql
File metadata and controls
36 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--
-- SQL for Drafts Extension
--
-- Table for storing working changes to pages that
-- users have yet to commit.
-- Postgres version
-- See Drafts.sql for notes on each column
BEGIN;
CREATE SEQUENCE drafts_id_seq;
CREATE TABLE drafts (
draft_id INTEGER NOT NULL DEFAULT nextval('drafts_id_seq'),
draft_token TEXT,
draft_user INTEGER NOT NULL DEFAULT 0,
draft_page INTEGER NOT NULL default 0,
draft_namespace INTEGER NOT NULL,
draft_title TEXT NOT NULL DEFAULT '',
draft_section SMALLINT,
draft_starttime TIMESTAMPTZ,
draft_edittime TIMESTAMPTZ,
draft_savetime TIMESTAMPTZ,
draft_scrolltop INTEGER,
draft_text TEXT NOT NULL,
draft_summary TEXT,
draft_minoredit SMALLINT,
PRIMARY KEY (draft_id)
);
-- Todo: determine which of these are really needed
CREATE INDEX draft_user_savetime ON drafts(draft_user, draft_savetime);
CREATE INDEX draft_user_page_savetime ON drafts(draft_user, draft_page, draft_namespace, draft_title, draft_savetime);
CREATE INDEX draft_savetime ON drafts(draft_savetime);
CREATE INDEX draft_page ON drafts(draft_page);
COMMIT;