add bungoma_cane_growers

This commit is contained in:
Mohamed Sohail 2024-04-26 12:00:54 +08:00
parent 14102bb77c
commit 759b7b92e5
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
2 changed files with 210 additions and 0 deletions

View File

@ -0,0 +1,105 @@
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("hcgj54gqdujejom")
if err != nil {
return err
}
// update
edit_distributor_name := &schema.SchemaField{}
json.Unmarshal([]byte(`{
"system": false,
"id": "zadtcvlf",
"name": "distributor_name",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"maraba_investments",
"farmers_center",
"farmers_world",
"farmers_desk",
"mazao_na_afya",
"modez_agrovet",
"wakulima_supplies",
"volcano",
"makutano_agrovet",
"kipkomo_agrovet",
"pioneer",
"golden_agrovet",
"skynet_agrovet",
"mkulima_bora",
"beta_green",
"mwangaza_agrovet",
"prima_met_agrovet",
"ikolomani_dairy_coop",
"bungoma_cane_growers"
]
}
}`), edit_distributor_name)
collection.Schema.AddField(edit_distributor_name)
return dao.SaveCollection(collection)
}, func(db dbx.Builder) error {
dao := daos.New(db);
collection, err := dao.FindCollectionByNameOrId("hcgj54gqdujejom")
if err != nil {
return err
}
// update
edit_distributor_name := &schema.SchemaField{}
json.Unmarshal([]byte(`{
"system": false,
"id": "zadtcvlf",
"name": "distributor_name",
"type": "select",
"required": true,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"maraba_investments",
"farmers_center",
"farmers_world",
"farmers_desk",
"mazao_na_afya",
"modez_agrovet",
"wakulima_supplies",
"volcano",
"makutano_agrovet",
"kipkomo_agrovet",
"pioneer",
"golden_agrovet",
"skynet_agrovet",
"mkulima_bora",
"beta_green",
"mwangaza_agrovet",
"prima_met_agrovet",
"ikolomani_dairy_coop"
]
}
}`), edit_distributor_name)
collection.Schema.AddField(edit_distributor_name)
return dao.SaveCollection(collection)
})
}

View File

@ -0,0 +1,105 @@
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("w7vsnhq55laqara")
if err != nil {
return err
}
// update
edit_distributor_name := &schema.SchemaField{}
json.Unmarshal([]byte(`{
"system": false,
"id": "rjvhxlwa",
"name": "distributor_name",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"maraba_investments",
"farmers_center",
"farmers_world",
"farmers_desk",
"mazao_na_afya",
"modez_agrovet",
"wakulima_supplies",
"volcano",
"makutano_agrovet",
"kipkomo_agrovet",
"pioneer",
"golden_agrovet",
"skynet_agrovet",
"mkulima_bora",
"beta_green",
"mwangaza_agrovet",
"prima_met_agrovet",
"ikolomani_dairy_coop",
"bungoma_cane_growers"
]
}
}`), edit_distributor_name)
collection.Schema.AddField(edit_distributor_name)
return dao.SaveCollection(collection)
}, func(db dbx.Builder) error {
dao := daos.New(db);
collection, err := dao.FindCollectionByNameOrId("w7vsnhq55laqara")
if err != nil {
return err
}
// update
edit_distributor_name := &schema.SchemaField{}
json.Unmarshal([]byte(`{
"system": false,
"id": "rjvhxlwa",
"name": "distributor_name",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"maraba_investments",
"farmers_center",
"farmers_world",
"farmers_desk",
"mazao_na_afya",
"modez_agrovet",
"wakulima_supplies",
"volcano",
"makutano_agrovet",
"kipkomo_agrovet",
"pioneer",
"golden_agrovet",
"skynet_agrovet",
"mkulima_bora",
"beta_green",
"mwangaza_agrovet",
"prima_met_agrovet",
"ikolomani_dairy_coop"
]
}
}`), edit_distributor_name)
collection.Schema.AddField(edit_distributor_name)
return dao.SaveCollection(collection)
})
}