Files
beszel/internal/migrations/1790193183_network_monitor_cert.go
T

25 lines
588 B
Go

package migrations
import (
"github.com/pocketbase/pocketbase/core"
m "github.com/pocketbase/pocketbase/migrations"
)
func init() {
m.Register(func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("network_monitors")
if err != nil {
return err
}
collection.Fields.Add(&core.JSONField{Name: "certInfo"})
return app.Save(collection)
}, func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("network_monitors")
if err != nil {
return err
}
collection.Fields.RemoveByName("certInfo")
return app.Save(collection)
})
}