mirror of
https://github.com/grassrootseconomics/farmstar-survey-backend.git
synced 2024-12-04 15:36:48 +01:00
add hay, beans, soya
This commit is contained in:
parent
128966748e
commit
14102bb77c
97
migrations/1714103895_updated_farmer_evergrow.go
Normal file
97
migrations/1714103895_updated_farmer_evergrow.go
Normal file
@ -0,0 +1,97 @@
|
||||
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("4f0a5b2wec6okxi")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_evergrow_crops := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "5kxslfpx",
|
||||
"name": "evergrow_crops",
|
||||
"type": "select",
|
||||
"required": false,
|
||||
"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_evergrow_crops)
|
||||
collection.Schema.AddField(edit_evergrow_crops)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("4f0a5b2wec6okxi")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_evergrow_crops := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "5kxslfpx",
|
||||
"name": "evergrow_crops",
|
||||
"type": "select",
|
||||
"required": false,
|
||||
"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_evergrow_crops)
|
||||
collection.Schema.AddField(edit_evergrow_crops)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
97
migrations/1714103912_updated_farmer_farm.go
Normal file
97
migrations/1714103912_updated_farmer_farm.go
Normal file
@ -0,0 +1,97 @@
|
||||
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)
|
||||
})
|
||||
}
|
97
migrations/1714103919_updated_farmer_other_fertilizers.go
Normal file
97
migrations/1714103919_updated_farmer_other_fertilizers.go
Normal file
@ -0,0 +1,97 @@
|
||||
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("o7i7dkfc0x2bw22")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_crops := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "ltb2rowr",
|
||||
"name": "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_crops)
|
||||
collection.Schema.AddField(edit_crops)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("o7i7dkfc0x2bw22")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_crops := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "ltb2rowr",
|
||||
"name": "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_crops)
|
||||
collection.Schema.AddField(edit_crops)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
97
migrations/1714103924_updated_farmer_past_harvest.go
Normal file
97
migrations/1714103924_updated_farmer_past_harvest.go
Normal file
@ -0,0 +1,97 @@
|
||||
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("5pbnsptw25ip6b1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_crop := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "gt06xc9v",
|
||||
"name": "crop",
|
||||
"type": "select",
|
||||
"required": true,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"rice",
|
||||
"coffee",
|
||||
"tea",
|
||||
"sugarcane",
|
||||
"miraa",
|
||||
"avocados",
|
||||
"maize",
|
||||
"potatoes",
|
||||
"sorghum",
|
||||
"other_fruits",
|
||||
"other_vegetables",
|
||||
"other_grains",
|
||||
"dragonfruit",
|
||||
"hay",
|
||||
"beans",
|
||||
"soya"
|
||||
]
|
||||
}
|
||||
}`), edit_crop)
|
||||
collection.Schema.AddField(edit_crop)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("5pbnsptw25ip6b1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_crop := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "gt06xc9v",
|
||||
"name": "crop",
|
||||
"type": "select",
|
||||
"required": true,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"rice",
|
||||
"coffee",
|
||||
"tea",
|
||||
"sugarcane",
|
||||
"miraa",
|
||||
"avocados",
|
||||
"maize",
|
||||
"potatoes",
|
||||
"sorghum",
|
||||
"other_fruits",
|
||||
"other_vegetables",
|
||||
"other_grains",
|
||||
"dragonfruit"
|
||||
]
|
||||
}
|
||||
}`), edit_crop)
|
||||
collection.Schema.AddField(edit_crop)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue
Block a user