wiki.techinc.nl/maintenance/abstractSchemaChanges/patch-filearchive-fa_size_to_bigint.json
Brian Wolff 86608dfd4f Store image sizes as 64-bit bigint instead of 32-bit integers
This is meant in preparation for MediaWiki supporting files
larger than 4gb.

Bug: T191805
Change-Id: Ie67dd01aa0a8b28d9afc1805243e711fcadbc0f8
2023-10-04 08:01:25 -07:00

487 lines
9.5 KiB
JSON

{
"comment": "Increase fa_size to bigint (T191805)",
"before":
{
"name": "filearchive",
"comment": "Record of deleted file data",
"columns": [
{
"name": "fa_id",
"comment": "Unique row id",
"type": "integer",
"options": {
"autoincrement": true,
"unsigned": true,
"notnull": true
}
},
{
"name": "fa_name",
"comment": "Original base filename; key to image.img_name, page.page_title, etc",
"type": "binary",
"options": {
"notnull": true,
"default": "",
"length": 255
}
},
{
"name": "fa_archive_name",
"comment": "Filename of archived file, if an old revision",
"type": "binary",
"options": {
"notnull": false,
"default": "",
"length": 255
}
},
{
"name": "fa_storage_group",
"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.",
"type": "binary",
"options": {
"notnull": false,
"length": 16
}
},
{
"name": "fa_storage_key",
"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.",
"type": "binary",
"options": {
"notnull": false,
"default": "",
"length": 64
}
},
{
"name": "fa_deleted_user",
"type": "integer",
"options": {
"notnull": false
}
},
{
"name": "fa_deleted_timestamp",
"type": "mwtimestamp",
"options": {
"notnull": false
}
},
{
"name": "fa_deleted_reason_id",
"type": "bigint",
"options": {
"unsigned": true,
"notnull": true
}
},
{
"name": "fa_size",
"type": "integer",
"options": {
"unsigned": true,
"notnull": false,
"default": 0
}
},
{
"name": "fa_width",
"type": "integer",
"options": {
"notnull": false,
"default": 0
}
},
{
"name": "fa_height",
"type": "integer",
"options": {
"notnull": false,
"default": 0
}
},
{
"name": "fa_metadata",
"type": "blob",
"options": {
"notnull": false,
"length": 16777215
}
},
{
"name": "fa_bits",
"type": "integer",
"options": {
"notnull": false,
"default": 0
}
},
{
"name": "fa_media_type",
"type": "mwenum",
"options": {
"notnull": false,
"default": null,
"CustomSchemaOptions": {
"enum_values": [ "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE", "3D" ]
}
}
},
{
"name": "fa_major_mime",
"type": "mwenum",
"options": {
"notnull": false,
"default": "unknown",
"CustomSchemaOptions": {
"enum_values": [ "unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical" ]
}
}
},
{
"name": "fa_minor_mime",
"type": "binary",
"options": {
"notnull": false,
"default": "unknown",
"length": 100
}
},
{
"name": "fa_description_id",
"type": "bigint",
"options": {
"unsigned": true,
"notnull": true
}
},
{
"name": "fa_actor",
"type": "bigint",
"options": {
"unsigned": true,
"notnull": true
}
},
{
"name": "fa_timestamp",
"type": "mwtimestamp",
"options": {
"notnull": false
}
},
{
"name": "fa_deleted",
"comment": "Visibility of deleted revisions, bitfield",
"type": "mwtinyint",
"options": {
"unsigned": true,
"notnull": true,
"default": 0
}
},
{
"name": "fa_sha1",
"comment": "sha1 hash of file content",
"type": "binary",
"options": {
"notnull": true,
"default": "",
"length": 32
}
}
],
"indexes": [
{
"name": "fa_name",
"comment": "pick out by image name",
"columns": [
"fa_name",
"fa_timestamp"
],
"unique": false
},
{
"name": "fa_storage_group",
"comment": "pick out dupe files",
"columns": [
"fa_storage_group",
"fa_storage_key"
],
"unique": false
},
{
"name": "fa_deleted_timestamp",
"comment": "sort by deletion time",
"columns": [
"fa_deleted_timestamp"
],
"unique": false
},
{
"name": "fa_actor_timestamp",
"comment": "sort by uploader",
"columns": [
"fa_actor",
"fa_timestamp"
],
"unique": false
},
{
"name": "fa_sha1",
"comment": "find file by sha1, 10 bytes will be enough for hashes to be indexed",
"columns": [
"fa_sha1"
],
"unique": false,
"options": { "lengths": [ 10 ] }
}
],
"pk": [
"fa_id"
]
},
"after":
{
"name": "filearchive",
"comment": "Record of deleted file data",
"columns": [
{
"name": "fa_id",
"comment": "Unique row id",
"type": "integer",
"options": {
"autoincrement": true,
"unsigned": true,
"notnull": true
}
},
{
"name": "fa_name",
"comment": "Original base filename; key to image.img_name, page.page_title, etc",
"type": "binary",
"options": {
"notnull": true,
"default": "",
"length": 255
}
},
{
"name": "fa_archive_name",
"comment": "Filename of archived file, if an old revision",
"type": "binary",
"options": {
"notnull": false,
"default": "",
"length": 255
}
},
{
"name": "fa_storage_group",
"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.",
"type": "binary",
"options": {
"notnull": false,
"length": 16
}
},
{
"name": "fa_storage_key",
"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.",
"type": "binary",
"options": {
"notnull": false,
"default": "",
"length": 64
}
},
{
"name": "fa_deleted_user",
"type": "integer",
"options": {
"notnull": false
}
},
{
"name": "fa_deleted_timestamp",
"type": "mwtimestamp",
"options": {
"notnull": false
}
},
{
"name": "fa_deleted_reason_id",
"type": "bigint",
"options": {
"unsigned": true,
"notnull": true
}
},
{
"name": "fa_size",
"type": "bigint",
"options": {
"unsigned": true,
"notnull": false,
"default": 0
}
},
{
"name": "fa_width",
"type": "integer",
"options": {
"notnull": false,
"default": 0
}
},
{
"name": "fa_height",
"type": "integer",
"options": {
"notnull": false,
"default": 0
}
},
{
"name": "fa_metadata",
"type": "blob",
"options": {
"notnull": false,
"length": 16777215
}
},
{
"name": "fa_bits",
"type": "integer",
"options": {
"notnull": false,
"default": 0
}
},
{
"name": "fa_media_type",
"type": "mwenum",
"options": {
"notnull": false,
"default": null,
"CustomSchemaOptions": {
"enum_values": [ "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE", "3D" ]
}
}
},
{
"name": "fa_major_mime",
"type": "mwenum",
"options": {
"notnull": false,
"default": "unknown",
"CustomSchemaOptions": {
"enum_values": [ "unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical" ]
}
}
},
{
"name": "fa_minor_mime",
"type": "binary",
"options": {
"notnull": false,
"default": "unknown",
"length": 100
}
},
{
"name": "fa_description_id",
"type": "bigint",
"options": {
"unsigned": true,
"notnull": true
}
},
{
"name": "fa_actor",
"type": "bigint",
"options": {
"unsigned": true,
"notnull": true
}
},
{
"name": "fa_timestamp",
"type": "mwtimestamp",
"options": {
"notnull": false
}
},
{
"name": "fa_deleted",
"comment": "Visibility of deleted revisions, bitfield",
"type": "mwtinyint",
"options": {
"unsigned": true,
"notnull": true,
"default": 0
}
},
{
"name": "fa_sha1",
"comment": "sha1 hash of file content",
"type": "binary",
"options": {
"notnull": true,
"default": "",
"length": 32
}
}
],
"indexes": [
{
"name": "fa_name",
"comment": "pick out by image name",
"columns": [
"fa_name",
"fa_timestamp"
],
"unique": false
},
{
"name": "fa_storage_group",
"comment": "pick out dupe files",
"columns": [
"fa_storage_group",
"fa_storage_key"
],
"unique": false
},
{
"name": "fa_deleted_timestamp",
"comment": "sort by deletion time",
"columns": [
"fa_deleted_timestamp"
],
"unique": false
},
{
"name": "fa_actor_timestamp",
"comment": "sort by uploader",
"columns": [
"fa_actor",
"fa_timestamp"
],
"unique": false
},
{
"name": "fa_sha1",
"comment": "find file by sha1, 10 bytes will be enough for hashes to be indexed",
"columns": [
"fa_sha1"
],
"unique": false,
"options": { "lengths": [ 10 ] }
}
],
"pk": [
"fa_id"
]
}
}