Files
template-app/modules/notes/adapters/mongo/migrations/0001_notes.json
T

178 lines
4.8 KiB
JSON

[
{
"createCollection": "notes_attachment",
"validator": {
"$jsonSchema": {
"bsonType": "object",
"required": [
"_id",
"version",
"created_at",
"updated_at",
"org_id",
"workspace_id",
"project_id",
"note_id",
"file_id",
"attached_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}$"
},
"note_id": {
"bsonType": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"file_id": {
"bsonType": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"attached_by": {
"bsonType": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
},
"additionalProperties": false
}
}
},
{
"createIndex": {
"collection": "notes_attachment",
"keys": {
"org_id": 1,
"workspace_id": 1,
"project_id": 1,
"note_id": 1,
"file_id": 1
},
"name": "notes_attachment_org_id_workspace_id_project_id_note_id_file_id_key",
"unique": true
}
},
{
"createIndex": {
"collection": "notes_attachment",
"keys": {
"org_id": 1,
"workspace_id": 1,
"project_id": 1,
"note_id": 1
},
"name": "notes_attachment_org_id_workspace_id_project_id_note_id_idx",
"unique": false
}
},
{
"createIndex": {
"collection": "notes_attachment",
"keys": {
"org_id": 1,
"workspace_id": 1,
"project_id": 1,
"file_id": 1
},
"name": "notes_attachment_org_id_workspace_id_project_id_file_id_idx",
"unique": false
}
},
{
"createCollection": "notes_note",
"validator": {
"$jsonSchema": {
"bsonType": "object",
"required": [
"_id",
"version",
"created_at",
"updated_at",
"org_id",
"workspace_id",
"project_id",
"title",
"body",
"created_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}$"
},
"title": {
"bsonType": "string"
},
"body": {
"bsonType": "string"
},
"created_by": {
"bsonType": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
},
"additionalProperties": false
}
}
},
{
"createIndex": {
"collection": "notes_note",
"keys": {
"org_id": 1,
"workspace_id": 1,
"project_id": 1,
"created_by": 1
},
"name": "notes_note_org_id_workspace_id_project_id_created_by_idx",
"unique": false
}
}
]