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 img_name varbinary(255),
10 img_metadata varbinary(max),
12 img_media_type varchar(16),
13 img_major_mime varchar(16),
14 img_minor_mime nvarchar(100),
15 img_description nvarchar(255),
17 img_user_text nvarchar(255),
18 img_timestamp nvarchar(14),
23 SELECT * FROM /*_*/image;--
25 DROP TABLE /*_*/image;--
27 CREATE TABLE /*_*/image (
28 img_name nvarchar(255) NOT NULL default '' PRIMARY KEY,
29 img_size int NOT NULL default 0,
30 img_width int NOT NULL default 0,
31 img_height int NOT NULL default 0,
32 img_metadata varbinary(max) NOT NULL,
33 img_bits int NOT NULL default 0,
34 img_media_type varchar(16) default null,
35 img_major_mime varchar(16) not null default 'unknown',
36 img_minor_mime nvarchar(100) NOT NULL default 'unknown',
37 img_description nvarchar(255) NOT NULL,
38 img_user int REFERENCES /*_*/mwuser(user_id) ON DELETE SET NULL,
39 img_user_text nvarchar(255) NOT NULL,
40 img_timestamp nvarchar(14) NOT NULL default '',
41 img_sha1 nvarchar(32) NOT NULL default '',
42 CONSTRAINT img_major_mime_ckc check (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')),
43 CONSTRAINT img_media_type_ckc check (img_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'))
46 CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp);--
47 CREATE INDEX /*i*/img_size ON /*_*/image (img_size);--
48 CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp);--
49 CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1);--
50 CREATE INDEX /*i*/img_media_mime ON /*_*/image (img_media_type,img_major_mime,img_minor_mime);--
52 INSERT INTO /*_*/image