mirror of
https://github.com/grassrootseconomics/farmstar-survey-backend.git
synced 2024-12-04 15:36:48 +01:00
add new distributors + nandi county
This commit is contained in:
parent
af559727b2
commit
0107aad0dd
117
migrations/1717729070_updated_distributor_base.go
Normal file
117
migrations/1717729070_updated_distributor_base.go
Normal file
@ -0,0 +1,117 @@
|
||||
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",
|
||||
"sochoi_agro_stores",
|
||||
"lessos_agrovet_shop",
|
||||
"mkulima_agro_engineer",
|
||||
"kfa_kapsabet",
|
||||
"mashambani_agrovet_lessos",
|
||||
"baraton_farm_solution",
|
||||
"new_kamoiywo",
|
||||
"moi_agro_stores_kaptumo"
|
||||
]
|
||||
}
|
||||
}`), 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",
|
||||
"bungoma_cane_growers",
|
||||
"sochoi_agro_stores",
|
||||
"lessos_agrovet_shop",
|
||||
"mkulima_agro_engineer"
|
||||
]
|
||||
}
|
||||
}`), edit_distributor_name)
|
||||
collection.Schema.AddField(edit_distributor_name)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
117
migrations/1717729088_updated_transactions.go
Normal file
117
migrations/1717729088_updated_transactions.go
Normal file
@ -0,0 +1,117 @@
|
||||
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",
|
||||
"sochoi_agro_stores",
|
||||
"lessos_agrovet_shop",
|
||||
"mkulima_agro_engineer",
|
||||
"kfa_kapsabet",
|
||||
"mashambani_agrovet_lessos",
|
||||
"baraton_farm_solution",
|
||||
"new_kamoiywo",
|
||||
"moi_agro_stores_kaptumo"
|
||||
]
|
||||
}
|
||||
}`), 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",
|
||||
"bungoma_cane_growers",
|
||||
"sochoi_agro_stores",
|
||||
"lessos_agrovet_shop",
|
||||
"mkulima_agro_engineer"
|
||||
]
|
||||
}
|
||||
}`), edit_distributor_name)
|
||||
collection.Schema.AddField(edit_distributor_name)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
92
migrations/1717729252_updated_farmer_farm.go
Normal file
92
migrations/1717729252_updated_farmer_farm.go
Normal file
@ -0,0 +1,92 @@
|
||||
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_county := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "murxdavm",
|
||||
"name": "county",
|
||||
"type": "select",
|
||||
"required": true,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"kirinyaga",
|
||||
"muranga",
|
||||
"nakuru",
|
||||
"meru",
|
||||
"uasin_gishu",
|
||||
"kajiado",
|
||||
"kericho",
|
||||
"elgeyo_marakwet",
|
||||
"kakamega",
|
||||
"bungoma",
|
||||
"nyandarua",
|
||||
"nandi_county"
|
||||
]
|
||||
}
|
||||
}`), edit_county)
|
||||
collection.Schema.AddField(edit_county)
|
||||
|
||||
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_county := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "murxdavm",
|
||||
"name": "county",
|
||||
"type": "select",
|
||||
"required": true,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"kirinyaga",
|
||||
"muranga",
|
||||
"nakuru",
|
||||
"meru",
|
||||
"uasin_gishu",
|
||||
"kajiado",
|
||||
"kericho",
|
||||
"elgeyo_marakwet",
|
||||
"kakamega",
|
||||
"bungoma",
|
||||
"nyandarua",
|
||||
"nandi"
|
||||
]
|
||||
}
|
||||
}`), edit_county)
|
||||
collection.Schema.AddField(edit_county)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
92
migrations/1717729259_updated_farmer_farm.go
Normal file
92
migrations/1717729259_updated_farmer_farm.go
Normal file
@ -0,0 +1,92 @@
|
||||
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_county := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "murxdavm",
|
||||
"name": "county",
|
||||
"type": "select",
|
||||
"required": true,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"kirinyaga",
|
||||
"muranga",
|
||||
"nakuru",
|
||||
"meru",
|
||||
"uasin_gishu",
|
||||
"kajiado",
|
||||
"kericho",
|
||||
"elgeyo_marakwet",
|
||||
"kakamega",
|
||||
"bungoma",
|
||||
"nyandarua",
|
||||
"nandi"
|
||||
]
|
||||
}
|
||||
}`), edit_county)
|
||||
collection.Schema.AddField(edit_county)
|
||||
|
||||
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_county := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "murxdavm",
|
||||
"name": "county",
|
||||
"type": "select",
|
||||
"required": true,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"kirinyaga",
|
||||
"muranga",
|
||||
"nakuru",
|
||||
"meru",
|
||||
"uasin_gishu",
|
||||
"kajiado",
|
||||
"kericho",
|
||||
"elgeyo_marakwet",
|
||||
"kakamega",
|
||||
"bungoma",
|
||||
"nyandarua",
|
||||
"nandi_county"
|
||||
]
|
||||
}
|
||||
}`), edit_county)
|
||||
collection.Schema.AddField(edit_county)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue
Block a user