Files
vitrify-me/apps/pocketbase/pb_migrations/1756153671_updated_resources.js
2025-08-26 16:49:54 +04:00

30 lines
672 B
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2337082678")
// remove field
collection.fields.removeById("text1579384326")
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2337082678")
// add field
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text1579384326",
"max": 0,
"min": 0,
"name": "name",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
}))
return app.save(collection)
})