1 -- MediaWiki looks for lines ending with semicolons and sends them as separate queries
2 -- However here we *really* need this all to be sent as a single batch. As such, DO NOT
3 -- remove the -- from the end of each statement.
6 oi_name varbinary(255),
7 oi_archive_name varbinary(255),
12 oi_description nvarchar(255),
14 oi_user_text nvarchar(255),
15 oi_timestamp varchar(14),
16 oi_metadata nvarchar(max),
17 oi_media_type varchar(16),
18 oi_major_mime varchar(16),
19 oi_minor_mime nvarchar(100),
25 SELECT * FROM /*_*/oldimage;--
27 DROP TABLE /*_*/oldimage;--
29 CREATE TABLE /*_*/oldimage (
30 oi_name nvarchar(255) NOT NULL default '',
31 oi_archive_name nvarchar(255) NOT NULL default '',
32 oi_size int NOT NULL default 0,
33 oi_width int NOT NULL default 0,
34 oi_height int NOT NULL default 0,
35 oi_bits int NOT NULL default 0,
36 oi_description nvarchar(255) NOT NULL,
37 oi_user int REFERENCES /*_*/mwuser(user_id),
38 oi_user_text nvarchar(255) NOT NULL,
39 oi_timestamp varchar(14) NOT NULL default '',
40 oi_metadata varbinary(max) NOT NULL,
41 oi_media_type varchar(16) default null,
42 oi_major_mime varchar(16) not null default 'unknown',
43 oi_minor_mime nvarchar(100) NOT NULL default 'unknown',
44 oi_deleted tinyint NOT NULL default 0,
45 oi_sha1 nvarchar(32) NOT NULL default '',
46 CONSTRAINT oi_major_mime_ckc check (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')),
47 CONSTRAINT oi_media_type_ckc check (oi_media_type IN('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'))
50 CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text, oi_timestamp);--
51 CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name, oi_timestamp);--
52 CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name, oi_archive_name);--
53 CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1);--
55 INSERT INTO /*_*/oldimage
85 CONVERT(varbinary(max), oi_metadata, 0),