Add API Server (Go/PocketBase), Web App (Go BFF + Vue), Fly App (Flutter/DJI MSDK), Adobe Plugin, and Docker/Docker AIO deployment configs. Design assets and build artifacts are gitignored. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
33 lines
1.0 KiB
JavaScript
33 lines
1.0 KiB
JavaScript
/// <reference path="../pb_data/types.d.ts" />
|
|
|
|
// 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)
|
|
},
|
|
)
|