pockethost/packages/daemon/migrations/1686844479_updated_instances.js
2023-10-02 11:38:15 -07:00

31 lines
645 B
JavaScript

migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// remove
collection.schema.removeField('66vjgzcg')
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: '66vjgzcg',
name: 'isBackupAllowed',
type: 'bool',
required: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
},
)