{
	"comment": "Increase oi_size to be a bigint (T191805)",
	"before":
	{
		"name": "oldimage",
		"comment": "Previous revisions of uploaded files. Awkwardly, image rows have to be moved into this table at re-upload time.",
		"columns": [
			{
				"name": "oi_name",
				"comment": "Base filename: key to image.img_name",
				"type": "binary",
				"options": {
					"notnull": true,
					"default": "",
					"length": 255
				}
			},
			{
				"name": "oi_archive_name",
				"comment": "Filename of the archived file. This is generally a timestamp and '!' prepended to the base name.",
				"type": "binary",
				"options": {
					"notnull": true,
					"default": "",
					"length": 255
				}
			},
			{
				"name": "oi_size",
				"type": "integer",
				"options": {
					"unsigned": true,
					"notnull": true,
					"default": 0
				}
			},
			{
				"name": "oi_width",
				"type": "integer",
				"options": {
					"notnull": true,
					"default": 0
				}
			},
			{
				"name": "oi_height",
				"type": "integer",
				"options": {
					"notnull": true,
					"default": 0
				}
			},
			{
				"name": "oi_bits",
				"type": "integer",
				"options": {
					"notnull": true,
					"default": 0
				}
			},
			{
				"name": "oi_description_id",
				"type": "bigint",
				"options": {
					"unsigned": true,
					"notnull": true
				}
			},
			{
				"name": "oi_actor",
				"type": "bigint",
				"options": {
					"unsigned": true,
					"notnull": true
				}
			},
			{
				"name": "oi_timestamp",
				"type": "mwtimestamp",
				"options": {
					"notnull": true
				}
			},
			{
				"name": "oi_metadata",
				"type": "blob",
				"options": {
					"notnull": true,
					"length": 16777215
				}
			},
			{
				"name": "oi_media_type",
				"type": "mwenum",
				"options": {
					"notnull": false,
					"default": null,
					"CustomSchemaOptions": {
						"enum_values": [ "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE", "3D" ]
					}
				}
			},
			{
				"name": "oi_major_mime",
				"type": "mwenum",
				"options": {
					"notnull": true,
					"default": "unknown",
					"CustomSchemaOptions": {
						"enum_values": [ "unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical" ]
					}
				}
			},
			{
				"name": "oi_minor_mime",
				"type": "binary",
				"options": {
					"notnull": true,
					"default": "unknown",
					"length": 100
				}
			},
			{
				"name": "oi_deleted",
				"type": "mwtinyint",
				"options": {
					"unsigned": true,
					"notnull": true,
					"default": 0
				}
			},
			{
				"name": "oi_sha1",
				"type": "binary",
				"options": {
					"notnull": true,
					"default": "",
					"length": 32
				}
			}
		],
		"indexes": [
			{
				"name": "oi_actor_timestamp",
				"columns": [
					"oi_actor",
					"oi_timestamp"
				],
				"unique": false
			},
			{
				"name": "oi_name_timestamp",
				"columns": [
					"oi_name",
					"oi_timestamp"
				],
				"unique": false
			},
			{
				"name": "oi_name_archive_name",
				"comment": "oi_archive_name truncated to 14 to avoid key length overflow",
				"columns": [
					"oi_name",
					"oi_archive_name"
				],
				"unique": false,
				"options": { "lengths": [ null, 14 ] }
			},
			{
				"name": "oi_sha1",
				"columns": [
					"oi_sha1"
				],
				"unique": false,
				"options": { "lengths": [ 10 ] }
			},
			{
				"name": "oi_timestamp",
				"comment": "Used by Special:ListFiles",
				"columns": [
					"oi_timestamp"
				],
				"unique": false
			}
		]
	},
	"after":
	{
		"name": "oldimage",
		"comment": "Previous revisions of uploaded files. Awkwardly, image rows have to be moved into this table at re-upload time.",
		"columns": [
			{
				"name": "oi_name",
				"comment": "Base filename: key to image.img_name",
				"type": "binary",
				"options": {
					"notnull": true,
					"default": "",
					"length": 255
				}
			},
			{
				"name": "oi_archive_name",
				"comment": "Filename of the archived file. This is generally a timestamp and '!' prepended to the base name.",
				"type": "binary",
				"options": {
					"notnull": true,
					"default": "",
					"length": 255
				}
			},
			{
				"name": "oi_size",
				"type": "bigint",
				"options": {
					"unsigned": true,
					"notnull": true,
					"default": 0
				}
			},
			{
				"name": "oi_width",
				"type": "integer",
				"options": {
					"notnull": true,
					"default": 0
				}
			},
			{
				"name": "oi_height",
				"type": "integer",
				"options": {
					"notnull": true,
					"default": 0
				}
			},
			{
				"name": "oi_bits",
				"type": "integer",
				"options": {
					"notnull": true,
					"default": 0
				}
			},
			{
				"name": "oi_description_id",
				"type": "bigint",
				"options": {
					"unsigned": true,
					"notnull": true
				}
			},
			{
				"name": "oi_actor",
				"type": "bigint",
				"options": {
					"unsigned": true,
					"notnull": true
				}
			},
			{
				"name": "oi_timestamp",
				"type": "mwtimestamp",
				"options": {
					"notnull": true
				}
			},
			{
				"name": "oi_metadata",
				"type": "blob",
				"options": {
					"notnull": true,
					"length": 16777215
				}
			},
			{
				"name": "oi_media_type",
				"type": "mwenum",
				"options": {
					"notnull": false,
					"default": null,
					"CustomSchemaOptions": {
						"enum_values": [ "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE", "3D" ]
					}
				}
			},
			{
				"name": "oi_major_mime",
				"type": "mwenum",
				"options": {
					"notnull": true,
					"default": "unknown",
					"CustomSchemaOptions": {
						"enum_values": [ "unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical" ]
					}
				}
			},
			{
				"name": "oi_minor_mime",
				"type": "binary",
				"options": {
					"notnull": true,
					"default": "unknown",
					"length": 100
				}
			},
			{
				"name": "oi_deleted",
				"type": "mwtinyint",
				"options": {
					"unsigned": true,
					"notnull": true,
					"default": 0
				}
			},
			{
				"name": "oi_sha1",
				"type": "binary",
				"options": {
					"notnull": true,
					"default": "",
					"length": 32
				}
			}
		],
		"indexes": [
			{
				"name": "oi_actor_timestamp",
				"columns": [
					"oi_actor",
					"oi_timestamp"
				],
				"unique": false
			},
			{
				"name": "oi_name_timestamp",
				"columns": [
					"oi_name",
					"oi_timestamp"
				],
				"unique": false
			},
			{
				"name": "oi_name_archive_name",
				"comment": "oi_archive_name truncated to 14 to avoid key length overflow",
				"columns": [
					"oi_name",
					"oi_archive_name"
				],
				"unique": false,
				"options": { "lengths": [ null, 14 ] }
			},
			{
				"name": "oi_sha1",
				"columns": [
					"oi_sha1"
				],
				"unique": false,
				"options": { "lengths": [ 10 ] }
			},
			{
				"name": "oi_timestamp",
				"comment": "Used by Special:ListFiles",
				"columns": [
					"oi_timestamp"
				],
				"unique": false
			}
		]
	}
}
