Files
wanderer/db/pb_migrations/1706344993_updated_trails.js
Christian Beutel b302ccded0 initial commit
2024-01-27 20:39:12 +01:00

51 lines
1.1 KiB
JavaScript

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