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

37 lines
807 B
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('systemprofiles0')
// remove
collection.schema.removeField('rgwv4xhk')
return dao.saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('systemprofiles0')
// add
collection.schema.addField(
new SchemaField({
system: false,
id: 'rgwv4xhk',
name: 'totalSecondsThisMonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
return dao.saveCollection(collection)
},
)