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

125 lines
2.6 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_144770472")
// remove field
collection.fields.removeById("file3785949232")
// remove field
collection.fields.removeById("file651090729")
// remove field
collection.fields.removeById("file3277268710")
// add field
collection.fields.addAt(8, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text3785949232",
"max": 0,
"min": 0,
"name": "sourceVideo",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(9, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text651090729",
"max": 0,
"min": 0,
"name": "segments",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(10, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text3277268710",
"max": 0,
"min": 0,
"name": "thumbnail",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_144770472")
// add field
collection.fields.addAt(6, new Field({
"hidden": false,
"id": "file3785949232",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [],
"name": "sourceVideo",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
}))
// add field
collection.fields.addAt(7, new Field({
"hidden": false,
"id": "file651090729",
"maxSelect": 99,
"maxSize": 0,
"mimeTypes": [],
"name": "segments",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
}))
// add field
collection.fields.addAt(8, new Field({
"hidden": false,
"id": "file3277268710",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [],
"name": "thumbnail",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
}))
// remove field
collection.fields.removeById("text3785949232")
// remove field
collection.fields.removeById("text651090729")
// remove field
collection.fields.removeById("text3277268710")
return app.save(collection)
})