- Added new system models for assistant, attachment, audit, chat, config, dsl, history, and kb with metadata including tags, built-in status, read-only attributes, and sort order. - Refactored the model loading process to include a dedicated function for loading system models, improving organization and maintainability. - Updated the application loading logic to set a default prefix for system tables, ensuring consistent naming conventions. - Improved error handling during model loading and migration processes for better reliability.
150 lines
3.2 KiB
Text
150 lines
3.2 KiB
Text
{
|
|
"name": "attachment",
|
|
"label": "Attachment",
|
|
"description": "Attachment table for storing file attachments with metadata and access control",
|
|
"tags": ["system"],
|
|
"builtin": true,
|
|
"readonly": true,
|
|
"sort": 9999,
|
|
"table": {
|
|
"name": "attachment",
|
|
"comment": "Attachment table"
|
|
},
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "ID",
|
|
"label": "Attachment ID",
|
|
"comment": "Unique attachment identifier"
|
|
},
|
|
{
|
|
"name": "file_id",
|
|
"type": "string",
|
|
"label": "File ID",
|
|
"comment": "File identifier",
|
|
"length": 255,
|
|
"nullable": false,
|
|
"unique": true,
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "uid",
|
|
"type": "string",
|
|
"label": "User ID",
|
|
"comment": "User identifier",
|
|
"length": 255,
|
|
"nullable": false,
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "guest",
|
|
"type": "boolean",
|
|
"label": "Guest",
|
|
"comment": "Whether uploaded by guest user",
|
|
"default": false,
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "manager",
|
|
"type": "string",
|
|
"label": "Manager",
|
|
"comment": "File manager type",
|
|
"length": 200,
|
|
"nullable": false,
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "content_type",
|
|
"type": "string",
|
|
"label": "Content Type",
|
|
"comment": "File content type",
|
|
"length": 200,
|
|
"nullable": false,
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "string",
|
|
"label": "Name",
|
|
"comment": "File name",
|
|
"length": 500,
|
|
"nullable": false,
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "public",
|
|
"type": "boolean",
|
|
"label": "Public",
|
|
"comment": "Whether file is public",
|
|
"default": false,
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "scope",
|
|
"type": "json",
|
|
"label": "Scope",
|
|
"comment": "File access scope",
|
|
"nullable": true
|
|
},
|
|
{
|
|
"name": "gzip",
|
|
"type": "boolean",
|
|
"label": "Gzip",
|
|
"comment": "Whether file is gzipped",
|
|
"default": false,
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "bytes",
|
|
"type": "bigInteger",
|
|
"label": "Bytes",
|
|
"comment": "File size in bytes",
|
|
"nullable": false,
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"type": "string",
|
|
"label": "Collection ID",
|
|
"comment": "Knowledge collection identifier",
|
|
"length": 200,
|
|
"nullable": true,
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "enum",
|
|
"label": "Status",
|
|
"comment": "File processing status",
|
|
"option": [
|
|
"uploading",
|
|
"uploaded",
|
|
"indexing",
|
|
"indexed",
|
|
"upload_failed",
|
|
"index_failed"
|
|
],
|
|
"default": "uploading",
|
|
"index": true
|
|
},
|
|
{
|
|
"name": "progress",
|
|
"type": "string",
|
|
"label": "Progress",
|
|
"comment": "Processing progress information",
|
|
"length": 200,
|
|
"nullable": true
|
|
},
|
|
{
|
|
"name": "error",
|
|
"type": "string",
|
|
"label": "Error",
|
|
"comment": "Error information",
|
|
"length": 600,
|
|
"nullable": true
|
|
}
|
|
],
|
|
"relations": {},
|
|
"indexes": [],
|
|
"option": { "timestamps": true, "soft_deletes": false }
|
|
}
|