feat: add dragon fruit crop

This commit is contained in:
Mohamed Sohail 2024-02-21 20:51:39 +03:00
parent ce8a3920da
commit 2ee353aae8
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
4 changed files with 372 additions and 0 deletions

View File

@ -0,0 +1,93 @@
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"
]
}
}`), 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"
]
}
}`), edit_evergrow_crops)
collection.Schema.AddField(edit_evergrow_crops)
return dao.SaveCollection(collection)
})
}

View File

@ -0,0 +1,93 @@
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"
]
}
}`), 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"
]
}
}`), edit_planned_crops)
collection.Schema.AddField(edit_planned_crops)
return dao.SaveCollection(collection)
})
}

View File

@ -0,0 +1,93 @@
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"
]
}
}`), 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"
]
}
}`), edit_crops)
collection.Schema.AddField(edit_crops)
return dao.SaveCollection(collection)
})
}

View File

@ -0,0 +1,93 @@
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"
]
}
}`), 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"
]
}
}`), edit_crop)
collection.Schema.AddField(edit_crop)
return dao.SaveCollection(collection)
})
}