migrate_collection
Modify collection structure by adding, removing, or updating fields, including data transformations and access rules for PocketBase databases.
Instructions
Add, remove, or modify fields from a collection
Input Schema
Name | Required | Description | Default |
---|---|---|---|
collection | Yes | Collection name | |
createRule | No | Optional new rule for creating records | |
dataTransforms | No | Field transformation mappings for converting old field values to new ones | |
deleteRule | No | Optional new rule for deleting records | |
fields | Yes | New collection fields configuration | |
listRule | No | Optional new rule for listing records | |
name | No | Optional new collection name if you want to rename the collection | |
updateRule | No | Optional new rule for updating records | |
viewRule | No | Optional new rule for viewing records |
Input Schema (JSON Schema)
{
"properties": {
"collection": {
"description": "Collection name",
"type": "string"
},
"createRule": {
"description": "Optional new rule for creating records",
"type": "string"
},
"dataTransforms": {
"description": "Field transformation mappings for converting old field values to new ones",
"type": "object"
},
"deleteRule": {
"description": "Optional new rule for deleting records",
"type": "string"
},
"fields": {
"description": "New collection fields configuration",
"items": {
"properties": {
"name": {
"description": "Field name",
"type": "string"
},
"options": {
"description": "Field-specific options",
"type": "object"
},
"required": {
"description": "Whether the field is required",
"type": "boolean"
},
"type": {
"description": "Field type",
"enum": [
"text",
"number",
"bool",
"email",
"url",
"date",
"select",
"relation",
"file",
"json",
"editor",
"autodate"
],
"type": "string"
}
},
"required": [
"name",
"type"
],
"type": "object"
},
"type": "array"
},
"listRule": {
"description": "Optional new rule for listing records",
"type": "string"
},
"name": {
"description": "Optional new collection name if you want to rename the collection",
"type": "string"
},
"updateRule": {
"description": "Optional new rule for updating records",
"type": "string"
},
"viewRule": {
"description": "Optional new rule for viewing records",
"type": "string"
}
},
"required": [
"collection",
"fields"
],
"type": "object"
}