pocketbase_demo/pb_migrations/1771399136_updated_articles.js

24 lines
574 B
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_4287850865")
// add field
collection.fields.addAt(5, new Field({
"hidden": false,
"id": "bool1748787223",
"name": "published",
"presentable": true,
"required": false,
"system": false,
"type": "bool"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_4287850865")
// remove field
collection.fields.removeById("bool1748787223")
return app.save(collection)
})