Index: trunk/extensions/LiquidThreads/lqt.pg.sql |
— | — | @@ -2,25 +2,26 @@ |
3 | 3 | |
4 | 4 | BEGIN; |
5 | 5 | |
6 | | -CREATE SEQUENCE thread_thread_id_seq; |
| 6 | +CREATE SEQUENCE thread_thread_id; |
7 | 7 | CREATE TABLE thread ( |
8 | | - thread_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('thread_thread_id_seq'), |
9 | | - thread_root INTEGER NOT NULL, |
| 8 | + thread_id INTEGER NULL PRIMARY KEY DEFAULT nextval('thread_thread_id'), |
| 9 | + thread_root INTEGER NOT NULL UNIQUE, |
10 | 10 | thread_ancestor INTEGER NOT NULL, |
11 | | - thread_parent INTEGER NOT NULL, |
12 | | - thread_summary_page INTEGER NOT NULL, |
| 11 | + thread_parent INTEGER NULL, |
| 12 | + thread_summary_page INTEGER NULL, |
13 | 13 | thread_subject TEXT NULL, |
14 | 14 | thread_author_id INTEGER NULL, |
15 | 15 | thread_author_name TEXT NULL, |
16 | | - thread_modified TIMESTAMPTZ NULL DEFAULT now(), |
17 | | - thread_created TIMESTAMPTZ NULL DEFAULT now(), |
| 16 | + thread_modified TIMESTAMPTZ NOT NULL DEFAULT now(), |
| 17 | + thread_created TIMESTAMPTZ NOT NULL DEFAULT now(), |
18 | 18 | thread_editedness SMALLINT NOT NULL DEFAULT 0, |
19 | 19 | thread_article_namespace SMALLINT NOT NULL, |
20 | 20 | thread_article_title TEXT NOT NULL, |
21 | 21 | thread_article_id INTEGER NOT NULL, |
22 | 22 | thread_type SMALLINT NOT NULL DEFAULT 0, |
23 | 23 | thread_sortkey TEXT NOT NULL DEFAULT '', |
24 | | - thread_replies INTEGER NOT NULL DEFAULT -1 |
| 24 | + thread_replies INTEGER NOT NULL DEFAULT -1, |
| 25 | + thread_signature varchar(255) NULL |
25 | 26 | ); |
26 | 27 | |
27 | 28 | CREATE UNIQUE INDEX thread_root_page ON thread(thread_root); |
— | — | @@ -38,7 +39,7 @@ |
39 | 40 | hthread_revision INTEGER NOT NULL, |
40 | 41 | hthread_contents TEXT NOT NULL, |
41 | 42 | hthread_change_type INTEGER NOT NULL, |
42 | | - hthread_change_object INTEGER NOT NULL |
| 43 | + hthread_change_object INTEGER NULL |
43 | 44 | ); |
44 | 45 | CREATE UNIQUE INDEX historical_thread_unique ON historical_thread(hthread_id, hthread_revision); |
45 | 46 | |
— | — | @@ -49,9 +50,9 @@ |
50 | 51 | ); |
51 | 52 | CREATE UNIQUE INDEX user_message_state_unique ON user_message_state(ums_user, ums_thread); |
52 | 53 | |
53 | | -CREATE SEQUENCE thread_history_th_id_seq; |
| 54 | +CREATE SEQUENCE thread_history_th_id; |
54 | 55 | CREATE TABLE thread_history ( |
55 | | - th_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('thread_history_th_id_seq'), |
| 56 | + th_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('thread_history_th_id'), |
56 | 57 | th_thread INTEGER NOT NULL, |
57 | 58 | th_timestamp TEXT NOT NULL, |
58 | 59 | th_user INTEGER NOT NULL, |