-
Notifications
You must be signed in to change notification settings - Fork 0
/
1689503594_updated_games.go
73 lines (64 loc) · 1.38 KB
/
1689503594_updated_games.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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("vztgyvjzre4vxaf")
if err != nil {
return err
}
// update
edit_status := &schema.SchemaField{}
json.Unmarshal([]byte(`{
"system": false,
"id": "48eqclsh",
"name": "status",
"type": "select",
"required": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"UNPAID",
"PAID",
"EXPIRED",
"ACTIVE"
]
}
}`), edit_status)
collection.Schema.AddField(edit_status)
return dao.SaveCollection(collection)
}, func(db dbx.Builder) error {
dao := daos.New(db);
collection, err := dao.FindCollectionByNameOrId("vztgyvjzre4vxaf")
if err != nil {
return err
}
// update
edit_status := &schema.SchemaField{}
json.Unmarshal([]byte(`{
"system": false,
"id": "48eqclsh",
"name": "status",
"type": "select",
"required": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"UNPAID",
"PAID",
"EXPIRED"
]
}
}`), edit_status)
collection.Schema.AddField(edit_status)
return dao.SaveCollection(collection)
})
}