2 -- patch-comment-table.sql
4 -- T166732. Add a `comment` table, and temporary tables to reference it.
6 CREATE SEQUENCE comment_comment_id_seq
;
8 comment_id
INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('comment_comment_id_seq'),
9 comment_hash
INTEGER NOT NULL,
10 comment_text
TEXT NOT NULL,
13 CREATE INDEX comment_hash
ON comment (comment_hash
);
15 CREATE TABLE revision_comment_temp (
16 revcomment_rev
INTEGER NOT NULL,
17 revcomment_comment_id
INTEGER NOT NULL,
18 PRIMARY KEY (revcomment_rev
, revcomment_comment_id
)
20 CREATE UNIQUE INDEX revcomment_rev
ON revision_comment_temp (revcomment_rev
);
22 CREATE TABLE image_comment_temp (
23 imgcomment_name
TEXT NOT NULL,
24 imgcomment_description_id
INTEGER NOT NULL,
25 PRIMARY KEY (imgcomment_name
, imgcomment_description_id
)
27 CREATE UNIQUE INDEX imgcomment_name
ON image_comment_temp (imgcomment_name
);