/// // Adds a `preferences` JSON field to the `users` auth collection so each user // can persist their PilotVault settings (theme, appearance, profile, etc.). // // Apply by copying this file into your PocketBase deployment's `pb_migrations/` // directory and restarting PocketBase (migrations run automatically on boot). // Written for PocketBase v0.22+/v0.23 (JSVM `migrate((app) => …)` API). If your // PocketBase is older, add the field manually — see pocketbase/README.md. migrate( (app) => { const users = app.findCollectionByNameOrId('users') users.fields.add( new Field({ name: 'preferences', type: 'json', required: false, presentable: false, // ~5 MB — generous headroom (an optional base64 avatar rides along). maxSize: 5000000, }), ) app.save(users) }, (app) => { const users = app.findCollectionByNameOrId('users') users.fields.removeByName('preferences') app.save(users) }, )