fp/services/pocketbase/pb_migrations/1761915570_updated_vods.js
2025-11-05 20:49:00 -09:00

68 lines
1.4 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_144770472")
// add field
collection.fields.addAt(11, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text3889096196",
"max": 0,
"min": 0,
"name": "muxAssetId",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(12, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text1061856600",
"max": 0,
"min": 0,
"name": "muxPlaybackId",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(13, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text1805914144",
"max": 0,
"min": 0,
"name": "ipfsCid",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_144770472")
// remove field
collection.fields.removeById("text3889096196")
// remove field
collection.fields.removeById("text1061856600")
// remove field
collection.fields.removeById("text1805914144")
return app.save(collection)
})