Lightweight server monitoring with historical data, docker stats, and alerts.
package migrations
import (
"ganigeorgiev.com/pocketbase/pocketbase/core"
m "ganigeorgiev.com/pocketbase/pocketbase/migrations"
)
func init() {
m.Register(func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("system_details")
if err != nil {
return err
}
collection.Fields.Add(&core.NumberField{Id: "system_details_sockets", Name: "sockets", OnlyInt: true})
return app.Save(collection)
}, func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("system_details")
if err != nil {
return err
}
collection.Fields.RemoveByName("sockets")
return app.Save(collection)
})
}