1 -- T182678: Make ar_rev_id not nullable
5 DROP TABLE IF EXISTS /*_*/archive_tmp
;
6 CREATE TABLE /*_*/archive_tmp (
7 ar_id
int unsigned
NOT NULL PRIMARY KEY AUTO_INCREMENT
,
8 ar_namespace
int NOT NULL default 0,
9 ar_title
varchar(255) binary NOT NULL default '',
10 ar_text mediumblob
NOT NULL,
11 ar_comment
varbinary(767) NOT NULL default '',
12 ar_comment_id
bigint unsigned
NOT NULL DEFAULT 0,
13 ar_user
int unsigned
NOT NULL default 0,
14 ar_user_text
varchar(255) binary NOT NULL DEFAULT '',
15 ar_actor
bigint unsigned
NOT NULL DEFAULT 0,
16 ar_timestamp
binary(14) NOT NULL default '',
17 ar_minor_edit tinyint
NOT NULL default 0,
18 ar_flags tinyblob
NOT NULL,
19 ar_rev_id
int unsigned
NOT NULL,
20 ar_text_id
int unsigned
,
21 ar_deleted tinyint unsigned
NOT NULL default 0,
23 ar_page_id
int unsigned
,
24 ar_parent_id
int unsigned
default NULL,
25 ar_sha1
varbinary(32) NOT NULL default '',
26 ar_content_model
varbinary(32) DEFAULT NULL,
27 ar_content_format
varbinary(64) DEFAULT NULL
28 ) /*$wgDBTableOptions*/;
30 INSERT OR IGNORE INTO /*_*/archive_tmp (
31 ar_id
, ar_namespace
, ar_title
, ar_text
, ar_comment
, ar_comment_id
, ar_user
,
32 ar_user_text
, ar_actor
, ar_timestamp
, ar_minor_edit
, ar_flags
, ar_rev_id
,
33 ar_text_id
, ar_deleted
, ar_len
, ar_page_id
, ar_parent_id
, ar_sha1
,
34 ar_content_model
, ar_content_format
)
36 ar_id
, ar_namespace
, ar_title
, ar_text
, ar_comment
, ar_comment_id
, ar_user
,
37 ar_user_text
, ar_actor
, ar_timestamp
, ar_minor_edit
, ar_flags
, ar_rev_id
,
38 ar_text_id
, ar_deleted
, ar_len
, ar_page_id
, ar_parent_id
, ar_sha1
,
39 ar_content_model
, ar_content_format
42 DROP TABLE /*_*/archive
;
43 ALTER TABLE /*_*/archive_tmp
RENAME TO /*_*/archive
;
44 CREATE INDEX /*i*/name_title_timestamp
ON /*_*/archive (ar_namespace
,ar_title
,ar_timestamp
);
45 CREATE INDEX /*i*/ar_usertext_timestamp
ON /*_*/archive (ar_user_text
,ar_timestamp
);
46 CREATE INDEX /*i*/ar_actor_timestamp
ON /*_*/archive (ar_actor
,ar_timestamp
);
47 CREATE INDEX /*i*/ar_revid
ON /*_*/archive (ar_rev_id
);