{
    "fields": {
        "number": {
            "type": "autoincrement",
            "index": true
        },
        "data": {
            "type": "jsonObject"
        },
        "noteData": {
            "type": "jsonObject",
            "notStorable": true
        },
        "type": {
            "type": "varchar"
        },
        "read": {
            "type": "bool"
        },
        "emailIsProcessed": {
            "type": "bool"
        },
        "user": {
            "type": "link"
        },
        "createdAt": {
            "type": "datetime",
            "readOnly": true
        },
        "message": {
            "type": "text"
        },
        "related": {
            "type": "linkParent",
            "readOnly": true
        },
        "relatedParent": {
            "type": "linkParent",
            "readOnly": true
        }
    },
    "links": {
        "user": {
            "type": "belongsTo",
            "entity": "User"
        },
        "related": {
            "type": "belongsToParent"
        },
        "relatedParent": {
            "type": "belongsToParent"
        }
    },
    "collection": {
        "sortBy": "number",
        "asc": false
    },
    "indexes": {
        "createdAt": {
            "type": "index",
            "columns": ["createdAt"]
        },
        "user": {
            "type": "index",
            "columns": ["userId", "createdAt"]
        }
    }
}
