{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "checkRequiredFalseAndUniqueFalse": {
            "properties": {
                "required": {
                    "type": "boolean",
                    "enum": [
                        false
                    ]
                },
                "unique": {
                    "type": "boolean",
                    "enum": [
                        false
                    ]
                }
            }
        },
        "checkRequiredFalseAndUniqueAny": {
            "properties": {
                "required": {
                    "type": "boolean",
                    "enum": [
                        true
                    ]
                },
                "unique": {
                    "type": "boolean",
                    "enum": [
                        true,
                        false
                    ]
                }
            }
        },
        "migrationField": {
            "title": "Migration field",
            "description": "Representation of a single field from migrations.csv",
            "type": "object",
            "properties": {
                "name": {
                    "title": "Field name",
                    "description": "Database field name",
                    "type": "string",
                    "minLength": 1
                },
                "type": {
                    "title": "Field type",
                    "description": "Database field type (think: field handlers)",
                    "type": "string",
                    "minLength": 1
                },
                "required": {
                    "title": "Required flag",
                    "description": "Defines whether or not the field is required",
                    "type": "boolean",
                    "default": false
                },
                "non-searchable": {
                    "title": "Searchable flag",
                    "description": "Defines whether or not the field is searchable",
                    "type": "boolean",
                    "default": false
                },
                "unique": {
                    "title": "Unique flag",
                    "description": "Defines whether or not the field is contains unique value",
                    "type": "boolean",
                    "default": false
                }
            },
            "additionalProperties": false,
            "required": [
                "name",
                "type"
            ],
            "oneOf": [
                {
                    "$ref": "#/definitions/checkRequiredFalseAndUniqueFalse"
                },
                {
                    "$ref": "#/definitions/checkRequiredFalseAndUniqueAny"
                }
            ]
        }
    },
    "title": "CSV migration",
    "description": "CSV migration configuration",
    "type": "object",
    "properties": {},
    "additionalProperties": {
        "allOf": [
            {
                "$ref": "#/definitions/migrationField"
            }
        ]
    },
    "required": [
        "id",
        "created",
        "modified"
    ]
}