Files
viewarr/pocketbase/pb_migrations/1765429605_updated_media.js
2025-12-12 14:56:50 -05:00

29 lines
692 B
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2708086759")
// add field
collection.fields.addAt(5, new Field({
"cascadeDelete": false,
"collectionId": "pbc_2683869272",
"hidden": false,
"id": "relation2834031894",
"maxSelect": 999,
"minSelect": 0,
"name": "genres",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2708086759")
// remove field
collection.fields.removeById("relation2834031894")
return app.save(collection)
})