{
    "fields": {
        "token": {
            "type": "varchar",
            "maxLength": 36,
            "index": true,
            "readOnly": true
        },
        "hash": {
            "type": "varchar",
            "maxLength": 150,
            "index": true,
            "readOnly": true
        },
        "secret": {
            "type": "varchar",
            "maxLength": 36,
            "readOnly": true
        },
        "user": {
            "type": "link",
            "readOnly": true,
            "view": "views/fields/user"
        },
        "portal": {
            "type": "link",
            "readOnly": true
        },
        "ipAddress": {
            "type": "varchar",
            "maxLength": 45,
            "readOnly": true
        },
        "isActive": {
            "type": "bool",
            "default": true
        },
        "lastAccess": {
            "type": "datetime",
            "readOnly": true,
            "hasSeconds": true
        },
        "createdAt": {
            "type": "datetime",
            "readOnly": true,
            "hasSeconds": true
        },
        "modifiedAt": {
            "type": "datetime",
            "readOnly": true
        }
    },
    "links": {
        "user": {
            "type": "belongsTo",
            "entity": "User"
        },
        "portal": {
            "type": "belongsTo",
            "entity": "Portal"
        },
        "actionHistoryRecords": {
            "type": "hasMany",
            "entity": "ActionHistoryRecord",
            "foreign": "authToken"
        }
    },
    "collection": {
        "orderBy": "lastAccess",
        "order": "desc",
        "textFilterFields": ["ipAddress", "userName"]
    },
    "indexes": {
        "token": {
            "columns": ["token", "deleted"]
        }
    },
    "hooksDisabled": true
}
