package migrations import ( "encoding/json" "github.com/pocketbase/dbx" "github.com/pocketbase/pocketbase/daos" m "github.com/pocketbase/pocketbase/migrations" "github.com/pocketbase/pocketbase/models/schema" ) func init() { m.Register(func(db dbx.Builder) error { dao := daos.New(db); collection, err := dao.FindCollectionByNameOrId("uutt9wj7d5ejmhz") if err != nil { return err } // update edit_planned_crops := &schema.SchemaField{} json.Unmarshal([]byte(`{ "system": false, "id": "p4n5v8yf", "name": "planned_crops", "type": "select", "required": true, "presentable": false, "unique": false, "options": { "maxSelect": 12, "values": [ "rice", "coffee", "tea", "sugarcane", "miraa", "avocados", "maize", "potatoes", "sorghum", "other_fruits", "other_vegetables", "other_grains", "dragonfruit", "hay", "beans", "soya" ] } }`), edit_planned_crops) collection.Schema.AddField(edit_planned_crops) return dao.SaveCollection(collection) }, func(db dbx.Builder) error { dao := daos.New(db); collection, err := dao.FindCollectionByNameOrId("uutt9wj7d5ejmhz") if err != nil { return err } // update edit_planned_crops := &schema.SchemaField{} json.Unmarshal([]byte(`{ "system": false, "id": "p4n5v8yf", "name": "planned_crops", "type": "select", "required": true, "presentable": false, "unique": false, "options": { "maxSelect": 12, "values": [ "rice", "coffee", "tea", "sugarcane", "miraa", "avocados", "maize", "potatoes", "sorghum", "other_fruits", "other_vegetables", "other_grains", "dragonfruit" ] } }`), edit_planned_crops) collection.Schema.AddField(edit_planned_crops) return dao.SaveCollection(collection) }) }