| 1 | { |
| 2 | "comment": "Increase fa_size to bigint (T191805)", |
| 3 | "before": |
| 4 | { |
| 5 | "name": "filearchive", |
| 6 | "comment": "Record of deleted file data", |
| 7 | "columns": [ |
| 8 | { |
| 9 | "name": "fa_id", |
| 10 | "comment": "Unique row id", |
| 11 | "type": "integer", |
| 12 | "options": { |
| 13 | "autoincrement": true, |
| 14 | "unsigned": true, |
| 15 | "notnull": true |
| 16 | } |
| 17 | }, |
| 18 | { |
| 19 | "name": "fa_name", |
| 20 | "comment": "Original base filename; key to image.img_name, page.page_title, etc", |
| 21 | "type": "binary", |
| 22 | "options": { |
| 23 | "notnull": true, |
| 24 | "default": "", |
| 25 | "length": 255 |
| 26 | } |
| 27 | }, |
| 28 | { |
| 29 | "name": "fa_archive_name", |
| 30 | "comment": "Filename of archived file, if an old revision", |
| 31 | "type": "binary", |
| 32 | "options": { |
| 33 | "notnull": false, |
| 34 | "default": "", |
| 35 | "length": 255 |
| 36 | } |
| 37 | }, |
| 38 | { |
| 39 | "name": "fa_storage_group", |
| 40 | "comment": "Which storage bin (directory tree or object store) the file data is stored in. Should be 'deleted' for files that have been deleted; any other bin is not yet in use.", |
| 41 | "type": "binary", |
| 42 | "options": { |
| 43 | "notnull": false, |
| 44 | "length": 16 |
| 45 | } |
| 46 | }, |
| 47 | { |
| 48 | "name": "fa_storage_key", |
| 49 | "comment": "SHA-1 of the file contents plus extension, used as a key for storage. eg 8f8a562add37052a1848ff7771a2c515db94baa9.jpg. If NULL, the file was missing at deletion time or has been purged from the archival storage.", |
| 50 | "type": "binary", |
| 51 | "options": { |
| 52 | "notnull": false, |
| 53 | "default": "", |
| 54 | "length": 64 |
| 55 | } |
| 56 | }, |
| 57 | { |
| 58 | "name": "fa_deleted_user", |
| 59 | "type": "integer", |
| 60 | "options": { |
| 61 | "notnull": false |
| 62 | } |
| 63 | }, |
| 64 | { |
| 65 | "name": "fa_deleted_timestamp", |
| 66 | "type": "mwtimestamp", |
| 67 | "options": { |
| 68 | "notnull": false |
| 69 | } |
| 70 | }, |
| 71 | { |
| 72 | "name": "fa_deleted_reason_id", |
| 73 | "type": "bigint", |
| 74 | "options": { |
| 75 | "unsigned": true, |
| 76 | "notnull": true |
| 77 | } |
| 78 | }, |
| 79 | { |
| 80 | "name": "fa_size", |
| 81 | "type": "integer", |
| 82 | "options": { |
| 83 | "unsigned": true, |
| 84 | "notnull": false, |
| 85 | "default": 0 |
| 86 | } |
| 87 | }, |
| 88 | { |
| 89 | "name": "fa_width", |
| 90 | "type": "integer", |
| 91 | "options": { |
| 92 | "notnull": false, |
| 93 | "default": 0 |
| 94 | } |
| 95 | }, |
| 96 | { |
| 97 | "name": "fa_height", |
| 98 | "type": "integer", |
| 99 | "options": { |
| 100 | "notnull": false, |
| 101 | "default": 0 |
| 102 | } |
| 103 | }, |
| 104 | { |
| 105 | "name": "fa_metadata", |
| 106 | "type": "blob", |
| 107 | "options": { |
| 108 | "notnull": false, |
| 109 | "length": 16777215 |
| 110 | } |
| 111 | }, |
| 112 | { |
| 113 | "name": "fa_bits", |
| 114 | "type": "integer", |
| 115 | "options": { |
| 116 | "notnull": false, |
| 117 | "default": 0 |
| 118 | } |
| 119 | }, |
| 120 | { |
| 121 | "name": "fa_media_type", |
| 122 | "type": "mwenum", |
| 123 | "options": { |
| 124 | "notnull": false, |
| 125 | "default": null, |
| 126 | "CustomSchemaOptions": { |
| 127 | "enum_values": [ "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE", "3D" ] |
| 128 | } |
| 129 | } |
| 130 | }, |
| 131 | { |
| 132 | "name": "fa_major_mime", |
| 133 | "type": "mwenum", |
| 134 | "options": { |
| 135 | "notnull": false, |
| 136 | "default": "unknown", |
| 137 | "CustomSchemaOptions": { |
| 138 | "enum_values": [ "unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical" ] |
| 139 | } |
| 140 | } |
| 141 | }, |
| 142 | { |
| 143 | "name": "fa_minor_mime", |
| 144 | "type": "binary", |
| 145 | "options": { |
| 146 | "notnull": false, |
| 147 | "default": "unknown", |
| 148 | "length": 100 |
| 149 | } |
| 150 | }, |
| 151 | { |
| 152 | "name": "fa_description_id", |
| 153 | "type": "bigint", |
| 154 | "options": { |
| 155 | "unsigned": true, |
| 156 | "notnull": true |
| 157 | } |
| 158 | }, |
| 159 | { |
| 160 | "name": "fa_actor", |
| 161 | "type": "bigint", |
| 162 | "options": { |
| 163 | "unsigned": true, |
| 164 | "notnull": true |
| 165 | } |
| 166 | }, |
| 167 | { |
| 168 | "name": "fa_timestamp", |
| 169 | "type": "mwtimestamp", |
| 170 | "options": { |
| 171 | "notnull": false |
| 172 | } |
| 173 | }, |
| 174 | { |
| 175 | "name": "fa_deleted", |
| 176 | "comment": "Visibility of deleted revisions, bitfield", |
| 177 | "type": "mwtinyint", |
| 178 | "options": { |
| 179 | "unsigned": true, |
| 180 | "notnull": true, |
| 181 | "default": 0 |
| 182 | } |
| 183 | }, |
| 184 | { |
| 185 | "name": "fa_sha1", |
| 186 | "comment": "sha1 hash of file content", |
| 187 | "type": "binary", |
| 188 | "options": { |
| 189 | "notnull": true, |
| 190 | "default": "", |
| 191 | "length": 32 |
| 192 | } |
| 193 | } |
| 194 | ], |
| 195 | "indexes": [ |
| 196 | { |
| 197 | "name": "fa_name", |
| 198 | "comment": "pick out by image name", |
| 199 | "columns": [ |
| 200 | "fa_name", |
| 201 | "fa_timestamp" |
| 202 | ], |
| 203 | "unique": false |
| 204 | }, |
| 205 | { |
| 206 | "name": "fa_storage_group", |
| 207 | "comment": "pick out dupe files", |
| 208 | "columns": [ |
| 209 | "fa_storage_group", |
| 210 | "fa_storage_key" |
| 211 | ], |
| 212 | "unique": false |
| 213 | }, |
| 214 | { |
| 215 | "name": "fa_deleted_timestamp", |
| 216 | "comment": "sort by deletion time", |
| 217 | "columns": [ |
| 218 | "fa_deleted_timestamp" |
| 219 | ], |
| 220 | "unique": false |
| 221 | }, |
| 222 | { |
| 223 | "name": "fa_actor_timestamp", |
| 224 | "comment": "sort by uploader", |
| 225 | "columns": [ |
| 226 | "fa_actor", |
| 227 | "fa_timestamp" |
| 228 | ], |
| 229 | "unique": false |
| 230 | }, |
| 231 | { |
| 232 | "name": "fa_sha1", |
| 233 | "comment": "find file by sha1, 10 bytes will be enough for hashes to be indexed", |
| 234 | "columns": [ |
| 235 | "fa_sha1" |
| 236 | ], |
| 237 | "unique": false, |
| 238 | "options": { "lengths": [ 10 ] } |
| 239 | } |
| 240 | ], |
| 241 | "pk": [ |
| 242 | "fa_id" |
| 243 | ] |
| 244 | }, |
| 245 | "after": |
| 246 | { |
| 247 | "name": "filearchive", |
| 248 | "comment": "Record of deleted file data", |
| 249 | "columns": [ |
| 250 | { |
| 251 | "name": "fa_id", |
| 252 | "comment": "Unique row id", |
| 253 | "type": "integer", |
| 254 | "options": { |
| 255 | "autoincrement": true, |
| 256 | "unsigned": true, |
| 257 | "notnull": true |
| 258 | } |
| 259 | }, |
| 260 | { |
| 261 | "name": "fa_name", |
| 262 | "comment": "Original base filename; key to image.img_name, page.page_title, etc", |
| 263 | "type": "binary", |
| 264 | "options": { |
| 265 | "notnull": true, |
| 266 | "default": "", |
| 267 | "length": 255 |
| 268 | } |
| 269 | }, |
| 270 | { |
| 271 | "name": "fa_archive_name", |
| 272 | "comment": "Filename of archived file, if an old revision", |
| 273 | "type": "binary", |
| 274 | "options": { |
| 275 | "notnull": false, |
| 276 | "default": "", |
| 277 | "length": 255 |
| 278 | } |
| 279 | }, |
| 280 | { |
| 281 | "name": "fa_storage_group", |
| 282 | "comment": "Which storage bin (directory tree or object store) the file data is stored in. Should be 'deleted' for files that have been deleted; any other bin is not yet in use.", |
| 283 | "type": "binary", |
| 284 | "options": { |
| 285 | "notnull": false, |
| 286 | "length": 16 |
| 287 | } |
| 288 | }, |
| 289 | { |
| 290 | "name": "fa_storage_key", |
| 291 | "comment": "SHA-1 of the file contents plus extension, used as a key for storage. eg 8f8a562add37052a1848ff7771a2c515db94baa9.jpg. If NULL, the file was missing at deletion time or has been purged from the archival storage.", |
| 292 | "type": "binary", |
| 293 | "options": { |
| 294 | "notnull": false, |
| 295 | "default": "", |
| 296 | "length": 64 |
| 297 | } |
| 298 | }, |
| 299 | { |
| 300 | "name": "fa_deleted_user", |
| 301 | "type": "integer", |
| 302 | "options": { |
| 303 | "notnull": false |
| 304 | } |
| 305 | }, |
| 306 | { |
| 307 | "name": "fa_deleted_timestamp", |
| 308 | "type": "mwtimestamp", |
| 309 | "options": { |
| 310 | "notnull": false |
| 311 | } |
| 312 | }, |
| 313 | { |
| 314 | "name": "fa_deleted_reason_id", |
| 315 | "type": "bigint", |
| 316 | "options": { |
| 317 | "unsigned": true, |
| 318 | "notnull": true |
| 319 | } |
| 320 | }, |
| 321 | { |
| 322 | "name": "fa_size", |
| 323 | "type": "bigint", |
| 324 | "options": { |
| 325 | "unsigned": true, |
| 326 | "notnull": false, |
| 327 | "default": 0 |
| 328 | } |
| 329 | }, |
| 330 | { |
| 331 | "name": "fa_width", |
| 332 | "type": "integer", |
| 333 | "options": { |
| 334 | "notnull": false, |
| 335 | "default": 0 |
| 336 | } |
| 337 | }, |
| 338 | { |
| 339 | "name": "fa_height", |
| 340 | "type": "integer", |
| 341 | "options": { |
| 342 | "notnull": false, |
| 343 | "default": 0 |
| 344 | } |
| 345 | }, |
| 346 | { |
| 347 | "name": "fa_metadata", |
| 348 | "type": "blob", |
| 349 | "options": { |
| 350 | "notnull": false, |
| 351 | "length": 16777215 |
| 352 | } |
| 353 | }, |
| 354 | { |
| 355 | "name": "fa_bits", |
| 356 | "type": "integer", |
| 357 | "options": { |
| 358 | "notnull": false, |
| 359 | "default": 0 |
| 360 | } |
| 361 | }, |
| 362 | { |
| 363 | "name": "fa_media_type", |
| 364 | "type": "mwenum", |
| 365 | "options": { |
| 366 | "notnull": false, |
| 367 | "default": null, |
| 368 | "CustomSchemaOptions": { |
| 369 | "enum_values": [ "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE", "3D" ] |
| 370 | } |
| 371 | } |
| 372 | }, |
| 373 | { |
| 374 | "name": "fa_major_mime", |
| 375 | "type": "mwenum", |
| 376 | "options": { |
| 377 | "notnull": false, |
| 378 | "default": "unknown", |
| 379 | "CustomSchemaOptions": { |
| 380 | "enum_values": [ "unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical" ] |
| 381 | } |
| 382 | } |
| 383 | }, |
| 384 | { |
| 385 | "name": "fa_minor_mime", |
| 386 | "type": "binary", |
| 387 | "options": { |
| 388 | "notnull": false, |
| 389 | "default": "unknown", |
| 390 | "length": 100 |
| 391 | } |
| 392 | }, |
| 393 | { |
| 394 | "name": "fa_description_id", |
| 395 | "type": "bigint", |
| 396 | "options": { |
| 397 | "unsigned": true, |
| 398 | "notnull": true |
| 399 | } |
| 400 | }, |
| 401 | { |
| 402 | "name": "fa_actor", |
| 403 | "type": "bigint", |
| 404 | "options": { |
| 405 | "unsigned": true, |
| 406 | "notnull": true |
| 407 | } |
| 408 | }, |
| 409 | { |
| 410 | "name": "fa_timestamp", |
| 411 | "type": "mwtimestamp", |
| 412 | "options": { |
| 413 | "notnull": false |
| 414 | } |
| 415 | }, |
| 416 | { |
| 417 | "name": "fa_deleted", |
| 418 | "comment": "Visibility of deleted revisions, bitfield", |
| 419 | "type": "mwtinyint", |
| 420 | "options": { |
| 421 | "unsigned": true, |
| 422 | "notnull": true, |
| 423 | "default": 0 |
| 424 | } |
| 425 | }, |
| 426 | { |
| 427 | "name": "fa_sha1", |
| 428 | "comment": "sha1 hash of file content", |
| 429 | "type": "binary", |
| 430 | "options": { |
| 431 | "notnull": true, |
| 432 | "default": "", |
| 433 | "length": 32 |
| 434 | } |
| 435 | } |
| 436 | ], |
| 437 | "indexes": [ |
| 438 | { |
| 439 | "name": "fa_name", |
| 440 | "comment": "pick out by image name", |
| 441 | "columns": [ |
| 442 | "fa_name", |
| 443 | "fa_timestamp" |
| 444 | ], |
| 445 | "unique": false |
| 446 | }, |
| 447 | { |
| 448 | "name": "fa_storage_group", |
| 449 | "comment": "pick out dupe files", |
| 450 | "columns": [ |
| 451 | "fa_storage_group", |
| 452 | "fa_storage_key" |
| 453 | ], |
| 454 | "unique": false |
| 455 | }, |
| 456 | { |
| 457 | "name": "fa_deleted_timestamp", |
| 458 | "comment": "sort by deletion time", |
| 459 | "columns": [ |
| 460 | "fa_deleted_timestamp" |
| 461 | ], |
| 462 | "unique": false |
| 463 | }, |
| 464 | { |
| 465 | "name": "fa_actor_timestamp", |
| 466 | "comment": "sort by uploader", |
| 467 | "columns": [ |
| 468 | "fa_actor", |
| 469 | "fa_timestamp" |
| 470 | ], |
| 471 | "unique": false |
| 472 | }, |
| 473 | { |
| 474 | "name": "fa_sha1", |
| 475 | "comment": "find file by sha1, 10 bytes will be enough for hashes to be indexed", |
| 476 | "columns": [ |
| 477 | "fa_sha1" |
| 478 | ], |
| 479 | "unique": false, |
| 480 | "options": { "lengths": [ 10 ] } |
| 481 | } |
| 482 | ], |
| 483 | "pk": [ |
| 484 | "fa_id" |
| 485 | ] |
| 486 | } |
| 487 | } |