fix polyline db field size (#1047)

This commit is contained in:
slothful-vassal
2026-06-04 17:47:04 +02:00
committed by GitHub
parent 8153cfe14e
commit b304e9975a
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package migrations
import (
"pocketbase/util"
"github.com/pocketbase/pocketbase/core"
m "github.com/pocketbase/pocketbase/migrations"
)
func init() {
m.Register(func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("e864strfxo14pm4")
if err != nil {
return err
}
field, ok := collection.Fields.GetByName("polyline").(*core.TextField)
if ok {
field.Max = util.PolylineMaxLength
}
return app.Save(collection)
}, func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("e864strfxo14pm4")
if err != nil {
return err
}
field, ok := collection.Fields.GetByName("polyline").(*core.TextField)
if ok {
field.Max = 0
}
return app.Save(collection)
})
}