update_collection
Modify and manage existing collections in PocketBase by updating names, types, fields, access rules, and authentication settings. Admin-only tool for schema customization and database optimization.
Instructions
Update an existing collection in PocketBase (admin only)
Input Schema
Name | Required | Description | Default |
---|---|---|---|
collectionIdOrName | Yes | ID or name of the collection to update | |
createRule | No | API rule for creating records | |
deleteRule | No | API rule for deleting records | |
fields | No | List with the new collection fields. If not empty, the old schema will be replaced with the new one. | |
listRule | No | API rule for listing and viewing records | |
name | No | New unique collection name | |
passwordAuth | No | Password authentication options | |
type | No | Type of the collection | |
updateRule | No | API rule for updating records | |
viewQuery | No | SQL query for view collections | |
viewRule | No | API rule for viewing a single record |
Input Schema (JSON Schema)
{
"properties": {
"collectionIdOrName": {
"description": "ID or name of the collection to update",
"type": "string"
},
"createRule": {
"description": "API rule for creating records",
"type": "string"
},
"deleteRule": {
"description": "API rule for deleting records",
"type": "string"
},
"fields": {
"description": "List with the new collection fields. If not empty, the old schema will be replaced with the new one.",
"items": {
"properties": {
"collectionId": {
"description": "Collection ID for relation type fields",
"type": "string"
},
"name": {
"description": "Field name",
"type": "string"
},
"required": {
"description": "Is field required?",
"type": "boolean"
},
"type": {
"description": "Field type",
"enum": [
"bool",
"date",
"number",
"text",
"email",
"url",
"editor",
"autodate",
"select",
"file",
"relation",
"json"
],
"type": "string"
},
"values": {
"description": "Allowed values for select type fields",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
},
"listRule": {
"description": "API rule for listing and viewing records",
"type": "string"
},
"name": {
"description": "New unique collection name",
"type": "string"
},
"passwordAuth": {
"description": "Password authentication options",
"properties": {
"enabled": {
"description": "Is password authentication enabled?",
"type": "boolean"
},
"identityFields": {
"description": "Fields used for identity in password authentication",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": {
"description": "Type of the collection",
"enum": [
"base",
"view",
"auth"
],
"type": "string"
},
"updateRule": {
"description": "API rule for updating records",
"type": "string"
},
"viewQuery": {
"description": "SQL query for view collections",
"type": "string"
},
"viewRule": {
"description": "API rule for viewing a single record",
"type": "string"
}
},
"required": [
"collectionIdOrName"
],
"type": "object"
}