132 lines
3.4 KiB
JSON
132 lines
3.4 KiB
JSON
[
|
|
{
|
|
"createCollection": "files_file",
|
|
"validator": {
|
|
"$jsonSchema": {
|
|
"bsonType": "object",
|
|
"required": [
|
|
"_id",
|
|
"version",
|
|
"created_at",
|
|
"updated_at",
|
|
"org_id",
|
|
"workspace_id",
|
|
"project_id",
|
|
"status",
|
|
"storage_key",
|
|
"filename",
|
|
"content_type",
|
|
"uploaded_by"
|
|
],
|
|
"properties": {
|
|
"_id": {
|
|
"bsonType": "string",
|
|
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
|
|
},
|
|
"version": {
|
|
"bsonType": "number"
|
|
},
|
|
"created_at": {
|
|
"bsonType": "string",
|
|
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
|
|
},
|
|
"updated_at": {
|
|
"bsonType": "string",
|
|
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
|
|
},
|
|
"org_id": {
|
|
"bsonType": "string",
|
|
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
|
|
},
|
|
"workspace_id": {
|
|
"bsonType": "string",
|
|
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
|
|
},
|
|
"project_id": {
|
|
"bsonType": "string",
|
|
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
|
|
},
|
|
"status": {
|
|
"bsonType": "string",
|
|
"enum": ["pending", "stored", "deleting"]
|
|
},
|
|
"storage_key": {
|
|
"bsonType": "string"
|
|
},
|
|
"filename": {
|
|
"bsonType": "string"
|
|
},
|
|
"content_type": {
|
|
"bsonType": "string"
|
|
},
|
|
"size": {
|
|
"bsonType": ["number", "null"]
|
|
},
|
|
"sha256": {
|
|
"bsonType": ["string", "null"]
|
|
},
|
|
"uploaded_by": {
|
|
"bsonType": "string",
|
|
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
|
|
},
|
|
"stored_at": {
|
|
"bsonType": ["string", "null"]
|
|
},
|
|
"upload_id": {
|
|
"bsonType": ["string", "null"]
|
|
},
|
|
"declared_size": {
|
|
"bsonType": ["number", "null"]
|
|
},
|
|
"part_size": {
|
|
"bsonType": ["number", "null"]
|
|
},
|
|
"deleting_at": {
|
|
"bsonType": ["string", "null"]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"createIndex": {
|
|
"collection": "files_file",
|
|
"keys": {
|
|
"org_id": 1,
|
|
"workspace_id": 1,
|
|
"project_id": 1,
|
|
"storage_key": 1
|
|
},
|
|
"name": "files_file_org_id_workspace_id_project_id_storage_key_key",
|
|
"unique": true
|
|
}
|
|
},
|
|
{
|
|
"createIndex": {
|
|
"collection": "files_file",
|
|
"keys": {
|
|
"org_id": 1,
|
|
"workspace_id": 1,
|
|
"project_id": 1,
|
|
"status": 1
|
|
},
|
|
"name": "files_file_org_id_workspace_id_project_id_status_idx",
|
|
"unique": false
|
|
}
|
|
},
|
|
{
|
|
"createIndex": {
|
|
"collection": "files_file",
|
|
"keys": {
|
|
"org_id": 1,
|
|
"workspace_id": 1,
|
|
"project_id": 1,
|
|
"sha256": 1
|
|
},
|
|
"name": "files_file_org_id_workspace_id_project_id_sha256_idx",
|
|
"unique": false
|
|
}
|
|
}
|
|
]
|