silvester-23/pb_migrations/1700739877_updated_invites.js

32 lines
713 B
JavaScript
Raw Permalink Normal View History

2023-11-23 12:45:46 +01:00
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("zfbbb4gbdk9dh6k")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "6j9gxbgv",
"name": "skin_color",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("zfbbb4gbdk9dh6k")
// remove
collection.schema.removeField("6j9gxbgv")
return dao.saveCollection(collection)
})