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.
8 fa_archive_name nvarchar(255),
9 fa_storage_group nvarchar(16),
10 fa_storage_key nvarchar(64),
12 fa_deleted_timestamp varchar(14),
13 fa_deleted_reason nvarchar(max),
17 fa_metadata nvarchar(max),
19 fa_media_type varchar(16),
20 fa_major_mime varchar(16),
21 fa_minor_mime nvarchar(100),
22 fa_description nvarchar(255),
24 fa_user_text nvarchar(255),
25 fa_timestamp varchar(14),
31 SELECT * FROM /*_*/filearchive;--
33 DROP TABLE /*_*/filearchive;--
35 CREATE TABLE /*_*/filearchive (
36 fa_id int NOT NULL PRIMARY KEY IDENTITY,
37 fa_name nvarchar(255) NOT NULL default '',
38 fa_archive_name nvarchar(255) default '',
39 fa_storage_group nvarchar(16),
40 fa_storage_key nvarchar(64) default '',
42 fa_deleted_timestamp varchar(14) default '',
43 fa_deleted_reason nvarchar(max),
44 fa_size int default 0,
45 fa_width int default 0,
46 fa_height int default 0,
47 fa_metadata varbinary(max),
48 fa_bits int default 0,
49 fa_media_type varchar(16) default null,
50 fa_major_mime varchar(16) not null default 'unknown',
51 fa_minor_mime nvarchar(100) default 'unknown',
52 fa_description nvarchar(255),
53 fa_user int default 0 REFERENCES /*_*/mwuser(user_id) ON DELETE SET NULL,
54 fa_user_text nvarchar(255),
55 fa_timestamp varchar(14) default '',
56 fa_deleted tinyint NOT NULL default 0,
57 fa_sha1 nvarchar(32) NOT NULL default '',
58 CONSTRAINT fa_major_mime_ckc check (fa_major_mime in('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')),
59 CONSTRAINT fa_media_type_ckc check (fa_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'))
62 CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp);--
63 CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key);--
64 CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);--
65 CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp);--
66 CREATE INDEX /*i*/fa_sha1 ON /*_*/filearchive (fa_sha1);--
68 SET IDENTITY_INSERT /*_*/filearchive ON;--
70 INSERT INTO /*_*/filearchive
102 fa_deleted_timestamp,
107 CONVERT(varbinary(max), fa_metadata, 0),
120 SET IDENTITY_INSERT /*_*/filearchive OFF;