| 1 | { |
| 2 | "comment": "Make img.img_size an unsigned bigint (T191805)", |
| 3 | "before": |
| 4 | { |
| 5 | "name": "image", |
| 6 | "comment": "Uploaded images and other files.", |
| 7 | "columns": [ |
| 8 | { |
| 9 | "name": "img_name", |
| 10 | "comment": "Filename. This is also the title of the associated description page, which will be in namespace 6 (NS_FILE).", |
| 11 | "type": "binary", |
| 12 | "options": { |
| 13 | "notnull": true, |
| 14 | "default": "", |
| 15 | "length": 255 |
| 16 | } |
| 17 | }, |
| 18 | { |
| 19 | "name": "img_size", |
| 20 | "comment": "File size in bytes.", |
| 21 | "type": "integer", |
| 22 | "options": { |
| 23 | "unsigned": true, |
| 24 | "notnull": true, |
| 25 | "default": 0 |
| 26 | } |
| 27 | }, |
| 28 | { |
| 29 | "name": "img_width", |
| 30 | "comment": "For images, width in pixels.", |
| 31 | "type": "integer", |
| 32 | "options": { |
| 33 | "notnull": true, |
| 34 | "default": 0 |
| 35 | } |
| 36 | }, |
| 37 | { |
| 38 | "name": "img_height", |
| 39 | "comment": "For images, height in pixels.", |
| 40 | "type": "integer", |
| 41 | "options": { |
| 42 | "notnull": true, |
| 43 | "default": 0 |
| 44 | } |
| 45 | }, |
| 46 | { |
| 47 | "name": "img_metadata", |
| 48 | "comment": "Extracted Exif metadata stored as a json array (new system) or serialized PHP array (old system). The json array can contain an address in the text table or external storage.", |
| 49 | "type": "blob", |
| 50 | "options": { |
| 51 | "notnull": true, |
| 52 | "length": 16777215 |
| 53 | } |
| 54 | }, |
| 55 | { |
| 56 | "name": "img_bits", |
| 57 | "comment": "For images, bits per pixel if known.", |
| 58 | "type": "integer", |
| 59 | "options": { |
| 60 | "notnull": true, |
| 61 | "default": 0 |
| 62 | } |
| 63 | }, |
| 64 | { |
| 65 | "name": "img_media_type", |
| 66 | "comment": "Media type as defined by the MEDIATYPE_xxx constants", |
| 67 | "type": "mwenum", |
| 68 | "options": { |
| 69 | "notnull": false, |
| 70 | "default": null, |
| 71 | "CustomSchemaOptions": { |
| 72 | "enum_values": [ "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE", "3D" ] |
| 73 | } |
| 74 | } |
| 75 | }, |
| 76 | { |
| 77 | "name": "img_major_mime", |
| 78 | "comment": "major part of a MIME media type as defined by IANA see https://www.iana.org/assignments/media-types/ for \"chemical\" cf. http://dx.doi.org/10.1021/ci9803233 by the ACS", |
| 79 | "type": "mwenum", |
| 80 | "options": { |
| 81 | "notnull": true, |
| 82 | "default": "unknown", |
| 83 | "CustomSchemaOptions": { |
| 84 | "enum_values": [ "unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical" ] |
| 85 | } |
| 86 | } |
| 87 | }, |
| 88 | { |
| 89 | "name": "img_minor_mime", |
| 90 | "comment": "minor part of a MIME media type as defined by IANA the minor parts are not required to adhere to any standard but should be consistent throughout the database see https://www.iana.org/assignments/media-types/", |
| 91 | "type": "binary", |
| 92 | "options": { |
| 93 | "notnull": true, |
| 94 | "default": "unknown", |
| 95 | "length": 100 |
| 96 | } |
| 97 | }, |
| 98 | { |
| 99 | "name": "img_description_id", |
| 100 | "comment": "Foreign key to comment table, which contains the description field as entered by the uploader. This is displayed in image upload history and logs.", |
| 101 | "type": "bigint", |
| 102 | "options": { |
| 103 | "unsigned": true, |
| 104 | "notnull": true |
| 105 | } |
| 106 | }, |
| 107 | { |
| 108 | "name": "img_actor", |
| 109 | "comment": "actor_id of the uploader.", |
| 110 | "type": "bigint", |
| 111 | "options": { |
| 112 | "unsigned": true, |
| 113 | "notnull": true |
| 114 | } |
| 115 | }, |
| 116 | { |
| 117 | "name": "img_timestamp", |
| 118 | "comment": "Time of the upload.", |
| 119 | "type": "mwtimestamp", |
| 120 | "options": { |
| 121 | "notnull": true |
| 122 | } |
| 123 | }, |
| 124 | { |
| 125 | "name": "img_sha1", |
| 126 | "comment": "SHA-1 content hash in base-36", |
| 127 | "type": "binary", |
| 128 | "options": { |
| 129 | "notnull": true, |
| 130 | "default": "", |
| 131 | "length": 32 |
| 132 | } |
| 133 | } |
| 134 | ], |
| 135 | "indexes": [ |
| 136 | { |
| 137 | "name": "img_actor_timestamp", |
| 138 | "comment": "Used by Special:Newimages and ApiQueryAllImages", |
| 139 | "columns": [ |
| 140 | "img_actor", |
| 141 | "img_timestamp" |
| 142 | ], |
| 143 | "unique": false |
| 144 | }, |
| 145 | { |
| 146 | "name": "img_size", |
| 147 | "comment": "Used by Special:ListFiles for sort-by-size", |
| 148 | "columns": [ |
| 149 | "img_size" |
| 150 | ], |
| 151 | "unique": false |
| 152 | }, |
| 153 | { |
| 154 | "name": "img_timestamp", |
| 155 | "comment": "Used by Special:Newimages and Special:ListFiles", |
| 156 | "columns": [ |
| 157 | "img_timestamp" |
| 158 | ], |
| 159 | "unique": false |
| 160 | }, |
| 161 | { |
| 162 | "name": "img_sha1", |
| 163 | "comment": "Used in API and duplicate search", |
| 164 | "columns": [ |
| 165 | "img_sha1" |
| 166 | ], |
| 167 | "unique": false, |
| 168 | "options": { "lengths": [ 10 ] } |
| 169 | }, |
| 170 | { |
| 171 | "name": "img_media_mime", |
| 172 | "comment": "Used to get media of one type", |
| 173 | "columns": [ |
| 174 | "img_media_type", |
| 175 | "img_major_mime", |
| 176 | "img_minor_mime" |
| 177 | ], |
| 178 | "unique": false |
| 179 | } |
| 180 | ], |
| 181 | "pk": [ |
| 182 | "img_name" |
| 183 | ] |
| 184 | }, |
| 185 | "after": |
| 186 | { |
| 187 | "name": "image", |
| 188 | "comment": "Uploaded images and other files.", |
| 189 | "columns": [ |
| 190 | { |
| 191 | "name": "img_name", |
| 192 | "comment": "Filename. This is also the title of the associated description page, which will be in namespace 6 (NS_FILE).", |
| 193 | "type": "binary", |
| 194 | "options": { |
| 195 | "notnull": true, |
| 196 | "default": "", |
| 197 | "length": 255 |
| 198 | } |
| 199 | }, |
| 200 | { |
| 201 | "name": "img_size", |
| 202 | "comment": "File size in bytes.", |
| 203 | "type": "bigint", |
| 204 | "options": { |
| 205 | "unsigned": true, |
| 206 | "notnull": true, |
| 207 | "default": 0 |
| 208 | } |
| 209 | }, |
| 210 | { |
| 211 | "name": "img_width", |
| 212 | "comment": "For images, width in pixels.", |
| 213 | "type": "integer", |
| 214 | "options": { |
| 215 | "notnull": true, |
| 216 | "default": 0 |
| 217 | } |
| 218 | }, |
| 219 | { |
| 220 | "name": "img_height", |
| 221 | "comment": "For images, height in pixels.", |
| 222 | "type": "integer", |
| 223 | "options": { |
| 224 | "notnull": true, |
| 225 | "default": 0 |
| 226 | } |
| 227 | }, |
| 228 | { |
| 229 | "name": "img_metadata", |
| 230 | "comment": "Extracted Exif metadata stored as a json array (new system) or serialized PHP array (old system). The json array can contain an address in the text table or external storage.", |
| 231 | "type": "blob", |
| 232 | "options": { |
| 233 | "notnull": true, |
| 234 | "length": 16777215 |
| 235 | } |
| 236 | }, |
| 237 | { |
| 238 | "name": "img_bits", |
| 239 | "comment": "For images, bits per pixel if known.", |
| 240 | "type": "integer", |
| 241 | "options": { |
| 242 | "notnull": true, |
| 243 | "default": 0 |
| 244 | } |
| 245 | }, |
| 246 | { |
| 247 | "name": "img_media_type", |
| 248 | "comment": "Media type as defined by the MEDIATYPE_xxx constants", |
| 249 | "type": "mwenum", |
| 250 | "options": { |
| 251 | "notnull": false, |
| 252 | "default": null, |
| 253 | "CustomSchemaOptions": { |
| 254 | "enum_values": [ "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE", "3D" ] |
| 255 | } |
| 256 | } |
| 257 | }, |
| 258 | { |
| 259 | "name": "img_major_mime", |
| 260 | "comment": "major part of a MIME media type as defined by IANA see https://www.iana.org/assignments/media-types/ for \"chemical\" cf. http://dx.doi.org/10.1021/ci9803233 by the ACS", |
| 261 | "type": "mwenum", |
| 262 | "options": { |
| 263 | "notnull": true, |
| 264 | "default": "unknown", |
| 265 | "CustomSchemaOptions": { |
| 266 | "enum_values": [ "unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical" ] |
| 267 | } |
| 268 | } |
| 269 | }, |
| 270 | { |
| 271 | "name": "img_minor_mime", |
| 272 | "comment": "minor part of a MIME media type as defined by IANA the minor parts are not required to adhere to any standard but should be consistent throughout the database see https://www.iana.org/assignments/media-types/", |
| 273 | "type": "binary", |
| 274 | "options": { |
| 275 | "notnull": true, |
| 276 | "default": "unknown", |
| 277 | "length": 100 |
| 278 | } |
| 279 | }, |
| 280 | { |
| 281 | "name": "img_description_id", |
| 282 | "comment": "Foreign key to comment table, which contains the description field as entered by the uploader. This is displayed in image upload history and logs.", |
| 283 | "type": "bigint", |
| 284 | "options": { |
| 285 | "unsigned": true, |
| 286 | "notnull": true |
| 287 | } |
| 288 | }, |
| 289 | { |
| 290 | "name": "img_actor", |
| 291 | "comment": "actor_id of the uploader.", |
| 292 | "type": "bigint", |
| 293 | "options": { |
| 294 | "unsigned": true, |
| 295 | "notnull": true |
| 296 | } |
| 297 | }, |
| 298 | { |
| 299 | "name": "img_timestamp", |
| 300 | "comment": "Time of the upload.", |
| 301 | "type": "mwtimestamp", |
| 302 | "options": { |
| 303 | "notnull": true |
| 304 | } |
| 305 | }, |
| 306 | { |
| 307 | "name": "img_sha1", |
| 308 | "comment": "SHA-1 content hash in base-36", |
| 309 | "type": "binary", |
| 310 | "options": { |
| 311 | "notnull": true, |
| 312 | "default": "", |
| 313 | "length": 32 |
| 314 | } |
| 315 | } |
| 316 | ], |
| 317 | "indexes": [ |
| 318 | { |
| 319 | "name": "img_actor_timestamp", |
| 320 | "comment": "Used by Special:Newimages and ApiQueryAllImages", |
| 321 | "columns": [ |
| 322 | "img_actor", |
| 323 | "img_timestamp" |
| 324 | ], |
| 325 | "unique": false |
| 326 | }, |
| 327 | { |
| 328 | "name": "img_size", |
| 329 | "comment": "Used by Special:ListFiles for sort-by-size", |
| 330 | "columns": [ |
| 331 | "img_size" |
| 332 | ], |
| 333 | "unique": false |
| 334 | }, |
| 335 | { |
| 336 | "name": "img_timestamp", |
| 337 | "comment": "Used by Special:Newimages and Special:ListFiles", |
| 338 | "columns": [ |
| 339 | "img_timestamp" |
| 340 | ], |
| 341 | "unique": false |
| 342 | }, |
| 343 | { |
| 344 | "name": "img_sha1", |
| 345 | "comment": "Used in API and duplicate search", |
| 346 | "columns": [ |
| 347 | "img_sha1" |
| 348 | ], |
| 349 | "unique": false, |
| 350 | "options": { "lengths": [ 10 ] } |
| 351 | }, |
| 352 | { |
| 353 | "name": "img_media_mime", |
| 354 | "comment": "Used to get media of one type", |
| 355 | "columns": [ |
| 356 | "img_media_type", |
| 357 | "img_major_mime", |
| 358 | "img_minor_mime" |
| 359 | ], |
| 360 | "unique": false |
| 361 | } |
| 362 | ], |
| 363 | "pk": [ |
| 364 | "img_name" |
| 365 | ] |
| 366 | } |
| 367 | |
| 368 | } |